HeartSaVioR 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_r352924644
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala
##########
@@ -1829,3 +1858,21 @@ class FakeV2Provider extends TableProvider {
throw new UnsupportedOperationException("Unnecessary for DDL tests")
}
}
+
+class VacuumableTableProvider extends TableProvider {
+
+ override def getTable (options: CaseInsensitiveStringMap): Table =
+ new VacuumableTable
+ class VacuumableTable extends Table with SupportsVacuum {
+
+ override def name(): String = "vacuum"
+
+ override def schema(): StructType =
+ StructType(Seq(StructField("id", IntegerType)))
+
+ override def capabilities(): util.Set[TableCapability] =
+ Set(TableCapability.ACCEPT_ANY_SCHEMA).asJava
+
+ override def vacuum(): Unit = {println("VACUUM!!")}
Review comment:
1. Where is the usage of this class?
2. Don't use println unless there's clear reason to do so. Use logXXX
instead.
3. You may want to add flag here instead of modifying InMemoryTable. Please
revert the change of InMemoryTable as it doesn't need to be modified.
----------------------------------------------------------------
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]