Native Parquet write falls back on int96RebaseModeInWrite=LEGACY even when timestamps are not written as INT96
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- data-engineering
Research direction
The fallback lives in NativeWriteUtils.legacyDatetimeRebaseWriteReason; start there and read how it inspects int96RebaseModeInWrite before checking the output timestamp type. Add a condition so the INT96 check applies only when spark.sql.parquet.outputTimestampType is INT96, then add a regression test with TIMESTAMP_MICROS and int96RebaseModeInWrite=LEGACY asserting the write stays native. Done when that test passes and the paragraph in docs/source/user-guide/latest/parquet.md is updated.
Written by the indexing model from the issue text.
Description
What is the problem the feature request solves?
Found in review of #7053. The native Parquet writer fallback added there, NativeWriteUtils.legacyDatetimeRebaseWriteReason, treats spark.sql.parquet.int96RebaseModeInWrite=LEGACY as a reason to fall back whenever the output has a timestamp column. That setting only governs the INT96 encoding. When spark.sql.parquet.outputTimestampType is TIMESTAMP_MICROS or TIMESTAMP_MILLIS, Spark writes INT64 and uses datetimeRebaseModeInWrite instead, so the INT96 setting has no effect on the output.
Reproduction: a timestamp column, outputTimestampType=TIMESTAMP_MICROS, datetimeRebaseModeInWrite=CORRECTED. Changing only int96RebaseModeInWrite from CORRECTED to LEGACY makes the helper return a fallback reason instead of None. Spark writes the same INT64 TIMESTAMP(MICROS) either way (for 1500-01-01 12:34:56.123456 both files contain -14831724303876544).
The fallback is safe, but an unrelated legacy INT96 setting disables native write acceleration for a write the native writer handles correctly.
Describe the potential solution
Only apply the INT96 condition when spark.sql.parquet.outputTimestampType is INT96. The native writer always writes INT64 microseconds and ignores outputTimestampType when writing, so the check has to read the session conf.
Add a regression test with a non-INT96 timestamp output and int96RebaseModeInWrite=LEGACY that asserts the write stays native and matches Spark's value. Update the paragraph in docs/source/user-guide/latest/parquet.md that names int96RebaseModeInWrite=LEGACY as a fallback trigger.
Additional context
Reviewer comment: https://github.com/apache/datafusion-comet/pull/7053#discussion_r4458640616
Follow-on to #7053, which should merge first.
- Dominant language
- Scala
- Stars
- 1.3k
- Forks
- 405
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 277
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/datafusion-comet
-
requires-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/datafusion-comet#7458 ·
Maintainers usually reply within 2 days
-
requires-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/datafusion-comet#7453 ·
Maintainers usually reply within 2 days
-
area:ci enhancement priority:low requires-triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
apache/datafusion-comet#7319 · 1 comment ·
Maintainers usually reply within 2 days
-
area:ci bug priority:low requires-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/datafusion-comet#7315 ·
Maintainers usually reply within 2 days
-
requires-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/datafusion-comet#7240 ·
Maintainers usually reply within 2 days
All issues in apache/datafusion-comet
Similar issues
-
v4 LSU does not mask TLB exceptions on miss: PTW refill causes Load Access Fault on M-mode loadOpen
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
riscv-boom/riscv-boom#835 ·
-
Add a base64url Stringable helperPossibly taken @nafg claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nafg/simple-router#362 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
propensive/soundness#2351 ·
Maintainers usually reply within 1 day
-
Traffic event delivered/rejected counters appear swapped in TrafficStateController.updateWithReceiptOpen
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
digital-asset/canton#705 ·
Maintainers usually reply within 2 days
-
easy first-contributor first-contributors good first issue help wanted scala up-for-grabs
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
fork-commit-merge/fork-commit-merge#8457 ·
Maintainers usually reply within 1 day