You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "NarekDW (via GitHub)" <gi...@apache.org> on 2023/01/24 19:11:54 UTC
[GitHub] [spark] NarekDW opened a new pull request, #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1020
NarekDW opened a new pull request, #39723:
URL: https://github.com/apache/spark/pull/39723
### What changes were proposed in this pull request?
This PR proposes to assign name to _LEGACY_ERROR_TEMP_1185 -> "INVALID_IDENTIFIER_HAS_MORE_THAN_2_NAME_PARTS".
### Why are the changes needed?
We should assign proper name to LEGACY_ERROR_TEMP*
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
2 additional test cases were added
--
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] NarekDW commented on a diff in pull request #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "NarekDW (via GitHub)" <gi...@apache.org>.
NarekDW commented on code in PR #39723:
URL: https://github.com/apache/spark/pull/39723#discussion_r1096142932
##########
sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala:
##########
@@ -2673,4 +2673,23 @@ class JDBCV2Suite extends QueryTest with SharedSparkSession with ExplainSuiteHel
val indexes3 = jdbcTable.listIndexes()
assert(indexes3.isEmpty)
}
+
+ test("IDENTIFIER_TOO_MANY_NAME_PARTS: " +
Review Comment:
> Does the test improve the test coverage additionally to QueryCompilationErrorsSuite.scala?
Yep, this test case tests `IdentifierHelper.asFunctionIdentifier` function, but the test cases in the `QueryCompilationErrorsSuite ` test `MultipartIdentifierHelper.asTableIdentifier` function only.
--
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 #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on code in PR #39723:
URL: https://github.com/apache/spark/pull/39723#discussion_r1095926141
##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryCompilationErrorsSuite.scala:
##########
@@ -679,6 +680,40 @@ class QueryCompilationErrorsSuite
context = ExpectedContext("", "", 7, 13, "CAST(1)")
)
}
+
+ test("IDENTIFIER_TOO_MANY_NAME_PARTS: " +
+ "create temp view doesn't support identifiers consisting of more than 2 parts") {
+ checkError(
+ exception = intercept[ParseException] {
+ sql("CREATE TEMPORARY VIEW db_name.schema_name.view_name AS SELECT '1' as test_column")
Review Comment:
Will the view exist after the test? If so, could you wrap the fragment by `withTempView()`.
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/V2SessionCatalogSuite.scala:
##########
@@ -1119,4 +1119,32 @@ class V2SessionCatalogNamespaceSuite extends V2SessionCatalogBaseSuite {
}
catalog.dropNamespace(testNs, cascade = false)
}
+
+ test("IdentifierHelper should throw exception when identifier has more than 2 parts") {
Review Comment:
Don't this test and below duplicate the test in QueryCompilationErrorsSuite.scala?
##########
sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala:
##########
@@ -2673,4 +2673,23 @@ class JDBCV2Suite extends QueryTest with SharedSparkSession with ExplainSuiteHel
val indexes3 = jdbcTable.listIndexes()
assert(indexes3.isEmpty)
}
+
+ test("IDENTIFIER_TOO_MANY_NAME_PARTS: " +
Review Comment:
Does the test improve the test coverage additionally to QueryCompilationErrorsSuite.scala?
--
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] itholic commented on pull request #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "itholic (via GitHub)" <gi...@apache.org>.
itholic commented on PR #39723:
URL: https://github.com/apache/spark/pull/39723#issuecomment-1416996139
Great!
Congratulations and thanks for the contribution to Apache Spark, @NarekDW !! 👍
If you're interested in more error framework improvement, please check the sub-tasks for SPARK-37935 :-)
**NOTE**: Before start working on ticket, please leave a comment to avoid doing the same thing at the same time.
e.g.

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: 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] srielau commented on a diff in pull request #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "srielau (via GitHub)" <gi...@apache.org>.
srielau commented on code in PR #39723:
URL: https://github.com/apache/spark/pull/39723#discussion_r1090991365
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -581,6 +581,12 @@
],
"sqlState" : "42805"
},
+ "IDENTIFIER_TOO_MANY_NAME_PARTS" : {
+ "message" : [
+ "<quoted> is not a valid <identifier> as it has more than 2 name parts."
Review Comment:
This keeps confusing me. Is it only called for tables? Isn't schema.table.c1 a perfectly fine identifier (for a column)?
(and we haven't even talked about (nested) struct fields...)
--
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] srielau commented on a diff in pull request #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "srielau (via GitHub)" <gi...@apache.org>.
srielau commented on code in PR #39723:
URL: https://github.com/apache/spark/pull/39723#discussion_r1090991365
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -581,6 +581,12 @@
],
"sqlState" : "42805"
},
+ "IDENTIFIER_TOO_MANY_NAME_PARTS" : {
+ "message" : [
+ "<quoted> is not a valid <identifier> as it has more than 2 name parts."
Review Comment:
This "2" keeps confusing me. Is it only called for tables? Isn't schema.table.c1 a perfectly fine identifier (for a column)?
(and we haven't even talked about (nested) struct fields...)
--
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] NarekDW commented on a diff in pull request #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "NarekDW (via GitHub)" <gi...@apache.org>.
NarekDW commented on code in PR #39723:
URL: https://github.com/apache/spark/pull/39723#discussion_r1089682804
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -1867,7 +1867,7 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase {
def identifierHavingMoreThanTwoNamePartsError(
quoted: String, identifier: String): Throwable = {
new AnalysisException(
- errorClass = "_LEGACY_ERROR_TEMP_1185",
+ errorClass = "IDENTIFIER_TOO_MANY_NAME_PARTS",
messageParameters = Map(
"quoted" -> quoted,
Review Comment:
Done, please check
--
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] NarekDW commented on pull request #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "NarekDW (via GitHub)" <gi...@apache.org>.
NarekDW commented on PR #39723:
URL: https://github.com/apache/spark/pull/39723#issuecomment-1416746700
@MaxGekk Yep, I have it:
```
Username: narekdw
Full name: Narek Karapetian
```
--
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] NarekDW commented on a diff in pull request #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "NarekDW (via GitHub)" <gi...@apache.org>.
NarekDW commented on code in PR #39723:
URL: https://github.com/apache/spark/pull/39723#discussion_r1096217132
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -581,6 +581,12 @@
],
"sqlState" : "42805"
},
+ "IDENTIFIER_TOO_MANY_NAME_PARTS" : {
+ "message" : [
+ "<quoted> is not a valid <identifier> as it has more than 2 name parts."
Review Comment:
@srielau sorry for the late response, I missed this comment... Yep, `schema.table.c1` is a valid identifier for column name and for struct field name.
--
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] itholic commented on pull request #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "itholic (via GitHub)" <gi...@apache.org>.
itholic commented on PR #39723:
URL: https://github.com/apache/spark/pull/39723#issuecomment-1403401120
Also requesting review for @MaxGekk @srielau when you guys find some time 🙏
--
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] NarekDW commented on a diff in pull request #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "NarekDW (via GitHub)" <gi...@apache.org>.
NarekDW commented on code in PR #39723:
URL: https://github.com/apache/spark/pull/39723#discussion_r1089682752
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -581,6 +581,12 @@
],
"sqlState" : "42805"
},
+ "IDENTIFIER_TOO_MANY_NAME_PARTS" : {
+ "message" : [
+ "<quoted> is not a valid <identifier> as it has more than 2 name parts."
Review Comment:
Done
##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryCompilationErrorsSuite.scala:
##########
@@ -679,6 +680,44 @@ class QueryCompilationErrorsSuite
context = ExpectedContext("", "", 7, 13, "CAST(1)")
)
}
+
+ test("IDENTIFIER_TOO_MANY_NAME_PARTS: " +
+ "create temp view doesn't support identifiers consisting of more than 2 parts") {
+ checkError(
+ exception = intercept[ParseException] {
+ sql("CREATE TEMPORARY VIEW db_name.schema_name.view_name AS SELECT '1' as test_column")
+ },
+ errorClass = "IDENTIFIER_TOO_MANY_NAME_PARTS",
+ parameters = Map(
+ "quoted" -> "db_name.schema_name.view_name",
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] MaxGekk commented on pull request #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on PR #39723:
URL: https://github.com/apache/spark/pull/39723#issuecomment-1407299980
@NarekDW Could you update PR's description to match the actual error class name `IDENTIFIER_TOO_MANY_NAME_PARTS`, please.
--
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] srielau commented on a diff in pull request #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "srielau (via GitHub)" <gi...@apache.org>.
srielau commented on code in PR #39723:
URL: https://github.com/apache/spark/pull/39723#discussion_r1086993853
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -797,6 +797,11 @@
],
"sqlState" : "42602"
},
+ "INVALID_IDENTIFIER_HAS_MORE_THAN_2_NAME_PARTS" : {
+ "message" : [
+ "<quoted> is not a valid <identifier> as it has more than 2 name parts."
+ ]
Review Comment:
```suggestion
],
"sqlState" : "42601"
```
--
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] NarekDW commented on a diff in pull request #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "NarekDW (via GitHub)" <gi...@apache.org>.
NarekDW commented on code in PR #39723:
URL: https://github.com/apache/spark/pull/39723#discussion_r1096155322
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/V2SessionCatalogSuite.scala:
##########
@@ -1119,4 +1119,32 @@ class V2SessionCatalogNamespaceSuite extends V2SessionCatalogBaseSuite {
}
catalog.dropNamespace(testNs, cascade = false)
}
+
+ test("IdentifierHelper should throw exception when identifier has more than 2 parts") {
Review Comment:
`QueryCompilationErrorsSuite` - tests `MultipartIdentifierHelper.asTableIdentifier`,
`JDBCV2Suite` - tests `IdentifierHelper.asFunctionIdentifier`
You are right there are some overlapping...
I've removed testing of these 2 functions from this file, left testing only of `IdentifierHelper.asTableIdentifier` and `MultipartIdentifierHelper.asFunctionIdentifier` functions, which is not possible to reproduce from user side (sql)...
--
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] NarekDW commented on pull request #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "NarekDW (via GitHub)" <gi...@apache.org>.
NarekDW commented on PR #39723:
URL: https://github.com/apache/spark/pull/39723#issuecomment-1402458211
@itholic FYI
--
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 #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on code in PR #39723:
URL: https://github.com/apache/spark/pull/39723#discussion_r1089652125
##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryCompilationErrorsSuite.scala:
##########
@@ -679,6 +680,44 @@ class QueryCompilationErrorsSuite
context = ExpectedContext("", "", 7, 13, "CAST(1)")
)
}
+
+ test("IDENTIFIER_TOO_MANY_NAME_PARTS: " +
+ "create temp view doesn't support identifiers consisting of more than 2 parts") {
+ checkError(
+ exception = intercept[ParseException] {
+ sql("CREATE TEMPORARY VIEW db_name.schema_name.view_name AS SELECT '1' as test_column")
+ },
+ errorClass = "IDENTIFIER_TOO_MANY_NAME_PARTS",
+ parameters = Map(
+ "quoted" -> "db_name.schema_name.view_name",
Review Comment:
db_name.schema_name.view_name should be quoted by backticks.
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -581,6 +581,12 @@
],
"sqlState" : "42805"
},
+ "IDENTIFIER_TOO_MANY_NAME_PARTS" : {
+ "message" : [
+ "<quoted> is not a valid <identifier> as it has more than 2 name parts."
Review Comment:
Let's don't pass TableIdentifier or FunctionIdentifier, and just say:
```suggestion
"<quoted> is not a valid identifier as it has more than 2 name parts."
```
sine the camel-case ids might confuse users and are not so much useful.
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -1867,7 +1867,7 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase {
def identifierHavingMoreThanTwoNamePartsError(
quoted: String, identifier: String): Throwable = {
new AnalysisException(
- errorClass = "_LEGACY_ERROR_TEMP_1185",
+ errorClass = "IDENTIFIER_TOO_MANY_NAME_PARTS",
messageParameters = Map(
"quoted" -> quoted,
Review Comment:
Please, pass the original parts and use `toSQLId()` to always quote them by backticks.
--
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 #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on PR #39723:
URL: https://github.com/apache/spark/pull/39723#issuecomment-1416804248
@NarekDW Congratulations with the first contribution to Apache Spark!
--
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 #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on PR #39723:
URL: https://github.com/apache/spark/pull/39723#issuecomment-1416737583
+1, LGTM. Merging to master/3.4.
Thank you, @NarekDW and @itholic @srielau for review.
--
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] itholic commented on pull request #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "itholic (via GitHub)" <gi...@apache.org>.
itholic commented on PR #39723:
URL: https://github.com/apache/spark/pull/39723#issuecomment-1416997147
Also thanks @MaxGekk and @srielau for the review! 🙏
--
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] itholic commented on a diff in pull request #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "itholic (via GitHub)" <gi...@apache.org>.
itholic commented on code in PR #39723:
URL: https://github.com/apache/spark/pull/39723#discussion_r1089877427
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/V2SessionCatalogSuite.scala:
##########
@@ -1119,4 +1119,40 @@ class V2SessionCatalogNamespaceSuite extends V2SessionCatalogBaseSuite {
}
catalog.dropNamespace(testNs, cascade = false)
}
+
+ test("IdentifierHelper should throw exception when identifier has more than 2 parts") {
+ val testIdent: IdentifierHelper = Identifier.of(Array("a", "b"), "c")
Review Comment:
I think it's okay to just leave it as it is.
--
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 #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk closed pull request #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
URL: https://github.com/apache/spark/pull/39723
--
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] NarekDW commented on pull request #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "NarekDW (via GitHub)" <gi...@apache.org>.
NarekDW commented on PR #39723:
URL: https://github.com/apache/spark/pull/39723#issuecomment-1416816347
Thank you @MaxGekk, will keep it going :)
--
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] NarekDW commented on a diff in pull request #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "NarekDW (via GitHub)" <gi...@apache.org>.
NarekDW commented on code in PR #39723:
URL: https://github.com/apache/spark/pull/39723#discussion_r1096127356
##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryCompilationErrorsSuite.scala:
##########
@@ -679,6 +680,40 @@ class QueryCompilationErrorsSuite
context = ExpectedContext("", "", 7, 13, "CAST(1)")
)
}
+
+ test("IDENTIFIER_TOO_MANY_NAME_PARTS: " +
+ "create temp view doesn't support identifiers consisting of more than 2 parts") {
+ checkError(
+ exception = intercept[ParseException] {
+ sql("CREATE TEMPORARY VIEW db_name.schema_name.view_name AS SELECT '1' as test_column")
Review Comment:
No, the view won't be created because of the error (view name consists of 3 parts...)
--
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] srielau commented on a diff in pull request #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "srielau (via GitHub)" <gi...@apache.org>.
srielau commented on code in PR #39723:
URL: https://github.com/apache/spark/pull/39723#discussion_r1086989926
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -797,6 +797,11 @@
],
"sqlState" : "42602"
},
+ "INVALID_IDENTIFIER_HAS_MORE_THAN_2_NAME_PARTS" : {
Review Comment:
Invalid identifier i used for bad characters IIRC.
IDENTIFIER_TOO_MANY_NAME_PARTS is fine.
--
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] itholic commented on a diff in pull request #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "itholic (via GitHub)" <gi...@apache.org>.
itholic commented on code in PR #39723:
URL: https://github.com/apache/spark/pull/39723#discussion_r1086458494
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -797,6 +797,11 @@
],
"sqlState" : "42602"
},
+ "INVALID_IDENTIFIER_HAS_MORE_THAN_2_NAME_PARTS" : {
Review Comment:
Let's only use string for error class name.
BTW, maybe we can integrate it with `INVALID_IDENTIFIER` and reuse it ??
Or maybe `IDENTIFIER_TOO_MANY_NAME_PARTS` similar to `TEMP_VIEW_NAME_TOO_MANY_NAME_PARTS` ?
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/V2SessionCatalogSuite.scala:
##########
@@ -1119,4 +1119,40 @@ class V2SessionCatalogNamespaceSuite extends V2SessionCatalogBaseSuite {
}
catalog.dropNamespace(testNs, cascade = false)
}
+
+ test("IdentifierHelper should throw exception when identifier has more than 2 parts") {
+ val testIdent: IdentifierHelper = Identifier.of(Array("a", "b"), "c")
Review Comment:
Can we have a test with examples of queries that users might actually use, such as SQL tests?
It would be great if we have a test in `sql/core/src/test/scala/org/apache/spark/sql/errors/QueryCompilationErrorsSuite.scala` if possible.
--
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] NarekDW commented on a diff in pull request #39723: [WIP][SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "NarekDW (via GitHub)" <gi...@apache.org>.
NarekDW commented on code in PR #39723:
URL: https://github.com/apache/spark/pull/39723#discussion_r1088834285
##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryCompilationErrorsSuite.scala:
##########
@@ -679,6 +681,68 @@ class QueryCompilationErrorsSuite
context = ExpectedContext("", "", 7, 13, "CAST(1)")
)
}
+
+ test("IDENTIFIER_TOO_MANY_NAME_PARTS: " +
+ "create temp view doesn't support identifiers consisting of more than 2 parts") {
+ checkError(
+ exception = intercept[ParseException] {
+ sql("CREATE TEMPORARY VIEW db_name.schema_name.view_name AS SELECT '1' as test_column")
+ },
+ errorClass = "IDENTIFIER_TOO_MANY_NAME_PARTS",
+ parameters = Map(
+ "quoted" -> "db_name.schema_name.view_name",
+ "identifier" -> "TableIdentifier"
+ )
+ )
+ }
+
+ test("IDENTIFIER_TOO_MANY_NAME_PARTS: " +
+ "alter table doesn't support identifiers consisting of more than 2 parts") {
+ val tableName: String = "t"
+ withTable(tableName) {
+ sql(
+ s"""
+ |CREATE TABLE $tableName (a STRING, b INT, c STRING, d STRING)
+ |USING parquet
+ |PARTITIONED BY (c, d)
+ |""".stripMargin)
+
+ checkError(
+ exception = intercept[AnalysisException] {
+ sql("ALTER TABLE t RENAME TO db_name.schema_name.new_table_name")
+ },
+ errorClass = "IDENTIFIER_TOO_MANY_NAME_PARTS",
+ parameters = Map(
+ "quoted" -> "db_name.schema_name.new_table_name",
+ "identifier" -> "TableIdentifier"
+ )
+ )
+ }
+ }
+}
+
+class QueryCompilationJDBCErrorsSuite extends JDBCV2Suite {
+
+ test("IDENTIFIER_TOO_MANY_NAME_PARTS: " +
+ "jdbc function doesn't support identifiers consisting of more than 2 parts") {
+ JdbcDialects.unregisterDialect(H2Dialect)
+ try {
+ JdbcDialects.registerDialect(testH2Dialect)
+ checkError(
+ exception = intercept[AnalysisException] {
+ sql("SELECT * FROM h2.test.people where h2.db_name.schema_name.function_name()")
+ },
+ errorClass = "IDENTIFIER_TOO_MANY_NAME_PARTS",
+ parameters = Map(
+ "quoted" -> "db_name.schema_name.function_name",
+ "identifier" -> "FunctionIdentifier"
+ )
+ )
+ } finally {
+ JdbcDialects.unregisterDialect(testH2Dialect)
+ JdbcDialects.registerDialect(H2Dialect)
+ }
+ }
Review Comment:
These are all the sql queries I've found to reproduce IDENTIFIER_TOO_MANY_NAME_PARTS error class.
Let me know if I missed some cases...
--
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] NarekDW commented on a diff in pull request #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "NarekDW (via GitHub)" <gi...@apache.org>.
NarekDW commented on code in PR #39723:
URL: https://github.com/apache/spark/pull/39723#discussion_r1088143397
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -797,6 +797,11 @@
],
"sqlState" : "42602"
},
+ "INVALID_IDENTIFIER_HAS_MORE_THAN_2_NAME_PARTS" : {
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] NarekDW commented on a diff in pull request #39723: [WIP][SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "NarekDW (via GitHub)" <gi...@apache.org>.
NarekDW commented on code in PR #39723:
URL: https://github.com/apache/spark/pull/39723#discussion_r1088830120
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/V2SessionCatalogSuite.scala:
##########
@@ -1119,4 +1119,40 @@ class V2SessionCatalogNamespaceSuite extends V2SessionCatalogBaseSuite {
}
catalog.dropNamespace(testNs, cascade = false)
}
+
+ test("IdentifierHelper should throw exception when identifier has more than 2 parts") {
+ val testIdent: IdentifierHelper = Identifier.of(Array("a", "b"), "c")
Review Comment:
@itholic done, please check.
Are these tests redundant? Or do we need to keep them?
--
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 #39723: [SPARK-41302][SQL] Assign name to _LEGACY_ERROR_TEMP_1185
Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on PR #39723:
URL: https://github.com/apache/spark/pull/39723#issuecomment-1416739072
@NarekDW Do you have an account at https://issues.apache.org/jira ? If not, I could create it for you. I would like to assign the resolved ticket https://issues.apache.org/jira/browse/SPARK-41302 to you.
--
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