congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
TimePartitioning.of
Code IndexAdd Tabnine to your IDE (free)

How to use
of
method
in
com.google.cloud.bigquery.TimePartitioning

Best Java code snippets using com.google.cloud.bigquery.TimePartitioning.of (Showing top 9 results out of 315)

origin: googleapis/google-cloud-java

@Test
public void testTypeOf_Npe() {
 thrown.expect(NullPointerException.class);
 TimePartitioning.of(null);
}
origin: googleapis/google-cloud-java

@Test
public void testTypeAndExpirationOf_Npe() {
 thrown.expect(NullPointerException.class);
 TimePartitioning.of(null, EXPIRATION_MS);
}
origin: googleapis/google-cloud-java

 /** Example of creating a table in the dataset with schema and time partitioning. */
 // [TARGET create(String, TableDefinition, TableOption...)]
 // [VARIABLE “my_table”]
 // [VARIABLE “my_field”]
 public Table createTable(String tableName, String fieldName) {
  // [START ]
  Schema schema = Schema.of(Field.of(fieldName, LegacySQLTypeName.STRING));
  StandardTableDefinition definition =
    StandardTableDefinition.newBuilder()
      .setSchema(schema)
      .setTimePartitioning(TimePartitioning.of(TimePartitioning.Type.DAY))
      .build();
  Table table = dataset.create(tableName, definition);
  // [END ]
  return table;
 }
}
origin: googleapis/google-cloud-java

@Test
public void testToAndFromPb() {
 compareTimePartitioning(TIME_PARTITIONING, TimePartitioning.fromPb(TIME_PARTITIONING.toPb()));
 TimePartitioning partitioning = TimePartitioning.of(TYPE);
 compareTimePartitioning(partitioning, TimePartitioning.fromPb(partitioning.toPb()));
}
origin: googleapis/google-cloud-java

@Test
public void testOf() {
 assertEquals(TYPE, TIME_PARTITIONING.getType());
 assertEquals(EXPIRATION_MS, TIME_PARTITIONING.getExpirationMs().longValue());
 assertEquals(REQUIRE_PARTITION_FILTER, TIME_PARTITIONING.getRequirePartitionFilter());
 assertEquals(FIELD, TIME_PARTITIONING.getField());
 TimePartitioning partitioning = TimePartitioning.of(TYPE);
 assertEquals(TYPE, partitioning.getType());
 assertNull(partitioning.getExpirationMs());
}
origin: googleapis/google-cloud-java

StandardTableDefinition.newBuilder()
  .setSchema(TABLE_SCHEMA)
  .setTimePartitioning(TimePartitioning.of(Type.DAY))
  .build();
    tableDefinition
      .toBuilder()
      .setTimePartitioning(TimePartitioning.of(Type.DAY, 42L))
      .build())
  .build()
    tableDefinition
      .toBuilder()
      .setTimePartitioning(TimePartitioning.of(Type.DAY))
      .build())
  .build()
origin: googleapis/google-cloud-java

String tableName = "test_create_and_get_table";
TableId tableId = TableId.of(DATASET, tableName);
TimePartitioning partitioning = TimePartitioning.of(Type.DAY);
Clustering clustering =
  Clustering.newBuilder().setFields(ImmutableList.of(STRING_FIELD_SCHEMA.getName())).build();
origin: wepay/kafka-connect-bigquery

 TableInfo constructTableInfo(TableId table, Schema kafkaConnectSchema) {
  com.google.cloud.bigquery.Schema bigQuerySchema =
    schemaConverter.convertSchema(kafkaConnectSchema);
  StandardTableDefinition tableDefinition = StandardTableDefinition.newBuilder()
    .setSchema(bigQuerySchema)
    .setTimePartitioning(TimePartitioning.of(TimePartitioning.Type.DAY))
    .build();
  TableInfo.Builder tableInfoBuilder =
    TableInfo.newBuilder(table, tableDefinition);
  if (kafkaConnectSchema.doc() != null) {
   tableInfoBuilder.setDescription(kafkaConnectSchema.doc());
  }
  return tableInfoBuilder.build();
 }
}
origin: gojek/feast

  StandardTableDefinition.newBuilder()
    .setSchema(schema)
    .setTimePartitioning(TimePartitioning.of(Type.DAY))
    .build();
TableInfo tableInfo = TableInfo.newBuilder(tableId, tableDefinition).build();
com.google.cloud.bigqueryTimePartitioningof

Javadoc

Returns a TimePartitioning object given the time partitioning type. Currently, the only type supported is Type#DAY, which will generate one partition per day based on data loading time. The partitions will not expire.

Popular methods of TimePartitioning

  • fromPb
  • toPb
  • getExpirationMs
    Returns the number of milliseconds for which to keep the storage for a partition. When expired, the
  • getField
    If not set, the table is partitioned by pseudo column '_PARTITIONTIME'; if set, the table is partiti
  • getRequirePartitionFilter
    If set to true, queries over this table require a partition filter (that can be used for partition e
  • getType
    Returns the time partitioning type. Currently, the only type supported is Type#DAY, which will gener
  • newBuilder
    Returns a TimePartitioning object given the time partitioning type. Currently, the only type support
  • <init>

Popular in Java

  • Finding current android device location
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getContentResolver (Context)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Collectors (java.util.stream)
  • Reference (javax.naming)
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now