Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[C++] Reader cannot resolve Java fixed-offset writer timezone IDs such as GMT-00:00

已关闭
#2,715 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
cpp, java

调研方向

Start with c++/src/Timezone.cc, especially getTimezoneByName and getTimezoneByFilename, then run orc-contents against the supplied gmt-0000.orc fixture. Confirm that the reader accepts the GMT-00:00 writerTimezone and still handles normal zoneinfo names correctly.

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

描述

I was closing out some old Arrow issues and this one (apache/arrow#21471, from 2019) looks like it is potentially an ORC bug rather than an Arrow one. I don't understand this domain well myself, so everything below the line was produced by Claude working through the ORC and Arrow source with me. I have checked that the reprex fails against current main (4dbfe288) as described, but I have not independently verified the code reading, so please treat it accordingly. I have tried to keep it concise.


Cause

When the JVM's default zone is a fixed offset, the Java writer records a custom ID such as GMT-00:00 or GMT+05:30 as the stripe writerTimezone (WriterImpl.java:563 uses TimeZone.getDefault().getID()). The Java reader accepts these because TimeZone.getTimeZone parses GMT±hh:mm (TreeReaderFactory.java:1251).

The C++ reader resolves a writer timezone only by opening $TZDIR/<name> (getTimezoneByName in c++/src/Timezone.cc), plus the US/* alias map from ORC-2011. No such file exists for GMT-00:00, so any stripe with a timestamp column fails:

$ orc-contents gmt-0000.orc
Caught exception in gmt-0000.orc: Time zone file /usr/share/zoneinfo/GMT-00:00 does not exist. Please install IANA time zone database and set TZDIR env.

Adding a GMT-00:00 symlink to GMT under TZDIR makes the same file read fine, so the timezone name is the only problem with it.

Reprex

gmt-0000.orc (250 bytes) has one stripe, one timestamp column, uncompressed, with writerTimezone set to GMT-00:00. It was written with the C++ writer via pyorc (with TZDIR pointed at a directory containing a GMT-00:00 zone file) to reproduce the footer field that Hive produced in the original report.

gmt-0000.orc as base64 (decode with base64 -d)
T1JDCgYSBAgBUAAKHgoEAAAAABIWCAFKEBjA2u/vslogwNrv77JaMAFQAHYAD9kwyEAAAAoGCAYQABgICgYIBhABGCAKBggBEAEYBgoGCAUQARgDEgQIABAAEgQIAhAAGglHTVQtMDA6MDAKHgoECAFQAAoWCAFKEBjA2u/vslogwNrv77JaMAFQAAgDEGgaCggDECgYCSA3KAEiDwgMEgEBGgJ0cyAAKAAwACIICAkgACgAMAAwAToECAFQADoWCAFKEBjA2u/vslogwNrv77JaMAFQAECQTkgBYgUyLjEuNAhXEAAYgIAEIgIADCggMAaC9AMDT1JDFw==

Suggested fix (untested)

Recognise names matching GMT[+-]hh(:mm)? in getTimezoneByFilename and return a fixed-offset Timezone instead of loading a file. The Etc/GMT±n zoneinfo files are not a substitute since they only cover whole hours and use the inverted POSIX sign.

主要语言
Java
星标
770
派生
515
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

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

apache/orc 的其他 Issue

查看 apache/orc 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

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