huaxingao opened a new pull request, #5204:
URL: https://github.com/apache/iceberg/pull/5204

   Currently iceberg throws Exception when using a filter on complex type:
   
   ```
   org.apache.iceberg.spark.sql.TestSelect > testComplexTypeFilter[catalogName 
= testhadoop, implementation = org.apache.iceberg.spark.SparkCatalog, config = 
{type=hadoop}] FAILED
       java.lang.IllegalArgumentException: Cannot create expression literal 
from org.apache.spark.sql.catalyst.expressions.GenericRowWithSchema: [3,v1]
           at org.apache.iceberg.expressions.Literals.from(Literals.java:87)
           at 
org.apache.iceberg.expressions.UnboundPredicate.<init>(UnboundPredicate.java:40)
           at 
org.apache.iceberg.expressions.Expressions.equal(Expressions.java:175)
           at 
org.apache.iceberg.spark.SparkFilters.handleEqual(SparkFilters.java:239)
           at 
org.apache.iceberg.spark.SparkFilters.convert(SparkFilters.java:152)
           at 
org.apache.iceberg.spark.source.SparkScanBuilder.pushFilters(SparkScanBuilder.java:101)
           at 
org.apache.spark.sql.execution.datasources.v2.PushDownUtils$.pushFilters(PushDownUtils.scala:69)
           at 
org.apache.spark.sql.execution.datasources.v2.V2ScanRelationPushDown$$anonfun$pushDownFilters$1.applyOrElse(V2ScanRelationPushDown.scala:60)
           at 
org.apache.spark.sql.execution.datasources.v2.V2ScanRelationPushDown$$anonfun$pushDownFilters$1.applyOrElse(V2ScanRelationPushDown.scala:47)
           at 
org.apache.spark.sql.catalyst.trees.TreeNode.$anonfun$transformDownWithPruning$1(TreeNode.scala:481)
           at 
org.apache.spark.sql.catalyst.trees.CurrentOrigin$.withOrigin(TreeNode.scala:82)
           at 
org.apache.spark.sql.catalyst.trees.TreeNode.transformDownWithPruning(TreeNode.scala:481)
           at 
org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.org$apache$spark$sql$catalyst$plans$logical$AnalysisHelper$$super$transformDownWithPruning(LogicalPlan.scala:30)
           at 
org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.transformDownWithPruning(AnalysisHelper.scala:267)
           at 
org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.transformDownWithPruning$(AnalysisHelper.scala:263)
           at 
org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.transformDownWithPruning(LogicalPlan.scala:30)
   
   ```
   
   This PR fixes the problem by not pushing down filters for complex type.


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