Skip to content
Closed
Prev Previous commit
Next Next commit
update
  • Loading branch information
panbingkun committed Jun 25, 2024
commit 33fbc7c3e52249de38a7f6959f8ef283e7cd04fe
10 changes: 5 additions & 5 deletions common/utils/src/main/resources/error/error-conditions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4411,11 +4411,6 @@
"<functionName> with AES-<mode> does not support initialization vectors (IVs)."
]
},
"ALTER_NAMESPACE_PROPERTY" : {
"message" : [
"<property> is a reserved namespace property, <msg>."
]
},
"ANALYZE_UNCACHED_TEMP_VIEW" : {
"message" : [
"The ANALYZE TABLE FOR COLUMNS command can operate on temporary views that have been cached already. Consider to cache the view <viewName>."
Expand Down Expand Up @@ -4581,6 +4576,11 @@
"The replace function does not support nested column <colName>."
]
},
"SET_NAMESPACE_PROPERTY" : {
"message" : [
"<property> is a reserved namespace property, <msg>."
]
},
"SET_OPERATION_ON_MAP_TYPE" : {
"message" : [
"Cannot have MAP type columns in DataFrame which calls set operations (INTERSECT, EXCEPT, etc.), but the type of column <colName> is <dataType>."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ private[sql] object QueryParsingErrors extends DataTypeErrorsBase {
def cannotCleanReservedNamespacePropertyError(
property: String, ctx: ParserRuleContext, msg: String): Throwable = {
new ParseException(
errorClass = "UNSUPPORTED_FEATURE.ALTER_NAMESPACE_PROPERTY",
errorClass = "UNSUPPORTED_FEATURE.SET_NAMESPACE_PROPERTY",
messageParameters = Map("property" -> property, "msg" -> msg),
ctx)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ import org.apache.spark.sql.connector.catalog.NamespaceChange
import org.apache.spark.sql.errors.QueryCompilationErrors

/**
* A command that ALTER NAMESPACE UNSET PROPERTIES command.
* A command that unsets database/schema/namespace properties.
*
* The syntax of this command is:
* {{{
* ALTER (DATABASE|SCHEMA|NAMESPACE) ... UNSET (DBPROPERTIES|PROPERTIES) [IF EXISTS] ...;
* ALTER (DATABASE|SCHEMA|NAMESPACE) ...
* UNSET (DBPROPERTIES|PROPERTIES) [IF EXISTS] ('key1', 'key2', ...);
* }}}
*/
case class UnsetNamespacePropertiesCommand(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to define UnsetNamespacePropertiesCommand in module sql/core because it inherits UnaryRunnableCommand extends RunnableCommand and cannot be accessed in the module sql/catalyst (sql/core depends on sql/catalyst)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ class QueryParsingErrorsSuite extends QueryTest with SharedSparkSession with SQL
val sqlText = "CREATE NAMESPACE IF NOT EXISTS a.b.c WITH PROPERTIES ('location'='/home/user/db')"
checkError(
exception = parseException(sqlText),
errorClass = "UNSUPPORTED_FEATURE.ALTER_NAMESPACE_PROPERTY",
errorClass = "UNSUPPORTED_FEATURE.SET_NAMESPACE_PROPERTY",
sqlState = "0A000",
parameters = Map(
"property" -> "location",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ trait AlterNamespaceSetPropertiesSuiteBase extends QueryTest with DDLCommandTest
exception = intercept[ParseException] {
sql(sqlText)
},
errorClass = "UNSUPPORTED_FEATURE.ALTER_NAMESPACE_PROPERTY",
errorClass = "UNSUPPORTED_FEATURE.SET_NAMESPACE_PROPERTY",
parameters = Map("property" -> key, "msg" -> ".*"),
sqlState = None,
context = ExpectedContext(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ trait AlterNamespaceUnsetPropertiesSuiteBase extends QueryTest with DDLCommandTe
sql(s"ALTER NAMESPACE $ns UNSET PROPERTIES ('b')")
assert(getProperties(ns) === "((a,a), (c,c))")

// unset non-existent properties
checkError(
exception = intercept[AnalysisException] {
sql(s"ALTER NAMESPACE $ns UNSET PROPERTIES ('b')")
Expand All @@ -94,7 +95,7 @@ trait AlterNamespaceUnsetPropertiesSuiteBase extends QueryTest with DDLCommandTe
exception = intercept[ParseException] {
sql(sqlText)
},
errorClass = "UNSUPPORTED_FEATURE.ALTER_NAMESPACE_PROPERTY",
errorClass = "UNSUPPORTED_FEATURE.SET_NAMESPACE_PROPERTY",
parameters = Map("property" -> key, "msg" -> ".*"),
sqlState = None,
context = ExpectedContext(
Expand Down