Native Parquet write falls back on int96RebaseModeInWrite=LEGACY even when timestamps are not written as INT96

未关闭 适合新手
#7,463 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
62/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust, scala, spark

调研方向

回退逻辑位于 NativeWriteUtils.legacyDatetimeRebaseWriteReason;从这里开始,阅读它在检查输出时间戳类型之前如何检查 int96RebaseModeInWrite。添加一个条件,使 INT96 检查仅在 spark.sql.parquet.outputTimestampType 为 INT96 时生效,然后添加一个回归测试,使用 TIMESTAMP_MICROS 和 int96RebaseModeInWrite=LEGACY,断言写入保持为原生写入。当该测试通过且 docs/source/user-guide/latest/parquet.md 中的段落已更新时,任务完成。

由索引模型根据 Issue 内容生成。

描述

area:writer enhancement requires-triage
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.

主要语言
Scala
星标
1.3k
派生
405
平均合并
3 天 1 小时
30 天内合并 PR
277

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/datafusion-comet 的其他 Issue

查看 apache/datafusion-comet 的全部 Issue

相似的 Issue

更多 Scala Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。