huaxingao commented on code in PR #37746:
URL: https://github.com/apache/spark/pull/37746#discussion_r961798665
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -520,6 +520,11 @@
"NATURAL CROSS JOIN."
]
},
+ "TABLE_OPERATION" : {
+ "message" : [
+ "Table '<catalog>'.'<nameSpace>'.'<tableName>' does not support
<operation>. Please check the current catalog and namespace to make sure the
qualified table name is expected, and also check the catalog implementation
which is configured by \"spark.sql.catalog.spark_catalog\"."
Review Comment:
Updated. Thanks!
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -541,8 +541,15 @@ private[sql] object QueryCompilationErrors extends
QueryErrorsBase {
new AnalysisException("ADD COLUMN with v1 tables cannot specify NOT NULL.")
}
- def operationOnlySupportedWithV2TableError(operation: String): Throwable = {
- new AnalysisException(s"$operation is only supported with v2 tables.")
+ def operationOnlySupportedWithV2TableError(
+ catalog: String,
+ nameSpace: String,
+ tableName: String,
+ operation: String): Throwable = {
+ new AnalysisException(
+ errorClass = "UNSUPPORTED_FEATURE",
+ errorSubClass = "TABLE_OPERATION",
+ messageParameters = Array(catalog, nameSpace, tableName, operation))
Review Comment:
Fixed
##########
sql/core/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveSessionCatalog.scala:
##########
@@ -50,28 +50,44 @@ class ResolveSessionCatalog(val catalogManager:
CatalogManager)
override def apply(plan: LogicalPlan): LogicalPlan = plan.resolveOperatorsUp
{
case AddColumns(ResolvedV1TableIdentifier(ident), cols) =>
cols.foreach { c =>
- assertTopLevelColumn(c.name, "AlterTableAddColumnsCommand")
+ if (c.name.length > 1) {
+ throw QueryCompilationErrors.operationOnlySupportedWithV2TableError(
+ ident.catalog.getOrElse(""),
+ ident.database.getOrElse(""),
Review Comment:
Fixed. Thanks
--
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]