rdblue commented on a change in pull request #26174: [SPARK-29517][SQL]
TRUNCATE TABLE should look up catalog/table like v2 commands
URL: https://github.com/apache/spark/pull/26174#discussion_r337231188
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveSessionCatalog.scala
##########
@@ -282,6 +282,12 @@ class ResolveSessionCatalog(
AlterTableRecoverPartitionsCommand(
v1TableName.asTableIdentifier,
"MSCK REPAIR TABLE")
+
+ case TruncateTableStatement(tableName, partitionSpec) =>
Review comment:
No. This is not a catalog operation, it is a table operation. We already
have 2 ways to truncate a table: if the table implements `SupportsTruncate` or
`SupportsOverwrite`. A truncate command should build a write and commit without
any commit messages.
We can also add a short-cut trait on `Table` to avoid the builder.
----------------------------------------------------------------
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]