Aggarwal-Raghav commented on code in PR #6985:
URL: https://github.com/apache/hive/pull/6985#discussion_r4781188399


##########
standalone-metastore/pom.xml:
##########
@@ -68,7 +68,7 @@
     <maven.versions.plugin.version>2.16.0</maven.versions.plugin.version>
     <maven.surefire.plugin.version>3.5.3</maven.surefire.plugin.version>
     <!-- Dependency versions -->
-    <antlr.version>4.9.3</antlr.version>
+    <antlr.version>4.13.1</antlr.version>

Review Comment:
   So, I did the testing with Spark4.2 and Hive 4.2.1 without the PR and with 
the PR (but keeping antlr-4.9.3). The Patch is working
   1. Ran Spark-4.2.0 (antlr-4.13.1) with Hive 4.2.1 wihtout PR and got the 
error — expected behaviour ✅. Here is error stacktrace
   ```
   - SPARK-45054: list partitions should restore stats
   12:07:39.040 WARN org.apache.hadoop.hive.metastore.utils.FileUtils: The path 
to delete does not exist: 
file:/Users/raghav/Desktop/opensource/spark/sql/hive/target/tmp/spark-02d0d762-af84-4f4c-96ed-a6e2174a9841/db1.db
   
   12:07:39.097 WARN org.apache.hadoop.hive.metastore.utils.FileUtils: The path 
to delete does not exist: 
file:/Users/raghav/Desktop/opensource/spark/sql/hive/target/tmp/spark-02d0d762-af84-4f4c-96ed-a6e2174a9841/db2.db
   
   12:07:39.102 WARN org.apache.hadoop.hive.metastore.utils.FileUtils: The path 
to delete does not exist: 
file:/Users/raghav/Desktop/opensource/spark/sql/hive/target/tmp/spark-02d0d762-af84-4f4c-96ed-a6e2174a9841/db3.db
   
   ANTLR Tool version 4.9.3 used for code generation does not match the current 
runtime version 4.13.1
   ANTLR Runtime version 4.9.3 used for parser compilation does not match the 
current runtime version 4.13.1
   *** RUN ABORTED ***
     An exception or error caused a run to abort.
     java.lang.ExceptionInInitializerError:
     at 
org.apache.hadoop.hive.metastore.parser.PartFilterParser.parseFilter(PartFilterParser.java:33)
     at 
org.apache.hadoop.hive.metastore.PartFilterExprUtil.parseFilterTree(PartFilterExprUtil.java:117)
     at 
org.apache.hadoop.hive.metastore.ObjectStore.getPartitionsByFilterInternal(ObjectStore.java:4449)
     at 
org.apache.hadoop.hive.metastore.ObjectStore.getPartitionsByFilter(ObjectStore.java:4147)
     at 
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
     at java.base/java.lang.reflect.Method.invoke(Method.java:580)
     at 
org.apache.hadoop.hive.metastore.RawStoreProxy.invoke(RawStoreProxy.java:97)
     at jdk.proxy2/jdk.proxy2.$Proxy40.getPartitionsByFilter(Unknown Source)
     at 
org.apache.hadoop.hive.metastore.HMSHandler.get_partitions_by_filter_internal(HMSHandler.java:7424)
     at 
org.apache.hadoop.hive.metastore.HMSHandler.get_partitions_by_filter_req(HMSHandler.java:7438)
     ...
     Cause: java.lang.UnsupportedOperationException: 
java.io.InvalidClassException: org.antlr.v4.runtime.atn.ATN; Could not 
deserialize ATN with version 3 (expected 4).
     at 
org.antlr.v4.runtime.atn.ATNDeserializer.deserialize(ATNDeserializer.java:56)
     at 
org.antlr.v4.runtime.atn.ATNDeserializer.deserialize(ATNDeserializer.java:48)
     at 
org.apache.hadoop.hive.metastore.parser.PartitionFilterLexer.<clinit>(PartitionFilterLexer.java:206)
     at 
org.apache.hadoop.hive.metastore.parser.PartFilterParser.parseFilter(PartFilterParser.java:33)
     at 
org.apache.hadoop.hive.metastore.PartFilterExprUtil.parseFilterTree(PartFilterExprUtil.java:117)
     at 
org.apache.hadoop.hive.metastore.ObjectStore.getPartitionsByFilterInternal(ObjectStore.java:4449)
     at 
org.apache.hadoop.hive.metastore.ObjectStore.getPartitionsByFilter(ObjectStore.java:4147)
     at 
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
     at java.base/java.lang.reflect.Method.invoke(Method.java:580)
     at 
org.apache.hadoop.hive.metastore.RawStoreProxy.invoke(RawStoreProxy.java:97)
     ...
     Cause: java.io.InvalidClassException: org.antlr.v4.runtime.atn.ATN; Could 
not deserialize ATN with version 3 (expected 4).
     at 
org.antlr.v4.runtime.atn.ATNDeserializer.deserialize(ATNDeserializer.java:56)
     at 
org.antlr.v4.runtime.atn.ATNDeserializer.deserialize(ATNDeserializer.java:48)
     at 
org.apache.hadoop.hive.metastore.parser.PartitionFilterLexer.<clinit>(PartitionFilterLexer.java:206)
     at 
org.apache.hadoop.hive.metastore.parser.PartFilterParser.parseFilter(PartFilterParser.java:33)
     at 
org.apache.hadoop.hive.metastore.PartFilterExprUtil.parseFilterTree(PartFilterExprUtil.java:117)
     at 
org.apache.hadoop.hive.metastore.ObjectStore.getPartitionsByFilterInternal(ObjectStore.java:4449)
     at 
org.apache.hadoop.hive.metastore.ObjectStore.getPartitionsByFilter(ObjectStore.java:4147)
     at 
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
     at java.base/java.lang.reflect.Method.invoke(Method.java:580)
     at 
org.apache.hadoop.hive.metastore.RawStoreProxy.invoke(RawStoreProxy.java:97)
     ...
   [INFO] 
------------------------------------------------------------------------
   [ERROR] BUILD FAILURE
   [INFO] 
------------------------------------------------------------------------
   [INFO] Total time:  21.474 s
   [INFO] Finished at: 2026-12-03T12:07:39+05:30
   [INFO] 
------------------------------------------------------------------------
   
   ```
   2. Created a new hive version `4.2.1.3.5.0-HIVE-30279` with this PR but with 
