'Why can i not use greater than '>=' in Partition Parentheses in Spark SQL
It was ok to use >= operator in Cloudera Hive sql, After migration to Databricks I am not able to use this operator in Partition Parentheses
ALTER TABLE tmprry.tmp_table DROP IF EXISTS PARTITION (log_date >= $LOG_DATE_EXECUTE_TWO_DAYS_AGO AND log_date <= $LOGDATE ) PURGE;
On the notebook it gives me error:
com.databricks.backend.common.rpc.DatabricksExceptions$SQLExecutionException: org.apache.spark.sql.catalyst.parser.ParseException: mismatched input '>=' expecting {')', ','}(line 2, pos 20)
== SQL == ALTER TABLE tmprry.tmp_table DROP IF EXISTS PARTITION (log_date >= 20220130 ) PURGE ---------------------------------------------------------------------------------------------------------^^^
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
