yihua commented on code in PR #11679:
URL: https://github.com/apache/hudi/pull/11679#discussion_r1702418569


##########
hudi-gcp/src/main/java/org/apache/hudi/gcp/bigquery/HoodieBigQuerySyncClient.java:
##########
@@ -328,6 +323,28 @@ public boolean 
tableNotExistsOrDoesNotMatchSpecification(String tableName) {
     return manifestDoesNotExist;
   }
 
+  private boolean isBasePathUpdated(ExternalTableDefinition 
externalTableDefinition) {
+    String basePath = StringUtils.stripEnd(getBasePath(), "/");
+    if (externalTableDefinition.getHivePartitioningOptions() == null) {
+      List<String> sourceUris = 
Option.ofNullable(externalTableDefinition.getSourceUris()).orElse(Collections.emptyList());
+      // compare source uris with trailing slash to make sure the unwanted 
prefix matches are avoided
+      String basePathWithTrailingSlash = String.format("%s/", basePath);
+      boolean isTableBasePathUpdated = sourceUris.stream()
+          .noneMatch(sourceUri -> 
sourceUri.startsWith(basePathWithTrailingSlash));

Review Comment:
   I assume that `sourceUris` contains the URIs with the same prefix so this 
works.  If `sourceUris` contains some URIs starting with 
`basePathWithTrailingSlash` and other URIs not starting with 
`basePathWithTrailingSlash`, `isTableBasePathUpdated` is still `false`.  I 
think this should not happen with BigQuery.



-- 
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]

Reply via email to