vinishjail97 opened a new issue, #965:
URL: https://github.com/apache/incubator-xtable/issues/965

   `BaseFileUpdatesExtractor#getHudiPartitionPath` (`xtable-core`, line 289 on 
`main`) calls Guava with format arguments:
   
   ```java
   Preconditions.checkArgument(
       partitionPath.endsWith(prefix),
       "File %s is not under its partition subdirectory %s",
       file.getPhysicalPath(),
       prefix);
   ```
   
   XTable compiles against Guava 32.1.3, so javac links this call to 
`checkArgument(boolean, String, Object, Object)`, an overload added in Guava 
20. Spark 3.4 and 3.5 ship Guava 14.0.1 in `jars/`, which has only 
`checkArgument(boolean, String, Object...)`. When `xtable-core` runs on Spark's 
classpath, the call throws `NoSuchMethodError` instead of checking the argument.
   
   Only files under a partition subdirectory (Paimon's `bucket-N` layout) reach 
this line, so Iceberg and Delta sources are not affected. #935 hit the same 
problem in `HudiBackedIcebergSecondaryIndex` on a Spark 3.4.2 cluster:
   
   ```
   java.lang.NoSuchMethodError: 'void 
com.google.common.base.Preconditions.checkArgument(boolean, java.lang.String, 
java.lang.Object)'
   ```
   
   Suggested fix: build the message first, as `DeltaConversionSource` already 
does, which links to `checkArgument(boolean, Object)` that Guava 14 has:
   
   ```java
   Preconditions.checkArgument(
       partitionPath.endsWith(prefix),
       String.format(
           "File %s is not under its partition subdirectory %s", 
file.getPhysicalPath(), prefix));
   ```
   
   The other `Preconditions` calls in `xtable-api` and `xtable-core` pass only 
a message and are safe. A build rule (for example `forbiddenapis`) that bans 
the fixed-argument overloads would keep new calls from adding this back.
   


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