wombatu-kun commented on code in PR #19248:
URL: https://github.com/apache/hudi/pull/19248#discussion_r3566194160
##########
hudi-sync/hudi-sync-common/src/main/java/org/apache/hudi/sync/common/HoodieSyncConfig.java:
##########
@@ -211,6 +212,16 @@ public HoodieSyncConfig(Properties props, Configuration
hadoopConf) {
.collect(Collectors.joining("\n")));
setDefaults(HoodieSyncConfig.class.getName());
this.hadoopConf = hadoopConf;
+ // Normalize the table base path so that downstream metastore LOCATION
values never carry
+ // consecutive or trailing slashes. Strict object-store filesystems (e.g.
GCS) reject "//",
+ // and this keeps the synced location consistent with the Hudi table base
path (which is
+ // itself normalized through org.apache.hadoop.fs.Path on the write path).
+ if (contains(META_SYNC_BASE_PATH)) {
Review Comment:
The guard is not merely redundant, it is statically always true:
`setDefaults(HoodieSyncConfig.class.getName())` runs two lines earlier and
`META_SYNC_BASE_PATH` declares `.defaultValue("")`, so
`HoodieConfig#setDefaultValue` writes the key unconditionally. `contains()` can
never be false at that point, and `getString()` can never return null there
either - the empty-string default is the only thing the check actually has to
catch:
String basePath = getString(META_SYNC_BASE_PATH);
if (!StringUtils.isNullOrEmpty(basePath)) {
setValue(META_SYNC_BASE_PATH, new Path(basePath).toString());
}
--
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]