pan3793 opened a new issue #2382:
URL: https://github.com/apache/iceberg/issues/2382


   #2331 relocated the antlr4 classes in spark3 runtime module jar, but it 
cause several issues.
   
   For example,
   ```
   spark.sql("ALTER TABLE t2 WRITE ORDERED BY birthday ASC, height DESC NULL 
FIRST, weight ASC NULL LAST")
   ```
   will cause
   ```
   Exception in thread "main" java.lang.NoSuchMethodError: 
org.apache.spark.sql.catalyst.parser.UpperCaseCharStream.<init>(Lorg/apache/iceberg/shaded/org/antlr/v4/runtime/CodePointCharStream;)V
        at 
org.apache.spark.sql.catalyst.parser.extensions.IcebergSparkSqlExtensionsParser.parse(IcebergSparkSqlExtensionsParser.scala:124)
        at 
org.apache.spark.sql.catalyst.parser.extensions.IcebergSparkSqlExtensionsParser.parsePlan(IcebergSparkSqlExtensionsParser.scala:105)
        at 
org.apache.spark.sql.SparkSession.$anonfun$sql$2(SparkSession.scala:605)
        at 
org.apache.spark.sql.catalyst.QueryPlanningTracker.measurePhase(QueryPlanningTracker.scala:111)
        at 
org.apache.spark.sql.SparkSession.$anonfun$sql$1(SparkSession.scala:605)
        at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:764)
        at org.apache.spark.sql.SparkSession.sql(SparkSession.scala:602)
        at com.hiscat.iceberg.spark.QuickStart$.main(QuickStart.scala:70)
        at com.hiscat.iceberg.spark.QuickStart.main(QuickStart.scala)
   ```
   
   This because spark `UpperCaseCharStream` refer the original antlr4 
`CharStream`, but Iceberg invoke the with relocated one.
   
   And I think the root cause here is we just build a runtime jar with 
relocation, but has none test on it.
   
   Temporarily, I think we should revert #2331, because it broken the runtime 
jar. 
   But we do need relocated antrl4, because Spark 3.1 use a different version 
Antlr4 which will conflict with iceberg.
   cc @aokolnychyi 


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

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