danny0405 commented on code in PR #8898:
URL: https://github.com/apache/hudi/pull/8898#discussion_r1236227987
##########
hudi-gcp/src/main/java/org/apache/hudi/gcp/bigquery/HoodieBigQuerySyncClient.java:
##########
@@ -78,6 +84,44 @@ private void createBigQueryConnection() {
}
}
+ public void createTableUsingBqManifestFile(String tableName, String
bqManifestFileUri, String sourceUriPrefix) {
+ try {
+ String withClauses = "";
+ String extraOptions = "";
+ if (!StringUtils.isNullOrEmpty(sourceUriPrefix)) {
+ withClauses = "WITH PARTITION COLUMNS";
+ extraOptions = String.format("hive_partition_uri_prefix=\"%s\",",
sourceUriPrefix);
+ }
+ String query =
+ String.format(
Review Comment:
Do we have a test case for the creation of the manifest file?
##########
hudi-gcp/src/main/java/org/apache/hudi/gcp/bigquery/BigQuerySyncTool.java:
##########
@@ -96,21 +105,39 @@ private void syncCoWTable(HoodieBigQuerySyncClient
bqSyncClient) {
.setUseFileListingFromMetadata(config.getBoolean(BIGQUERY_SYNC_USE_FILE_LISTING_FROM_METADATA))
.setAssumeDatePartitioning(config.getBoolean(BIGQUERY_SYNC_ASSUME_DATE_PARTITIONING))
.build();
+
+ if (config.getBoolean(BIGQUERY_SYNC_USE_BQ_MANIFEST_FILE)) {
+ manifestFileWriter.writeManifestFile(true);
+
+ if (!tableExists(bqSyncClient, tableName)) {
+ bqSyncClient.createTableUsingBqManifestFile(
+ tableName,
+ manifestFileWriter.getManifestSourceUri(true),
+ config.getString(BIGQUERY_SYNC_SOURCE_URI_PREFIX));
+ LOG.info("Table creation using the manifest file complete for " +
tableName);
+ }
Review Comment:
`Table creation using the manifest file complete for " + tableName`
-> `Completed table {} creation using the manifest file`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]