ViktorBystrov72 opened a new pull request, #60550:
URL: https://github.com/apache/spark/pull/60550

   ### What changes were proposed in this pull request?
   
   Keep the day count in the `DateWritable` superclass synchronized with the 
Julian day count used by `DaysWritable`. Update it during construction, 
`set(Int)`, and deserialization so inherited comparison, equality, and hashing 
distinguish date keys. Add core, native ORC, and Hive object-inspector 
regressions and a migration note.
   
   ### Why are the changes needed?
   
   [SPARK-61763](https://issues.apache.org/jira/browse/SPARK-61763) reports 
that writing a map with two distinct DATE keys retains only one entry. 
`DaysWritable` keeps its own date fields, while the inherited comparison and 
hash methods read the superclass field, which remained zero. The ORC TreeMap 
and Hive HashMap therefore treat distinct dates as the same key.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Writing `map(DATE '2003-01-13', 6, DATE '2011-07-19', -4)` preserves 
both entries instead of keeping the first key with the last value. Affected 
existing files need to be regenerated from the original data.
   
   ### How was this patch tested?
   
   All 9 new regression cases fail on the original production code: four 
comparison/map tests, four native ORC write/read variants, and one Hive 
map-wrapping test.
   
   The comparison tests include pre-1582 dates, ordinary DateWritable 
interoperability in both directions, copy construction, object reuse, and 
serialization. ORC coverage exercises V1/V2 and vectorized/row readers. Hive 
coverage exercises the real object-inspector wrapper.
   
   - With `-Phive`, the complete `DaysWritableSuite`, `OrcSourceV1Suite`, and 
`OrcSourceV2Suite` passed: 86 tests, 2 existing ignored cases.
   - The complete `HiveInspectorSuite` passed: 25 tests.
   - SQL production/test and Hive test ScalaStyle passed.
   - Apache RAT passed with the repository exclusions plus the `.git` worktree 
metadata file.
   
   The SQL suites emitted possible-daemon-thread-leak warnings in both baseline 
and patched runs; the patched process exited successfully.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: OpenAI Codex (gpt-6.1-sol; exact tool build unavailable). 
Codex assisted with the implementation, tests, migration note, and this 
description.
   


-- 
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