rdblue commented on a change in pull request #26740: [SPARK-30053][SQL] Add the
ability for v2 datasource so specify a vacuum action on the table
URL: https://github.com/apache/spark/pull/26740#discussion_r355228688
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2Strategy.scala
##########
@@ -177,6 +177,15 @@ object DataSourceV2Strategy extends Strategy with
PredicateHelper {
throw new AnalysisException("DELETE is only supported with v2
tables.")
}
+ case VacuumTable(relation) =>
+ relation match {
+ case DataSourceV2ScanRelation(table, _, output) =>
+ VacuumTableExec(table.asVacuumable) :: Nil
+ case _ =>
+ throw new AnalysisException("VACUUM is only supported with v2
tables.")
Review comment:
This isn't the right place to throw an `AnalysisException` because this is
after analysis has finished.
This rule should match `VacuumTable(DataSourceV2ScanRelation(table, _, _))`
and produce the exec node. Then `CheckAnalysis` should have a rule that matches
`VacuumTable` with any other relation that throws the analysis exception.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]