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

   This is fixed the following:
   ```scala
   scala> spark.sql("call local.system.rewrite_data_files(table => 
'db.test_rewrite', where => 'local.system.days(ts) = 
date(string(2023-08-23))')").show()
   java.util.NoSuchElementException: None.get
     at scala.None$.get(Option.scala:529)
     at scala.None$.get(Option.scala:527)
     at 
org.apache.spark.sql.execution.datasources.SparkExpressionConverter$.convertToIcebergExpression(SparkExpressionConverter.scala:38)
     at 
org.apache.spark.sql.execution.datasources.SparkExpressionConverter.convertToIcebergExpression(SparkExpressionConverter.scala)
     at 
org.apache.iceberg.spark.procedures.RewriteDataFilesProcedure.checkAndApplyFilter(RewriteDataFilesProcedure.java:137)
     at 
org.apache.iceberg.spark.procedures.RewriteDataFilesProcedure.lambda$call$0(RewriteDataFilesProcedure.java:123)
     at 
org.apache.iceberg.spark.procedures.BaseProcedure.execute(BaseProcedure.java:107)
     at 
org.apache.iceberg.spark.procedures.BaseProcedure.modifyIcebergTable(BaseProcedure.java:88)
     at 
org.apache.iceberg.spark.procedures.RewriteDataFilesProcedure.call(RewriteDataFilesProcedure.java:103)
   ```
   
   After:
   ```scala
   scala> spark.sql("call local.system.rewrite_data_files(table => 
'db.test_rewrite', where => 'local.system.days(ts) = 
date(string(2023-08-23))')").show()
   java.lang.IllegalArgumentException: Cannot translate Spark expression to 
data source filter: (staticinvoke(class 
org.apache.iceberg.spark.functions.DaysFunction$TimestampToDaysFunction, 
DateType, invoke, ts#77, TimestampType, false, true, true) = 1992-01-01)
     at 
org.apache.spark.sql.execution.datasources.SparkExpressionConverter$.convertToIcebergExpression(SparkExpressionConverter.scala:44)
     at 
org.apache.spark.sql.execution.datasources.SparkExpressionConverter.convertToIcebergExpression(SparkExpressionConverter.scala)
     at 
org.apache.iceberg.spark.procedures.RewriteDataFilesProcedure.checkAndApplyFilter(RewriteDataFilesProcedure.java:137)
     at 
org.apache.iceberg.spark.procedures.RewriteDataFilesProcedure.lambda$call$0(RewriteDataFilesProcedure.java:123)
     at 
org.apache.iceberg.spark.procedures.BaseProcedure.execute(BaseProcedure.java:107)
     at 
org.apache.iceberg.spark.procedures.BaseProcedure.modifyIcebergTable(BaseProcedure.java:88)
     at 
org.apache.iceberg.spark.procedures.RewriteDataFilesProcedure.call(RewriteDataFilesProcedure.java:103)
   ```


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