YannByron commented on code in PR #6999:
URL: https://github.com/apache/hudi/pull/6999#discussion_r1002863123
##########
hudi-spark-datasource/hudi-spark2/src/main/scala/org/apache/spark/sql/HoodieSpark2CatalystPlanUtils.scala:
##########
@@ -74,4 +74,15 @@ object HoodieSpark2CatalystPlanUtils extends
HoodieCatalystPlansUtils {
override def getRelationTimeTravel(plan: LogicalPlan): Option[(LogicalPlan,
Option[Expression], Option[String])] = {
throw new IllegalStateException(s"Should not call getRelationTimeTravel
for spark2")
}
+
+ override def isRepairTable(plan: LogicalPlan): Boolean = {
+ plan.isInstanceOf[AlterTableRecoverPartitionsCommand]
+ }
+
+ override def getRepairTableChildren(plan: LogicalPlan):
Option[(TableIdentifier, Boolean, Boolean, String)] = {
+ plan match {
+ case c: AlterTableRecoverPartitionsCommand =>
+ Some((c.tableName, true, false, c.cmd))
Review Comment:
please explain why use `true` as the 2nd param default value, and `false` as
the 3rd one in Code.
##########
hudi-spark-datasource/hudi-spark3.1.x/src/main/scala/org/apache/spark/sql/HoodieSpark31CatalystPlanUtils.scala:
##########
@@ -31,4 +33,15 @@ object HoodieSpark31CatalystPlanUtils extends
HoodieSpark3CatalystPlanUtils {
}
override def projectOverSchema(schema: StructType, output: AttributeSet):
ProjectionOverSchema = ProjectionOverSchema(schema)
+
+ override def isRepairTable(plan: LogicalPlan): Boolean = {
+ plan.isInstanceOf[AlterTableRecoverPartitionsCommand]
+ }
+
+ override def getRepairTableChildren(plan: LogicalPlan):
Option[(TableIdentifier, Boolean, Boolean, String)] = {
+ plan match {
+ case c: AlterTableRecoverPartitionsCommand =>
+ Some((c.tableName, true, false, c.cmd))
Review Comment:
ditto
--
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]