You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/12/07 02:55:39 UTC
[GitHub] [spark] LuciferYang opened a new pull request, #38954: [SPARK-41417][CORE][SQL] Rename `_LEGACY_ERROR_TEMP_0019` to `CANNOT_PARSE_VALUE_TO_DATATYPE`
LuciferYang opened a new pull request, #38954:
URL: https://github.com/apache/spark/pull/38954
### What changes were proposed in this pull request?
This pr aims rename `_LEGACY_ERROR_TEMP_0019` to `CANNOT_PARSE_VALUE_TO_DATATYPE`
### Why are the changes needed?
Proper names of error classes to improve user experience with Spark SQL.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Pass GitHub Actions
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on a diff in pull request #38954: [SPARK-41417][CORE][SQL] Rename `_LEGACY_ERROR_TEMP_0019` to `CANNOT_PARSE_VALUE_TO_DATATYPE`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #38954:
URL: https://github.com/apache/spark/pull/38954#discussion_r1041724482
##########
sql/core/src/test/resources/sql-tests/results/literals.sql.out:
##########
@@ -353,10 +353,12 @@ pattern% no-pattern\% pattern\% pattern\\%
select '\'', '"', '\n', '\r', '\t', 'Z'
-- !query schema
struct<':string,":string,
-:string,
:string, :string,Z:string>
+:string,
+:string, :string,Z:string>
-- !query output
' "
-
Z
Review Comment:
fiixed
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on a diff in pull request #38954: [SPARK-41417][CORE][SQL] Rename `_LEGACY_ERROR_TEMP_0019` to `CANNOT_PARSE_VALUE_TO_DATATYPE`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #38954:
URL: https://github.com/apache/spark/pull/38954#discussion_r1044466090
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -80,6 +80,12 @@
],
"sqlState" : "42000"
},
+ "CANNOT_PARSE_VALUE_TO_DATATYPE" : {
+ "message" : [
+ "Cannot parse <value> to <valueType> type."
Review Comment:
If `valueType` is `X`, should we translate it into `HEX` or others manually?
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on a diff in pull request #38954: [SPARK-41417][CORE][SQL] Rename `_LEGACY_ERROR_TEMP_0019` to `CANNOT_PARSE_VALUE_TO_DATATYPE`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #38954:
URL: https://github.com/apache/spark/pull/38954#discussion_r1041710409
##########
sql/core/src/test/resources/sql-tests/results/literals.sql.out:
##########
@@ -353,10 +353,12 @@ pattern% no-pattern\% pattern\% pattern\\%
select '\'', '"', '\n', '\r', '\t', 'Z'
-- !query schema
struct<':string,":string,
-:string,
:string, :string,Z:string>
+:string,
+:string, :string,Z:string>
-- !query output
' "
-
Z
Review Comment:
<img width="680" alt="image" src="https://user-images.githubusercontent.com/1475305/206079056-50057b86-4660-413c-98c3-6cd19058ab70.png">
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] MaxGekk commented on a diff in pull request #38954: [SPARK-41417][CORE][SQL] Rename `_LEGACY_ERROR_TEMP_0019` to `CANNOT_PARSE_VALUE_TO_DATATYPE`
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on code in PR #38954:
URL: https://github.com/apache/spark/pull/38954#discussion_r1044416555
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryParsingErrors.scala:
##########
@@ -211,7 +211,7 @@ private[sql] object QueryParsingErrors extends QueryErrorsBase {
def cannotParseValueTypeError(
valueType: String, value: String, ctx: TypeConstructorContext): Throwable = {
new ParseException(
- errorClass = "_LEGACY_ERROR_TEMP_0019",
+ errorClass = "CANNOT_PARSE_VALUE_TO_DATATYPE",
messageParameters = Map("valueType" -> valueType, "value" -> value),
Review Comment:
Please, quote `value` as a string using `toSQLValue()`, and `valueType` by default (can use `toSQLType()`).
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -80,6 +80,12 @@
],
"sqlState" : "42000"
},
+ "CANNOT_PARSE_VALUE_TO_DATATYPE" : {
Review Comment:
Let's make it shorter: `INVALID_TYPED_LITERAL` taking into account that there is `UNSUPPORTED_TYPED_LITERAL` already.
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -80,6 +80,12 @@
],
"sqlState" : "42000"
},
+ "CANNOT_PARSE_VALUE_TO_DATATYPE" : {
+ "message" : [
+ "Cannot parse <value> to <valueType> type."
Review Comment:
`The value of the typed literal <valueType> is invalid: <value>.`
If `valueType` is `X`, the message might confuse since there is no type `X`.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on a diff in pull request #38954: [SPARK-41417][CORE][SQL] Rename `_LEGACY_ERROR_TEMP_0019` to `CANNOT_PARSE_VALUE_TO_DATATYPE`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #38954:
URL: https://github.com/apache/spark/pull/38954#discussion_r1044446468
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -80,6 +80,12 @@
],
"sqlState" : "42000"
},
+ "CANNOT_PARSE_VALUE_TO_DATATYPE" : {
+ "message" : [
+ "Cannot parse <value> to <valueType> type."
Review Comment:
The `valueType` should not be `X` due to `X` will not enter this branch
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on a diff in pull request #38954: [SPARK-41417][CORE][SQL] Rename `_LEGACY_ERROR_TEMP_0019` to `CANNOT_PARSE_VALUE_TO_DATATYPE`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #38954:
URL: https://github.com/apache/spark/pull/38954#discussion_r1041710409
##########
sql/core/src/test/resources/sql-tests/results/literals.sql.out:
##########
@@ -353,10 +353,12 @@ pattern% no-pattern\% pattern\% pattern\\%
select '\'', '"', '\n', '\r', '\t', 'Z'
-- !query schema
struct<':string,":string,
-:string,
:string, :string,Z:string>
+:string,
+:string, :string,Z:string>
-- !query output
' "
-
Z
Review Comment:
<img width="1109" alt="image" src="https://user-images.githubusercontent.com/1475305/206079109-69059f36-f763-47f8-9747-bc5d73e125be.png">
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on a diff in pull request #38954: [SPARK-41417][CORE][SQL] Rename `_LEGACY_ERROR_TEMP_0019` to `CANNOT_PARSE_VALUE_TO_DATATYPE`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #38954:
URL: https://github.com/apache/spark/pull/38954#discussion_r1044441176
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryParsingErrors.scala:
##########
@@ -211,7 +211,7 @@ private[sql] object QueryParsingErrors extends QueryErrorsBase {
def cannotParseValueTypeError(
valueType: String, value: String, ctx: TypeConstructorContext): Throwable = {
new ParseException(
- errorClass = "_LEGACY_ERROR_TEMP_0019",
+ errorClass = "CANNOT_PARSE_VALUE_TO_DATATYPE",
messageParameters = Map("valueType" -> valueType, "value" -> value),
Review Comment:
hmm... `toSQLValue()` need a `DataType` input to create `Literal.create(v, t)`, maybe there be an exception here when use `toSQLValue()` ?
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on a diff in pull request #38954: [SPARK-41417][CORE][SQL] Rename `_LEGACY_ERROR_TEMP_0019` to `INVALID_TYPED_LITERAL`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #38954:
URL: https://github.com/apache/spark/pull/38954#discussion_r1044490580
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryParsingErrors.scala:
##########
@@ -211,7 +211,7 @@ private[sql] object QueryParsingErrors extends QueryErrorsBase {
def cannotParseValueTypeError(
valueType: String, value: String, ctx: TypeConstructorContext): Throwable = {
new ParseException(
- errorClass = "_LEGACY_ERROR_TEMP_0019",
+ errorClass = "CANNOT_PARSE_VALUE_TO_DATATYPE",
messageParameters = Map("valueType" -> valueType, "value" -> value),
Review Comment:
done
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -80,6 +80,12 @@
],
"sqlState" : "42000"
},
+ "CANNOT_PARSE_VALUE_TO_DATATYPE" : {
Review Comment:
done
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on pull request #38954: [SPARK-41417][CORE][SQL] Rename `_LEGACY_ERROR_TEMP_0019` to `INVALID_TYPED_LITERAL`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on PR #38954:
URL: https://github.com/apache/spark/pull/38954#issuecomment-1345189801
Thanks @MaxGekk
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on a diff in pull request #38954: [SPARK-41417][CORE][SQL] Rename `_LEGACY_ERROR_TEMP_0019` to `CANNOT_PARSE_VALUE_TO_DATATYPE`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #38954:
URL: https://github.com/apache/spark/pull/38954#discussion_r1041710409
##########
sql/core/src/test/resources/sql-tests/results/literals.sql.out:
##########
@@ -353,10 +353,12 @@ pattern% no-pattern\% pattern\% pattern\\%
select '\'', '"', '\n', '\r', '\t', 'Z'
-- !query schema
struct<':string,":string,
-:string,
:string, :string,Z:string>
+:string,
+:string, :string,Z:string>
-- !query output
' "
-
Z
Review Comment:
<img width="1213" alt="image" src="https://user-images.githubusercontent.com/1475305/206079321-408fc9a9-9ead-4e0c-8731-cd877b4bff27.png">
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on pull request #38954: [SPARK-41417][CORE][SQL] Rename `_LEGACY_ERROR_TEMP_0019` to `CANNOT_PARSE_VALUE_TO_DATATYPE`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on PR #38954:
URL: https://github.com/apache/spark/pull/38954#issuecomment-1343860910
friendly ping @MaxGekk
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] MaxGekk commented on pull request #38954: [SPARK-41417][CORE][SQL] Rename `_LEGACY_ERROR_TEMP_0019` to `INVALID_TYPED_LITERAL`
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on PR #38954:
URL: https://github.com/apache/spark/pull/38954#issuecomment-1345157464
+1, LGTM. Merging to master.
Thank you, @LuciferYang.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] MaxGekk closed pull request #38954: [SPARK-41417][CORE][SQL] Rename `_LEGACY_ERROR_TEMP_0019` to `INVALID_TYPED_LITERAL`
Posted by GitBox <gi...@apache.org>.
MaxGekk closed pull request #38954: [SPARK-41417][CORE][SQL] Rename `_LEGACY_ERROR_TEMP_0019` to `INVALID_TYPED_LITERAL`
URL: https://github.com/apache/spark/pull/38954
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on a diff in pull request #38954: [SPARK-41417][CORE][SQL] Rename `_LEGACY_ERROR_TEMP_0019` to `CANNOT_PARSE_VALUE_TO_DATATYPE`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #38954:
URL: https://github.com/apache/spark/pull/38954#discussion_r1041709594
##########
sql/core/src/test/resources/sql-tests/results/literals.sql.out:
##########
@@ -353,10 +353,12 @@ pattern% no-pattern\% pattern\% pattern\\%
select '\'', '"', '\n', '\r', '\t', 'Z'
-- !query schema
struct<':string,":string,
-:string,
:string, :string,Z:string>
+:string,
+:string, :string,Z:string>
-- !query output
' "
-
Z
Review Comment:
https://github.com/apache/spark/blob/ec8952747d38c9510a040b1f95d636444359088f/sql/core/src/test/resources/sql-tests/results/literals.sql.out#L352-L359
@MaxGekk Do you know why there is a diff here? I execute git diff locally without this part
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on a diff in pull request #38954: [SPARK-41417][CORE][SQL] Rename `_LEGACY_ERROR_TEMP_0019` to `CANNOT_PARSE_VALUE_TO_DATATYPE`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #38954:
URL: https://github.com/apache/spark/pull/38954#discussion_r1044446468
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -80,6 +80,12 @@
],
"sqlState" : "42000"
},
+ "CANNOT_PARSE_VALUE_TO_DATATYPE" : {
+ "message" : [
+ "Cannot parse <value> to <valueType> type."
Review Comment:
The valueType should not be X due to X will not enter this branch
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on a diff in pull request #38954: [SPARK-41417][CORE][SQL] Rename `_LEGACY_ERROR_TEMP_0019` to `CANNOT_PARSE_VALUE_TO_DATATYPE`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #38954:
URL: https://github.com/apache/spark/pull/38954#discussion_r1044441176
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryParsingErrors.scala:
##########
@@ -211,7 +211,7 @@ private[sql] object QueryParsingErrors extends QueryErrorsBase {
def cannotParseValueTypeError(
valueType: String, value: String, ctx: TypeConstructorContext): Throwable = {
new ParseException(
- errorClass = "_LEGACY_ERROR_TEMP_0019",
+ errorClass = "CANNOT_PARSE_VALUE_TO_DATATYPE",
messageParameters = Map("valueType" -> valueType, "value" -> value),
Review Comment:
EDIT: ~hmm... `toSQLValue()` need a `DataType` input to create `Literal.create(v, t)`, maybe there be an exception here when use `toSQLValue()` ?~
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on a diff in pull request #38954: [SPARK-41417][CORE][SQL] Rename `_LEGACY_ERROR_TEMP_0019` to `CANNOT_PARSE_VALUE_TO_DATATYPE`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #38954:
URL: https://github.com/apache/spark/pull/38954#discussion_r1044462088
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryParsingErrors.scala:
##########
@@ -211,7 +211,7 @@ private[sql] object QueryParsingErrors extends QueryErrorsBase {
def cannotParseValueTypeError(
valueType: String, value: String, ctx: TypeConstructorContext): Throwable = {
new ParseException(
- errorClass = "_LEGACY_ERROR_TEMP_0019",
+ errorClass = "CANNOT_PARSE_VALUE_TO_DATATYPE",
messageParameters = Map("valueType" -> valueType, "value" -> value),
Review Comment:
Ignore above comments. It is OK to quote value as a string using toSQLValue()
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org