-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-43969][SQL] Refactor & Assign names to the error class _LEGACY_ERROR_TEMP_1170 #41458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
20ec2e9
4eb7a36
fc8fd9d
863e60b
a8769ed
43dfc6c
4c71159
27592d4
f17e0ba
807e03a
409ac28
ec055d2
abd7e16
f7e49e3
8a05d31
ba88418
82b9f21
9632455
92fddbe
7568af5
c8cb9af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -877,10 +877,24 @@ | |
| }, | ||
| "INSERT_COLUMN_ARITY_MISMATCH" : { | ||
| "message" : [ | ||
| "Cannot write to '<tableName>', <reason>:", | ||
| "Table columns: <tableColumns>.", | ||
| "Data columns: <dataColumns>." | ||
| "Cannot write to '<tableName>'," | ||
| ], | ||
| "subClass" : { | ||
| "NOT_ENOUGH_DATA_COLUMNS" : { | ||
| "message" : [ | ||
| "not enough data columns: ", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. detail reason |
||
| "Table columns: <tableColumns>.", | ||
| "Data columns: <dataColumns>." | ||
| ] | ||
| }, | ||
| "TOO_MANY_DATA_COLUMNS" : { | ||
| "message" : [ | ||
| "too many data columns: ", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. detail reason |
||
| "Table columns: <tableColumns>.", | ||
| "Data columns: <dataColumns>." | ||
| ] | ||
| } | ||
| }, | ||
| "sqlState" : "21S01" | ||
| }, | ||
| "INSERT_PARTITION_COLUMN_ARITY_MISMATCH" : { | ||
|
|
@@ -1651,6 +1665,11 @@ | |
| ], | ||
| "sqlState" : "46110" | ||
| }, | ||
| "NOT_SUPPORTED_COMMAND_WITHOUT_HIVE_SUPPORT" : { | ||
| "message" : [ | ||
| "<cmd> is not supported, if you want to enable it, please set `spark.sql.catalogImplementation` to `hive`." | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, quote the SQL config and its value in the same way as |
||
| ] | ||
| }, | ||
| "NOT_SUPPORTED_IN_JDBC_CATALOG" : { | ||
| "message" : [ | ||
| "Not supported command in JDBC catalog:" | ||
|
|
@@ -2368,6 +2387,33 @@ | |
| "grouping()/grouping_id() can only be used with GroupingSets/Cube/Rollup." | ||
| ] | ||
| }, | ||
| "UNSUPPORTED_INSERT" : { | ||
| "message" : [ | ||
| "Can't insert into the target." | ||
| ], | ||
| "subClass" : { | ||
| "NOT_ALLOWED" : { | ||
| "message" : [ | ||
| "The target relation <relationId> does not allow insertion." | ||
| ] | ||
| }, | ||
| "NOT_PARTITIONED" : { | ||
| "message" : [ | ||
| "The target relation <relationId> is not partitioned." | ||
| ] | ||
| }, | ||
| "RDD_BASED" : { | ||
| "message" : [ | ||
| "An RDD-based table is not allowed." | ||
| ] | ||
| }, | ||
| "READ_FROM" : { | ||
| "message" : [ | ||
| "The target relation <relationId> is also being read from." | ||
| ] | ||
| } | ||
| } | ||
| }, | ||
| "UNSUPPORTED_OVERWRITE" : { | ||
| "message" : [ | ||
| "Can't overwrite the target that is also being read from." | ||
|
|
@@ -2929,11 +2975,6 @@ | |
| "Window function <wf> requires window to be ordered, please add ORDER BY clause. For example SELECT <wf>(value_expr) OVER (PARTITION BY window_partition ORDER BY window_ordering) from table." | ||
| ] | ||
| }, | ||
| "_LEGACY_ERROR_TEMP_1038" : { | ||
| "message" : [ | ||
| "Cannot write to table due to mismatched user specified column size(<columnSize>) and data column size(<outputSize>)." | ||
| ] | ||
| }, | ||
| "_LEGACY_ERROR_TEMP_1039" : { | ||
| "message" : [ | ||
| "Multiple time/session window expressions would result in a cartesian product of rows, therefore they are currently not supported." | ||
|
|
@@ -3430,11 +3471,6 @@ | |
| "Table partitions: <partColNames>." | ||
| ] | ||
| }, | ||
| "_LEGACY_ERROR_TEMP_1170" : { | ||
| "message" : [ | ||
| "Hive support is required to <detail>." | ||
| ] | ||
| }, | ||
| "_LEGACY_ERROR_TEMP_1171" : { | ||
| "message" : [ | ||
| "createTableColumnTypes option column <col> not found in schema <schema>." | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -613,16 +613,6 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase { | |
| messageParameters = Map("wf" -> wf.toString)) | ||
| } | ||
|
|
||
| def writeTableWithMismatchedColumnsError( | ||
| columnSize: Int, outputSize: Int, t: TreeNode[_]): Throwable = { | ||
| new AnalysisException( | ||
| errorClass = "_LEGACY_ERROR_TEMP_1038", | ||
| messageParameters = Map( | ||
| "columnSize" -> columnSize.toString, | ||
| "outputSize" -> outputSize.toString), | ||
| origin = t.origin) | ||
| } | ||
|
|
||
| def multiTimeWindowExpressionsNotSupportedError(t: TreeNode[_]): Throwable = { | ||
| new AnalysisException( | ||
| errorClass = "_LEGACY_ERROR_TEMP_1039", | ||
|
|
@@ -1743,10 +1733,10 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase { | |
| "partColNames" -> partColNames.map(_.name).mkString(","))) | ||
| } | ||
|
|
||
| def ddlWithoutHiveSupportEnabledError(detail: String): Throwable = { | ||
| def ddlWithoutHiveSupportEnabledError(cmd: String): Throwable = { | ||
| new AnalysisException( | ||
| errorClass = "_LEGACY_ERROR_TEMP_1170", | ||
| messageParameters = Map("detail" -> detail)) | ||
| errorClass = "NOT_SUPPORTED_COMMAND_WITHOUT_HIVE_SUPPORT", | ||
| messageParameters = Map("cmd" -> cmd)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it a SQL statement? If so, quote it by |
||
| } | ||
|
|
||
| def createTableColumnTypesOptionColumnNotFoundInSchemaError( | ||
|
|
@@ -2056,26 +2046,26 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase { | |
|
|
||
| def cannotWriteTooManyColumnsToTableError( | ||
| tableName: String, | ||
| expected: Seq[Attribute], | ||
| expected: Seq[String], | ||
| query: LogicalPlan): Throwable = { | ||
| new AnalysisException( | ||
| errorClass = "INSERT_COLUMN_ARITY_MISMATCH", | ||
| errorClass = "INSERT_COLUMN_ARITY_MISMATCH.TOO_MANY_DATA_COLUMNS", | ||
| messageParameters = Map( | ||
| "tableName" -> tableName, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use |
||
| "reason" -> "too many data columns", | ||
| "tableColumns" -> expected.map(c => s"'${c.name}'").mkString(", "), | ||
| "dataColumns" -> query.output.map(c => s"'${c.name}'").mkString(", "))) | ||
| "tableColumns" -> expected.map(c => toSQLId(c)).mkString(", "), | ||
| "dataColumns" -> query.output.map(c => toSQLId(c.name)).mkString(", "))) | ||
| } | ||
|
|
||
| def cannotWriteNotEnoughColumnsToTableError( | ||
| tableName: String, expected: Seq[Attribute], query: LogicalPlan): Throwable = { | ||
| tableName: String, | ||
| expected: Seq[String], | ||
| query: LogicalPlan): Throwable = { | ||
| new AnalysisException( | ||
| errorClass = "INSERT_COLUMN_ARITY_MISMATCH", | ||
| errorClass = "INSERT_COLUMN_ARITY_MISMATCH.NOT_ENOUGH_DATA_COLUMNS", | ||
| messageParameters = Map( | ||
| "tableName" -> tableName, | ||
| "reason" -> "not enough data columns", | ||
| "tableColumns" -> expected.map(c => s"'${c.name}'").mkString(", "), | ||
| "dataColumns" -> query.output.map(c => s"'${c.name}'").mkString(", "))) | ||
| "tableColumns" -> expected.map(c => toSQLId(c)).mkString(", "), | ||
| "dataColumns" -> query.output.map(c => toSQLId(c.name)).mkString(", "))) | ||
| } | ||
|
|
||
| def cannotWriteIncompatibleDataToTableError(tableName: String, errors: Seq[String]): Throwable = { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.