-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-50116][SQL] Assign appropriate error condition for _LEGACY_ERROR_TEMP_2067
: UNSUPPORTED_PARTITION_TRANSFORM
#48655
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
Conversation
…OR_TEMP_2067: UNSUPPORTED_PARTITION_TRANSFORM
errorClass = "_LEGACY_ERROR_TEMP_2067", | ||
messageParameters = Map("transform" -> transform.toString())) | ||
errorClass = "UNSUPPORTED_PARTITION_TRANSFORM", | ||
messageParameters = Map("transform" -> toSQLId(transform.toString))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't transform
an expression actually. If so, please, use toSQLExpr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, I see. Transform
extends another Expression
from org.apache.spark.sql.connector.expressions
. Could you add one more definition of toSQLExpr
which accept connector.expressions.Expression
. It should quote in the same way as the existing toSQLExpr
(using quoteByDefault
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure will add it. Thanks for the comment!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @MaxGekk I just realized during addressing the comment that we also should add all internal functions such as toPrettySQL(e: Expression)
, usePrettyExpression(e: Expression)
, Expression.sql
, transform
, dataType
, etc. that are used by quoteByDefault
internally.

I believe the number of changes and complexity would not be very trivial so maybe we better open separate ticket and discuss there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. thank you for the investigation.
+1, LGTM. Merging to master. |
ah, the ticket SPARK-50016 is wrong. @itholic could provide a correct one. |
_LEGACY_ERROR_TEMP_2067
: UNSUPPORTED_PARTITION_TRANSFORM
_LEGACY_ERROR_TEMP_2067
: UNSUPPORTED_PARTITION_TRANSFORM
Oh, it should be SPARK-50116. Let me update the JIRA |
What changes were proposed in this pull request?
This PR proposes to assign proper error condition & sqlstate for
_LEGACY_ERROR_TEMP_2067
:UNSUPPORTED_PARTITION_TRANSFORM
Why are the changes needed?
To improve the error message by assigning proper error condition and SQLSTATE
Does this PR introduce any user-facing change?
No, only user-facing error message improved
How was this patch tested?
Updated the existing tests
Was this patch authored or co-authored using generative AI tooling?
No