antrl4.9 instead of 4.13.1
   3. Gave this new hive version in spark-4.2.0 pom and ran the UT again and it 
passed ✅
   ```
   12:13:27.659 WARN org.apache.spark.sql.hive.client.HiveClientImpl: Deadline 
exceeded
   - SPARK-50137: Avoid fallback to Hive-incompatible ways on thrift exception
   12:13:27.696 WARN org.apache.spark.sql.hive.HiveExternalCatalogSuite: 
   ===== POSSIBLE THREAD LEAK IN SUITE o.a.s.sql.hive.HiveExternalCatalogSuite, 
threads: HMSHandler #8 (daemon=true), HMSHandler #2 (daemon=true), HMSHandler 
#9 (daemon=true), HMSHandler #12 (daemon=true), HMSHandler #7 (daemon=true), 
HMSHandler #0 (daemon=true), HMSHandler #4 (daemon=true), HMSHandler 
[<cropped>], HMSHandler #10 (daemon=true), HMSHandler #14 (daemon=true), 
HMSHandler #6...
   Run completed in 38 seconds, 889 milliseconds.
   Total number of tests run: 83
   Suites: completed 2, aborted 0
   Tests: succeeded 83, failed 0, canceled 0, ignored 0, pending 0
   All tests passed.
   [INFO] 
------------------------------------------------------------------------
   [INFO] BUILD SUCCESS
   [INFO] 
------------------------------------------------------------------------
   [INFO] Total time:  40.986 s
   [INFO] Finished at: 2026-12-03T12:13:28+05:30
   [INFO] 
------------------------------------------------------------------------
   
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to