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/06 11:59:49 UTC
[GitHub] [spark] panbingkun opened a new pull request, #38937: [SPARK-41406][SQL] Refactor error message for `NUM_COLUMNS_MISMATCH` to make it more generic
panbingkun opened a new pull request, #38937:
URL: https://github.com/apache/spark/pull/38937
### What changes were proposed in this pull request?
The pr aims to refactor error message for `NUM_COLUMNS_MISMATCH` to make it more generic.
### Why are the changes needed?
### Does this PR introduce _any_ user-facing change?
### How was this patch tested?
Update existed UT.
Pass GA.
--
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 #38937: [SPARK-41406][SQL] Refactor error message for `NUM_COLUMNS_MISMATCH` to make it more generic
Posted by GitBox <gi...@apache.org>.
srielau commented on code in PR #38937:
URL: https://github.com/apache/spark/pull/38937#discussion_r1042786058
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -932,7 +932,7 @@
},
"NUM_COLUMNS_MISMATCH" : {
"message" : [
- "<operator> can only be performed on tables with the same number of columns, but the first table has <refNumColumns> columns and the <invalidOrdinalNum> table has <invalidNumColumns> columns."
+ "<operator> expects matching number of columns. But the left side (target) has <leftNumCols> while the right side (source) has <rightNumCols>."
Review Comment:
I'm thinking of the operator being UNION (hence left and right).
So:
SET
INSERT
UNION
INTERSECT
EXCEPT
IN (?) -- this may go through struct logic not sure)
--
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 #38937: [SPARK-41406][SQL] Refactor error message for `NUM_COLUMNS_MISMATCH` to make it more generic
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on code in PR #38937:
URL: https://github.com/apache/spark/pull/38937#discussion_r1045107245
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -932,7 +932,7 @@
},
"NUM_COLUMNS_MISMATCH" : {
"message" : [
- "<operator> can only be performed on tables with the same number of columns, but the first table has <refNumColumns> columns and the <invalidOrdinalNum> table has <invalidNumColumns> columns."
+ "<operator> expects matching number of columns. But the left side (target) has <leftNumCols> while the right side (source) has <rightNumCols>."
Review Comment:
I would avoid words like `left`/`right` and `reference`/`target`, and just slightly improve the existing error template by replacing the word `table` to let's say `input`:
```
"<operator> can only be performed on inputs with the same number of columns, but the first input has <firstNumColumns> columns and the <invalidOrdinalNum> input has <invalidNumColumns> columns."
```
--
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] panbingkun commented on a diff in pull request #38937: [SPARK-41406][SQL] Refactor error message for `NUM_COLUMNS_MISMATCH` to make it more generic
Posted by GitBox <gi...@apache.org>.
panbingkun commented on code in PR #38937:
URL: https://github.com/apache/spark/pull/38937#discussion_r1041947852
##########
sql/core/src/test/resources/sql-tests/results/except-all.sql.out:
##########
@@ -230,10 +230,9 @@ org.apache.spark.sql.AnalysisException
{
"errorClass" : "NUM_COLUMNS_MISMATCH",
"messageParameters" : {
- "invalidNumColumns" : "2",
- "invalidOrdinalNum" : "second",
+ "leftNumCols" : "1",
"operator" : "EXCEPTALL",
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 #38937: [SPARK-41406][SQL] Refactor error message for `NUM_COLUMNS_MISMATCH` to make it more generic
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on PR #38937:
URL: https://github.com/apache/spark/pull/38937#issuecomment-1348190871
+1, LGTM. All GAs passed. Merging to master.
Thank you, @panbingkun and @srielau @srowen @bjornjorgensen 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] MaxGekk closed pull request #38937: [SPARK-41406][SQL] Refactor error message for `NUM_COLUMNS_MISMATCH` to make it more generic
Posted by GitBox <gi...@apache.org>.
MaxGekk closed pull request #38937: [SPARK-41406][SQL] Refactor error message for `NUM_COLUMNS_MISMATCH` to make it more generic
URL: https://github.com/apache/spark/pull/38937
--
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 #38937: [SPARK-41406][SQL] Refactor error message for `NUM_COLUMNS_MISMATCH` to make it more generic
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on code in PR #38937:
URL: https://github.com/apache/spark/pull/38937#discussion_r1041863502
##########
sql/core/src/test/resources/sql-tests/results/except-all.sql.out:
##########
@@ -230,10 +230,9 @@ org.apache.spark.sql.AnalysisException
{
"errorClass" : "NUM_COLUMNS_MISMATCH",
"messageParameters" : {
- "invalidNumColumns" : "2",
- "invalidOrdinalNum" : "second",
+ "leftNumCols" : "1",
"operator" : "EXCEPTALL",
Review Comment:
hmm, could you output it as `EXCEPT ALL`
--
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 #38937: [SPARK-41406][SQL] Refactor error message for `NUM_COLUMNS_MISMATCH` to make it more generic
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on code in PR #38937:
URL: https://github.com/apache/spark/pull/38937#discussion_r1042039382
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -932,7 +932,7 @@
},
"NUM_COLUMNS_MISMATCH" : {
"message" : [
- "<operator> can only be performed on tables with the same number of columns, but the first table has <refNumColumns> columns and the <invalidOrdinalNum> table has <invalidNumColumns> columns."
+ "<operator> expects matching number of columns. But the left side (target) has <leftNumCols> while the right side (source) has <rightNumCols>."
Review Comment:
cc @srielau @srowen Please, review this error message.
--
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] srowen commented on a diff in pull request #38937: [SPARK-41406][SQL] Refactor error message for `NUM_COLUMNS_MISMATCH` to make it more generic
Posted by GitBox <gi...@apache.org>.
srowen commented on code in PR #38937:
URL: https://github.com/apache/spark/pull/38937#discussion_r1042225255
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -932,7 +932,7 @@
},
"NUM_COLUMNS_MISMATCH" : {
"message" : [
- "<operator> can only be performed on tables with the same number of columns, but the first table has <refNumColumns> columns and the <invalidOrdinalNum> table has <invalidNumColumns> columns."
+ "<operator> expects matching number of columns. But the left side (target) has <leftNumCols> while the right side (source) has <rightNumCols>."
Review Comment:
What is an 'operator' here and can the left always be called the target?
--
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 #38937: [SPARK-41406][SQL] Refactor error message for `NUM_COLUMNS_MISMATCH` to make it more generic
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on code in PR #38937:
URL: https://github.com/apache/spark/pull/38937#discussion_r1045697341
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -932,7 +932,7 @@
},
"NUM_COLUMNS_MISMATCH" : {
"message" : [
- "<operator> can only be performed on tables with the same number of columns, but the first table has <refNumColumns> columns and the <invalidOrdinalNum> table has <invalidNumColumns> columns."
+ "<operator> expects matching number of columns. But the left side (target) has <leftNumCols> while the right side (source) has <rightNumCols>."
Review Comment:
@panbingkun Could you change the error message, 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] panbingkun commented on pull request #38937: [SPARK-41406][SQL] Refactor error message for `NUM_COLUMNS_MISMATCH` to make it more generic
Posted by GitBox <gi...@apache.org>.
panbingkun commented on PR #38937:
URL: https://github.com/apache/spark/pull/38937#issuecomment-1340399634
cc @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 a diff in pull request #38937: [SPARK-41406][SQL] Refactor error message for `NUM_COLUMNS_MISMATCH` to make it more generic
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on code in PR #38937:
URL: https://github.com/apache/spark/pull/38937#discussion_r1046819087
##########
sql/core/src/test/scala/org/apache/spark/sql/DataFrameSetOperationsSuite.scala:
##########
@@ -1011,7 +1012,7 @@ class DataFrameSetOperationsSuite extends QueryTest with SharedSparkSession {
val errMsg = intercept[AnalysisException] {
df1.unionByName(df2)
}.getMessage
- assert(errMsg.contains("Union can only be performed on tables with" +
+ assert(errMsg.contains("UNION can only be performed on tables with" +
Review Comment:
Is it another error class, right?
--
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] AmplabJenkins commented on pull request #38937: [SPARK-41406][SQL] Refactor error message for `NUM_COLUMNS_MISMATCH` to make it more generic
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on PR #38937:
URL: https://github.com/apache/spark/pull/38937#issuecomment-1340389026
Can one of the admins verify this patch?
--
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] bjornjorgensen commented on a diff in pull request #38937: [SPARK-41406][SQL] Refactor error message for `NUM_COLUMNS_MISMATCH` to make it more generic
Posted by GitBox <gi...@apache.org>.
bjornjorgensen commented on code in PR #38937:
URL: https://github.com/apache/spark/pull/38937#discussion_r1041987130
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -932,7 +932,7 @@
},
"NUM_COLUMNS_MISMATCH" : {
"message" : [
- "<operator> can only be performed on tables with the same number of columns, but the first table has <refNumColumns> columns and the <invalidOrdinalNum> table has <invalidNumColumns> columns."
+ "<operator> expects matching number of columns. But the left side (target) has <leftNumCols> while the right side (source) has <rightNumCols>."
Review Comment:
expects matching number of columns -> expect matching numbers of columns
--
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