CTTY commented on code in PR #5943:
URL: https://github.com/apache/hudi/pull/5943#discussion_r927037922


##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/DeleteHoodieTableCommand.scala:
##########
@@ -36,9 +37,13 @@ case class DeleteHoodieTableCommand(deleteTable: 
DeleteFromTable) extends Hoodie
 
     // Remove meta fields from the data frame
     var df = removeMetaFields(Dataset.ofRows(sparkSession, table))
-    if (deleteTable.condition.isDefined) {
-      df = df.filter(Column(deleteTable.condition.get))
+    // SPARK-38626 DeleteFromTable.condition is changed from 
Option[Expression] to Expression in Spark 3.3
+    val condition: Expression = deleteTable.condition match {

Review Comment:
   Several things I've tried:
   - exctract `Expression` from `condition`
   - Embed `condition` to `Option[Expression]`
   Both approches above would make `DeleteHoodieTableCommand` cleaner but have 
the same problem: we have to provide condition back to `DeleteFromTable` around 
L417 in `HoodieAnalysis`, which means we have to wrap/unwrap it once more for 
different spark versions. 
   
   If we want to also make `DeleteHoodieTableCommand` cleaner, I think the only 
way might be adding two different methods in `SparkAdapter`: one to 
`resolveDeleteFromTable`, another to `extractCondition`



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

Reply via email to