PARQUET-3364: Allow hyphens in column names in AvroSchemaConverter#3524
Open
yadavay-amzn wants to merge 1 commit intoapache:masterfrom
Open
PARQUET-3364: Allow hyphens in column names in AvroSchemaConverter#3524yadavay-amzn wants to merge 1 commit intoapache:masterfrom
yadavay-amzn wants to merge 1 commit intoapache:masterfrom
Conversation
…olumn names Widen the catch in CatCommand.run() from SchemaParseException to RuntimeException so that Avro-related failures (including name validation errors during record reading) fall back to the GroupReader path, which handles non-standard field names correctly. The existing test testCatCommandWithHyphenatedFieldNames validates this fix.
e9f5257 to
fa9682b
Compare
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?
Widen the catch in
CatCommand.run()fromSchemaParseExceptiontoRuntimeExceptionso that Avro-related failures (including name validation errors during record reading) fall back to theGroupReaderpath, which handles non-standard field names correctly.Why are the changes needed?
The
parquet catCLI command fails on valid Parquet files with hyphenated column names (e.g.,Creation-Time). The Avro path throws because Avro rejects hyphens in field names. TheGroupReaderfallback already handles these files correctly, but the catch was too narrow (SchemaParseExceptiononly) to trigger the fallback when the failure occurs during record reading rather than schema conversion.How was this tested?
The existing
CatCommandTest.testCatCommandWithHyphenatedFieldNamestest validates this fix — it creates a Parquet file with hyphenated field names and verifiesparquet catreads it successfully.Closes #3364