Repository navigation
Honor suffix in ParquetExampleIO legacy read - #5998
Open
Dev-next-gen wants to merge 1 commit into
Open
Dev-next-gen wants to merge 1 commit into
Dev-next-gen wants to merge 1 commit into
Conversation
The HadoopFormatIO-based read passed the raw path to setInputPaths, so the suffix was ignored and every non-hidden file in the directory was opened as Parquet. Build the file pattern the same way the SDF read and the Avro and typed legacy reads already do.
This branch has not been deployed
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.
I noticed that
ParquetExampleIO.readLegacyhands the rawpathtoGcsConnectorUtil.setInputPaths, while the SDF read in the same file, and the legacy reads inParquetAvroIOandParquetTypeIO, all go throughScioUtil.filePattern(path, params.suffix)first. So withscio.parquet.read.useSplittableDoFn -> false(or on Dataflow with Runner V2 disabled, where this path is picked by default),parquetExampleFile(dir, suffix = ".parquet")ignores the suffix, and Hadoop opens every non-hidden file in the directory as Parquet.To check it, I wrote 10 Examples with
saveAsParquetExampleFile, dropped aREADME.txtnext to the part files, and read the directory back withsuffix = ".parquet"in both modes. I ran this against the published 0.15.9 artifacts (the file is unchanged between v0.15.9 and main), compilingParquetExampleIO.scalafrom main on top of them, then the patched version:The read-side
DefaultSuffixisnull, sofilePatternreturns the path unchanged when no suffix is given, and existing calls that pass a glob behave as before. I added a test toParquetExampleIOTestcovering the legacy read with an unrelated file in the directory. I didn't have sbt on hand, so the proof above comes from that standalone harness and I haven't run the sbt suite itself; CI should cover that.Found by a defect-hunting pipeline I build and run (Dev-next-gen), using Claude Code with Anthropic's Claude Opus 5.