[SPARK-47262][SQL] Assign names to error conditions for parquet conversions#47802
Closed
vladanvasi-db wants to merge 9 commits intoapache:masterfrom
Closed
Conversation
9b86702 to
267c135
Compare
MaxGekk
requested changes
Aug 21, 2024
| errorClass = "_LEGACY_ERROR_TEMP_2238", | ||
| errorClass = "PARQUET_CONVERSION_FAILURE_WITHOUT_DECIMAL_METADATA", | ||
| messageParameters = Map( | ||
| "typeName" -> t.typeName, |
Member
There was a problem hiding this comment.
Suggested change
| "typeName" -> t.typeName, | |
| "typeName" -> toSQLType(t), |
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
Outdated
Show resolved
Hide resolved
…f parquet conversion and modified parquet type in exception message to use sql format
MaxGekk
requested changes
Aug 21, 2024
| errorClass = "_LEGACY_ERROR_TEMP_2238", | ||
| errorClass = "PARQUET_CONVERSION_FAILURE_WITHOUT_DECIMAL_METADATA", | ||
| messageParameters = Map( | ||
| "typeName" -> t.typeName, |
Member
There was a problem hiding this comment.
Suggested change
| "typeName" -> t.typeName, | |
| "typeName" -> toSQLType(t), |
| errorClass = "PARQUET_CONVERSION_FAILURE.DECIMAL", | ||
| messageParameters = Map( | ||
| "t" -> t.json, | ||
| "t" -> t.sql, |
Member
There was a problem hiding this comment.
Suggested change
| "t" -> t.sql, | |
| "t" -> toSQLType(t), |
| errorClass = "PARQUET_CONVERSION_FAILURE", | ||
| messageParameters = Map( | ||
| "t" -> t.json, | ||
| "dataType" -> t.sql, |
Member
There was a problem hiding this comment.
Suggested change
| "dataType" -> t.sql, | |
| "t" -> toSQLType(t), |
| "subClass": { | ||
| "WITHOUT_DECIMAL_METADATA" : { | ||
| "message" : [ | ||
| "Unable to create a Parquet converter for <typeName> whose Parquet type is <parquetType> without decimal metadata. Please read this column/field as Spark BINARY type." |
Member
There was a problem hiding this comment.
I don't need to repeat parent class error message otherwise users will see duplicates.
…ion error subclasses' messages, so they do not repeat
MaxGekk
reviewed
Aug 21, 2024
Member
MaxGekk
left a comment
There was a problem hiding this comment.
@vladanvasi-db Please, update PR's description according to your recent changes.
| "subClass": { | ||
| "WITHOUT_DECIMAL_METADATA" : { | ||
| "message" : [ | ||
| " Please read this column/field as Spark BINARY type." |
Member
There was a problem hiding this comment.
The gap is not needed because we merge parent's and chid's messages via a space.
Suggested change
| " Please read this column/field as Spark BINARY type." | |
| "Please read this column/field as Spark BINARY type." |
| }, | ||
| "DECIMAL" : { | ||
| "message" : [ | ||
| " Parquet DECIMAL type can only be backed by INT32, INT64, FIXED_LEN_BYTE_ARRAY, or BINARY." |
Member
There was a problem hiding this comment.
Suggested change
| " Parquet DECIMAL type can only be backed by INT32, INT64, FIXED_LEN_BYTE_ARRAY, or BINARY." | |
| "Parquet DECIMAL type can only be backed by INT32, INT64, FIXED_LEN_BYTE_ARRAY, or BINARY." |
da1ca27 to
9c6e30e
Compare
PARQUET_CONVERSION_FAILURE_WITHOUT_DECIMAL_METADATA, PARQUET_DECIMAL_CONVERSION_FAILURE and PARQUET_CONVERSION_FAILURE
PARQUET_CONVERSION_FAILURE_WITHOUT_DECIMAL_METADATA, PARQUET_DECIMAL_CONVERSION_FAILURE and PARQUET_CONVERSION_FAILUREPARQUET_CONVERSION_FAILURE.WITHOUT_DECIMAL_METADATA, PARQUET_CONVERSION_FAILURE.DECIMAL and PARQUET_CONVERSION_FAILURE to error conditions for parquet conversions
PARQUET_CONVERSION_FAILURE.WITHOUT_DECIMAL_METADATA, PARQUET_CONVERSION_FAILURE.DECIMAL and PARQUET_CONVERSION_FAILURE to error conditions for parquet conversions
MaxGekk
reviewed
Aug 21, 2024
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
Outdated
Show resolved
Hide resolved
MaxGekk
approved these changes
Aug 21, 2024
Member
|
+1, LGTM. Merging to master. |
Member
|
@vladanvasi-db Congratulations with your first contribution to Apache Spark! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
In the PR, I propose to rename the legacy error classes
_LEGACY_ERROR_TEMP_2238,_LEGACY_ERROR_TEMP_2239and_LEGACY_ERROR_TEMP_2240toPARQUET_CONVERSION_FAILURE.WITHOUT_DECIMAL_METADATA,PARQUET_CONVERSION_FAILURE.DECIMALandPARQUET_CONVERSION_FAILURE.Why are the changes needed?
Proper name improves user experience w/ Spark SQL.
Does this PR introduce any user-facing change?
No
How was this patch tested?
No testing was needed.
Was this patch authored or co-authored using generative AI tooling?
No