viirya commented on a change in pull request #34857:
URL: https://github.com/apache/spark/pull/34857#discussion_r767110756
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveSessionCatalog.scala
##########
@@ -189,21 +180,21 @@ class ResolveSessionCatalog(val catalogManager:
CatalogManager)
// For REPLACE TABLE [AS SELECT], we should fail if the catalog is
resolved to the
// session catalog and the table provider is not v2.
case c @ ReplaceTable(
- ResolvedDBObjectName(catalog, name), _, _, _, _) =>
+ ResolvedDBObjectName(catalog, _), _, _, _, _) =>
val provider = c.tableSpec.provider.getOrElse(conf.defaultDataSourceName)
if (isSessionCatalog(catalog) && !isV2Provider(provider)) {
- throw QueryCompilationErrors.replaceTableOnlySupportedWithV2TableError
+ throw
QueryCompilationErrors.operationOnlySupportedWithV2TableError("REPLACE TABLE")
} else {
val newTableSpec = c.tableSpec.copy(bucketSpec = None)
c.copy(partitioning = c.partitioning ++
c.tableSpec.bucketSpec.map(_.asTransform),
tableSpec = newTableSpec)
}
- case c @ ReplaceTableAsSelect(ResolvedDBObjectName(catalog, _), _, _, _,
_, _)
- if isSessionCatalog(catalog) =>
+ case c @ ReplaceTableAsSelect(ResolvedDBObjectName(catalog, _), _, _, _,
_, _) =>
Review comment:
So seems we don't have test for this case? Otherwise previously wrongly
placed `isSessionCatalog(catalog)` should be detected?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]