myandpr opened a new pull request #3458:
URL: https://github.com/apache/iceberg/pull/3458


   ## What problem is solved by this MR?Why this MR is needed?
   It doesn`t work when I use 'date_sub(current_date(), 10)' in 
'spark_catalog.system.expire_snapshots'.
   
   because we use a parser extension, the procedures do not allow arbitrary 
expressions.
   
   I think that we'd better modify the document first to prevent users from 
encountering errors.
   
   environment: 
   |  Spark   | Iceberg |
   |  ----  | ----  |
   | 3.0  | 0.12|
   
   
   ```shell
   scala> spark.sql("CALL spark_catalog.system.expire_snapshots('db.table', 
date_sub(current_date(), 10), 5)")
   ```
   ```shell
   org.apache.spark.sql.catalyst.parser.extensions.IcebergParseException:
   no viable alternative at input 'date_sub('(line 1, pos 81)
   
   == SQL ==
   CALL spark_catalog.system.expire_snapshots('db.table', 
date_sub(current_date(), 10), 5)
   
---------------------------------------------------------------------------------^^^
   
     at 
org.apache.spark.sql.catalyst.parser.extensions.IcebergParseException.withCommand(IcebergSparkSqlExtensionsParser.scala:294)
     at 
org.apache.spark.sql.catalyst.parser.extensions.IcebergSparkSqlExtensionsParser.parse(IcebergSparkSqlExtensionsParser.scala:158)
     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)
     ... 47 elided
   ```
   
   ## How to solve this problem?
   I think that we'd better modify the document first to prevent users from 
encountering errors.
   
   ## Related issue
   https://github.com/apache/iceberg/issues/2341
   


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