Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 50bf783

Browse files
authoredJan 29, 2021
docs(samples): Update region tag for create table external hive partitioning (#1079)
* docs(samples): updates region tag and file name * docs(samples): updates region tag and file name * docs(samples): updates class name
1 parent 2890c80 commit 50bf783

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed
 

‎samples/snippets/src/main/java/com/example/bigquery/SetHivePartitioningOptions.java ‎samples/snippets/src/main/java/com/example/bigquery/CreateTableExternalHivePartitioned.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.example.bigquery;
1818

19+
// [START bigquery_create_table_external_hivepartitioned]
1920
// [START bigquery_set_hivepartitioningoptions]
2021
import com.google.cloud.bigquery.BigQuery;
2122
import com.google.cloud.bigquery.BigQueryException;
@@ -27,7 +28,7 @@
2728
import com.google.cloud.bigquery.TableInfo;
2829

2930
// Sample to create external table using hive partitioning
30-
public class SetHivePartitioningOptions {
31+
public class CreateTableExternalHivePartitioned {
3132

3233
public static void main(String[] args) {
3334
// TODO(developer): Replace these variables before running the sample.
@@ -36,10 +37,10 @@ public static void main(String[] args) {
3637
String sourceUri = "gs://cloud-samples-data/bigquery/hive-partitioning-samples/customlayout/*";
3738
String sourceUriPrefix =
3839
"gs://cloud-samples-data/bigquery/hive-partitioning-samples/customlayout/{pkey:STRING}/";
39-
setHivePartitioningOptions(datasetName, tableName, sourceUriPrefix, sourceUri);
40+
createTableExternalHivePartitioned(datasetName, tableName, sourceUriPrefix, sourceUri);
4041
}
4142

42-
public static void setHivePartitioningOptions(
43+
public static void createTableExternalHivePartitioned(
4344
String datasetName, String tableName, String sourceUriPrefix, String sourceUri) {
4445
try {
4546
// Initialize client that will be used to send requests. This client only needs to be created
@@ -68,3 +69,4 @@ public static void setHivePartitioningOptions(
6869
}
6970
}
7071
// [END bigquery_set_hivepartitioningoptions]
72+
// [END bigquery_create_table_external_hivepartitioned]

‎samples/snippets/src/test/java/com/example/bigquery/SetHivePartitioningOptionsIT.java ‎samples/snippets/src/test/java/com/example/bigquery/CreateTableExternalHivePartitionedIT.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import org.junit.BeforeClass;
3030
import org.junit.Test;
3131

32-
public class SetHivePartitioningOptionsIT {
32+
public class CreateTableExternalHivePartitionedIT {
3333

3434
private static final String ID = UUID.randomUUID().toString().substring(0, 8);
3535
private final Logger log = Logger.getLogger(this.getClass().getName());
@@ -74,11 +74,11 @@ public void tearDown() {
7474
}
7575

7676
@Test
77-
public void testSetHivePartitioningOptions() {
77+
public void testCreateTableExternalHivePartitioned() {
7878
String sourceUri = "gs://cloud-samples-data/bigquery/hive-partitioning-samples/customlayout/*";
7979
String sourceUriPrefix =
8080
"gs://cloud-samples-data/bigquery/hive-partitioning-samples/customlayout/{pkey:STRING}/";
81-
SetHivePartitioningOptions.setHivePartitioningOptions(
81+
CreateTableExternalHivePartitioned.createTableExternalHivePartitioned(
8282
BIGQUERY_DATASET_NAME, tableName, sourceUriPrefix, sourceUri);
8383
assertThat(bout.toString()).contains("External table created using hivepartitioningoptions");
8484
}

0 commit comments

Comments
 (0)
Failed to load comments.