fix: support parquet cross-type conversions - #25510
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
fixed |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Request changes on the latest head. Two newly supported cross-type paths still have reproducible correctness failures:
-
[High] TIMESTAMP(isAdjustedToUTC=true) -> DATETIME ignores the session timezone. The DATETIME mapper at
parquet.go:1268-1323directly converts the physical Unix value withtypes.Datetime(types.Unix*ToTimestamp(...))for both plain and dictionary pages. It never inspectsdtT.IsAdjustedToUTCand never uses the session location. This is inconsistent with the new TIMESTAMP -> DATE/TIME paths, which correctly callparquetTimestampValueToDatetime; that helper converts an adjusted UTC instant throughts.ToDatetime(loc). I reproduced this on the current head: loading2024-01-01 00:00:00 UTCinto DATETIME withAsia/Shanghaiproduces00:00:00, while the correct session-local DATETIME is08:00:00. Please route all timestamp units and both encodings through the common adjusted/unadjusted helper and add non-UTC tests for adjusted=true and adjusted=false. -
[High] DOUBLE/DECIMAL -> FLOAT32 silently writes infinity instead of rejecting overflow. The scalar FLOAT32 mapper at
parquet.go:966-970narrows withfloat32(val)without checkingabs(val) > math.MaxFloat32; the new LIST -> VECF32 mapper atparquet.go:428-432has the same issue. A finite Parquet DOUBLE value1e100maps successfully with nil error and becomes+Inf. MatrixOne cast handling and the STRING -> FLOAT32 path reject out-of-range values, so LOAD DATA must not silently manufacture infinity. Please centralize a checked FLOAT32 conversion and use it for scalar decimal/double sources and list-double elements. Add positive/negative overflow tests, including dictionary/plain scalar pages and LIST.
The current CI and the complete pkg/sql/colexec/external test suite pass, but the BVT fixes time_zone to UTC and uses only small float values, so neither failure is covered. I also checked NULL/error page cleanup, dictionary index validation, page-bounded allocations, and synchronous termination paths; I found no additional lifecycle/hang/OOM blocker.
fixed |
XuPeng-SH
left a comment
There was a problem hiding this comment.
最新 head 看下来,我上次卡的两个 correctness blocker 都已经补齐了,可以 approve。
TIMESTAMP -> DATETIME/TIME/DATE现在统一走parquetTimestampValueToDatetime(...)/ 本地时区 helper,isAdjustedToUTC=true/false的路径都收口了;America/New_York的 DST 回归测试也补进来了。DOUBLE/DECIMAL -> FLOAT32以及LIST<DOUBLE> -> VECF32现在都走带范围检查的parquetFloat64ToFloat32(...),不再静默写Inf;正负溢出 UT 也补了。
按当前 scope,我这里没有剩余 blocker 了。
What type of PR is this?
Which issue(s) this PR fixes:
issue #24914
What this PR does / why we need it:
fix: support parquet cross-type conversions