CTTY commented on code in PR #5943:
URL: https://github.com/apache/hudi/pull/5943#discussion_r930464958
##########
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 {
+ case option: Option[Expression] => option.getOrElse(null)
+ case expr: Expression => expr
+ case _ => throw new IllegalArgumentException(s"DeleteFromTable.condition
has to be either Option[Expression] or Expression")
Review Comment:
Added a new method `extractCondition` in `SparkAdapter` to clean this part
--
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]