asifsmohammed opened a new pull request, #3700:
URL: https://github.com/apache/parquet-java/pull/3700

    ### Rationale for this change
   `VersionParser.parse(createdBy)` is called from 7 production sites, all 
parsing the same constant string from `FileMetaData.getCreatedBy()`. Since 
`FileMetaData` is constructed once per file and already stores the `createdBy` 
string, it is the natural place to parse once and cache the result.
   
   This provides the foundation for #3607 to rebase onto, using 
`ParsedVersion`-based APIs instead of threading a PARQUET-251-specific boolean 
through the call chain (as suggested in the [review 
discussion](https://github.com/apache/parquet-java/pull/3607#pullrequestreview-4679335966)).
   
   ### What changes are included in this PR?
   - Add a `transient ParsedVersion writerVersion` field to `FileMetaData`
   - Parse `createdBy` once in the canonical constructor and cache the result
   - Expose via `getWriterVersion()` getter (annotated `@JsonIgnore` to 
preserve JSON serialization)
   - Add `FileMetaDataTest` with coverage for valid, null, empty, and 
unparseable version strings
   
   ### Are these changes tested?
   Yes. New `FileMetaDataTest` with 5 test cases.
   
   ### Are there any user-facing changes?
   No breaking changes. Adds a new public method 
`FileMetaData.getWriterVersion()` that downstream call sites can use to avoid 
redundant parsing.
   
   Closes #3696


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to