This is an automated email from the ASF dual-hosted git repository.
vinishjail97 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-xtable.git
The following commit(s) were added to refs/heads/main by this push:
new 15a13da3 [965] fix: Guava compatibility in Hudi partition path
validation (#967)
15a13da3 is described below
commit 15a13da321e683ea8247d3aa7cbfcd15f2edf96c
Author: Harini <[email protected]>
AuthorDate: Tue Oct 13 01:55:35 2026 +0530
[965] fix: Guava compatibility in Hudi partition path validation (#967)
* Fix Guava compatibility in Hudi partition path validation
* fix: preserve lazy error message construction
---
.../org/apache/xtable/hudi/BaseFileUpdatesExtractor.java | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git
a/xtable-core/src/main/java/org/apache/xtable/hudi/BaseFileUpdatesExtractor.java
b/xtable-core/src/main/java/org/apache/xtable/hudi/BaseFileUpdatesExtractor.java
index 2bd1134b..1404d476 100644
---
a/xtable-core/src/main/java/org/apache/xtable/hudi/BaseFileUpdatesExtractor.java
+++
b/xtable-core/src/main/java/org/apache/xtable/hudi/BaseFileUpdatesExtractor.java
@@ -62,8 +62,6 @@ import org.apache.hudi.stats.HoodieColumnRangeMetadata;
import org.apache.hudi.stats.ValueMetadata;
import org.apache.hudi.stats.XTableValueMetadata;
-import com.google.common.base.Preconditions;
-
import org.apache.xtable.collectors.CustomCollectors;
import org.apache.xtable.exception.ReadException;
import org.apache.xtable.model.schema.InternalType;
@@ -286,18 +284,18 @@ public class BaseFileUpdatesExtractor {
return file.getPartitionSubdirectory()
.map(
prefix -> {
- Preconditions.checkArgument(
- partitionPath.endsWith(prefix),
- "File %s is not under its partition subdirectory %s",
- file.getPhysicalPath(),
- prefix);
+ if (!partitionPath.endsWith(prefix)) {
+ throw new IllegalArgumentException(
+ String.format(
+ "File %s is not under its partition subdirectory %s",
+ file.getPhysicalPath(), prefix));
+ }
return prefix.equals(partitionPath)
? ""
: partitionPath.substring(0, partitionPath.length() -
prefix.length() - 1);
})
.orElse(partitionPath);
}
-
/**
* Checks if the file was created by Hudi. Assumes Hudi is creating files
with the default fileId
* length and format