16
16
17
17
package com .example .bigquery ;
18
18
19
+ // [START bigquery_create_table_external_hivepartitioned]
19
20
// [START bigquery_set_hivepartitioningoptions]
20
21
import com .google .cloud .bigquery .BigQuery ;
21
22
import com .google .cloud .bigquery .BigQueryException ;
27
28
import com .google .cloud .bigquery .TableInfo ;
28
29
29
30
// Sample to create external table using hive partitioning
30
- public class SetHivePartitioningOptions {
31
+ public class CreateTableExternalHivePartitioned {
31
32
32
33
public static void main (String [] args ) {
33
34
// TODO(developer): Replace these variables before running the sample.
@@ -36,10 +37,10 @@ public static void main(String[] args) {
36
37
String sourceUri = "gs://cloud-samples-data/bigquery/hive-partitioning-samples/customlayout/*" ;
37
38
String sourceUriPrefix =
38
39
"gs://cloud-samples-data/bigquery/hive-partitioning-samples/customlayout/{pkey:STRING}/" ;
39
- setHivePartitioningOptions (datasetName , tableName , sourceUriPrefix , sourceUri );
40
+ createTableExternalHivePartitioned (datasetName , tableName , sourceUriPrefix , sourceUri );
40
41
}
41
42
42
- public static void setHivePartitioningOptions (
43
+ public static void createTableExternalHivePartitioned (
43
44
String datasetName , String tableName , String sourceUriPrefix , String sourceUri ) {
44
45
try {
45
46
// Initialize client that will be used to send requests. This client only needs to be created
@@ -68,3 +69,4 @@ public static void setHivePartitioningOptions(
68
69
}
69
70
}
70
71
// [END bigquery_set_hivepartitioningoptions]
72
+ // [END bigquery_create_table_external_hivepartitioned]
0 commit comments