Repository navigation
fix(external): support Decimal256 CSV and JSONLINE loads - #28612
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? |
|
Current head |
cc67f2a to
0d316a1
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
GPT-6 medium deep review of exact head 0d316a114d87de3108151ea5a04988dd0b075362: no blockers found.
Reviewed Decimal256 CSV/JSONLINE parsing, precision/scale conversion, NULL and error cleanup paths, and the changed SQL/UT coverage. The added tests use small deterministic fixtures. Exact-head CI run 34833344163 passed; decimal256_external_load.sql passed 25/25 in 0.391s. The UT artifact does not expose individual timings for the added tests, and no evidence showed a test near the 45-second limit or material race-UT slowdown.
Merge Queue Status
This pull request spent 37 seconds in the queue, including 2 seconds running CI. Required conditions to merge
|
…n#28612) CSV and JSONLINE external paths reached the unsupported conversion branch for DECIMAL256 columns. This change parses Decimal256 values with the target precision and scale, appends the fixed Decimal256 value, validates Decimal256 rows for parallel offset calculation, and keeps numeric zero-fill and adjusted-value handling consistent with Decimal64 and Decimal128. Production file: - `pkg/sql/colexec/external/external.go` Regression coverage: - `pkg/sql/colexec/external/decimal256_test.go` - `test/distributed/cases/load_data/decimal256_external_load.sql` - `test/distributed/cases/load_data/decimal256_external_load.result` - `test/distributed/resources/load_data/decimal256_external.csv` - `test/distributed/resources/load_data/decimal256_external.jl` - Unit coverage exercises precision 39/40/50/76, signed values, scale rounding, NULL and empty fields, invalid and overflow values, CSV, JSONLINE object/array, parallel varchar intermediate handling, and zero-fill predicates. - BVT exercises CSV and JSONLINE external SELECT, INSERT SELECT, and LOAD DATA INLINE terminals with high-precision values, NULLs, invalid input, and overflow rollback. Scope and non-goals: - `externalwrite/encode.go` and Parquet paths are unchanged because they already support Decimal256. - The public Decimal256 parser is unchanged, including its existing negative-boundary behavior. - `makeType` and `isDirectParallelLoadType` remain unchanged so Decimal256 continues through the varchar intermediate path for parallel loading. Validation: - Unit/focused: PASS — Decimal256 focused tests using the controlled CGo test wrapper. - External package: PASS — full `pkg/sql/colexec/external` package tests. - Controlled CGo build/vet: PASS. - Independent challenge: PASS — fixed limb oracle for precision 39/40/50/76, signed boundaries, rounding carry, invalid/overflow rollback sequences, JSON `json.Number` object/array inputs, NULL, and parallel boundary behavior. - Race/repetition: PASS — focused challenge and regression tests with `-race -count=3`. - BVT content: PASS — production SQL cases and CSV/JSONLINE resources are included in this PR; runtime execution remains pending. - `git diff --check`: PASS. - Base behavior: FAIL as reported by issue matrixorigin#28590 — CSV DECIMAL256 loading reaches the unsupported conversion path; deployed SQL replay is pending. - PR-head behavior: PASS at package-level materialization/reader coverage; real SQL `SELECT`, `INSERT SELECT`, and `LOAD DATA` terminal verification remain pending. Exact evidence: - head: `cc67f2a92fd19a380fb7ea108ae36958f90caaf3` - target base (`matrixorigin/matrixone:main`): `269d59addd032d20897cc4d86f58de3e387a6d76` - merge-base: `269d59addd032d20897cc4d86f58de3e387a6d76` - full diff hash (binary patch from merge-base to head): `b87dc5c94210eb0448acb9383651d7716dc0250a1edc6b9fd9f1d437a88dade7` QA Decision - required: yes - reason: this changes user-visible CSV/JSONLINE external SQL behavior, and deployed SQL/BVT coverage is still pending. - production_entrypoint: CSV/JSONLINE external field materialization used by external table SELECT/INSERT SELECT and LOAD DATA. - automated_terminal_coverage: package-level reader/materialization tests, independent Decimal256 challenge, and the authored production SQL BVT case. - remaining_validation: exact-head CI, BVT runtime, real SQL `SELECT`, `INSERT SELECT`, `LOAD DATA`, and QA environment verification. Approved by: @XuPeng-SH
…n#28612) CSV and JSONLINE external paths reached the unsupported conversion branch for DECIMAL256 columns. This change parses Decimal256 values with the target precision and scale, appends the fixed Decimal256 value, validates Decimal256 rows for parallel offset calculation, and keeps numeric zero-fill and adjusted-value handling consistent with Decimal64 and Decimal128. Production file: - `pkg/sql/colexec/external/external.go` Regression coverage: - `pkg/sql/colexec/external/decimal256_test.go` - `test/distributed/cases/load_data/decimal256_external_load.sql` - `test/distributed/cases/load_data/decimal256_external_load.result` - `test/distributed/resources/load_data/decimal256_external.csv` - `test/distributed/resources/load_data/decimal256_external.jl` - Unit coverage exercises precision 39/40/50/76, signed values, scale rounding, NULL and empty fields, invalid and overflow values, CSV, JSONLINE object/array, parallel varchar intermediate handling, and zero-fill predicates. - BVT exercises CSV and JSONLINE external SELECT, INSERT SELECT, and LOAD DATA INLINE terminals with high-precision values, NULLs, invalid input, and overflow rollback. Scope and non-goals: - `externalwrite/encode.go` and Parquet paths are unchanged because they already support Decimal256. - The public Decimal256 parser is unchanged, including its existing negative-boundary behavior. - `makeType` and `isDirectParallelLoadType` remain unchanged so Decimal256 continues through the varchar intermediate path for parallel loading. Validation: - Unit/focused: PASS — Decimal256 focused tests using the controlled CGo test wrapper. - External package: PASS — full `pkg/sql/colexec/external` package tests. - Controlled CGo build/vet: PASS. - Independent challenge: PASS — fixed limb oracle for precision 39/40/50/76, signed boundaries, rounding carry, invalid/overflow rollback sequences, JSON `json.Number` object/array inputs, NULL, and parallel boundary behavior. - Race/repetition: PASS — focused challenge and regression tests with `-race -count=3`. - BVT content: PASS — production SQL cases and CSV/JSONLINE resources are included in this PR; runtime execution remains pending. - `git diff --check`: PASS. - Base behavior: FAIL as reported by issue matrixorigin#28590 — CSV DECIMAL256 loading reaches the unsupported conversion path; deployed SQL replay is pending. - PR-head behavior: PASS at package-level materialization/reader coverage; real SQL `SELECT`, `INSERT SELECT`, and `LOAD DATA` terminal verification remain pending. Exact evidence: - head: `cc67f2a92fd19a380fb7ea108ae36958f90caaf3` - target base (`matrixorigin/matrixone:main`): `269d59addd032d20897cc4d86f58de3e387a6d76` - merge-base: `269d59addd032d20897cc4d86f58de3e387a6d76` - full diff hash (binary patch from merge-base to head): `b87dc5c94210eb0448acb9383651d7716dc0250a1edc6b9fd9f1d437a88dade7` QA Decision - required: yes - reason: this changes user-visible CSV/JSONLINE external SQL behavior, and deployed SQL/BVT coverage is still pending. - production_entrypoint: CSV/JSONLINE external field materialization used by external table SELECT/INSERT SELECT and LOAD DATA. - automated_terminal_coverage: package-level reader/materialization tests, independent Decimal256 challenge, and the authored production SQL BVT case. - remaining_validation: exact-head CI, BVT runtime, real SQL `SELECT`, `INSERT SELECT`, `LOAD DATA`, and QA environment verification. Approved by: @XuPeng-SH
…n#28612) CSV and JSONLINE external paths reached the unsupported conversion branch for DECIMAL256 columns. This change parses Decimal256 values with the target precision and scale, appends the fixed Decimal256 value, validates Decimal256 rows for parallel offset calculation, and keeps numeric zero-fill and adjusted-value handling consistent with Decimal64 and Decimal128. Production file: - `pkg/sql/colexec/external/external.go` Regression coverage: - `pkg/sql/colexec/external/decimal256_test.go` - `test/distributed/cases/load_data/decimal256_external_load.sql` - `test/distributed/cases/load_data/decimal256_external_load.result` - `test/distributed/resources/load_data/decimal256_external.csv` - `test/distributed/resources/load_data/decimal256_external.jl` - Unit coverage exercises precision 39/40/50/76, signed values, scale rounding, NULL and empty fields, invalid and overflow values, CSV, JSONLINE object/array, parallel varchar intermediate handling, and zero-fill predicates. - BVT exercises CSV and JSONLINE external SELECT, INSERT SELECT, and LOAD DATA INLINE terminals with high-precision values, NULLs, invalid input, and overflow rollback. Scope and non-goals: - `externalwrite/encode.go` and Parquet paths are unchanged because they already support Decimal256. - The public Decimal256 parser is unchanged, including its existing negative-boundary behavior. - `makeType` and `isDirectParallelLoadType` remain unchanged so Decimal256 continues through the varchar intermediate path for parallel loading. Validation: - Unit/focused: PASS — Decimal256 focused tests using the controlled CGo test wrapper. - External package: PASS — full `pkg/sql/colexec/external` package tests. - Controlled CGo build/vet: PASS. - Independent challenge: PASS — fixed limb oracle for precision 39/40/50/76, signed boundaries, rounding carry, invalid/overflow rollback sequences, JSON `json.Number` object/array inputs, NULL, and parallel boundary behavior. - Race/repetition: PASS — focused challenge and regression tests with `-race -count=3`. - BVT content: PASS — production SQL cases and CSV/JSONLINE resources are included in this PR; runtime execution remains pending. - `git diff --check`: PASS. - Base behavior: FAIL as reported by issue matrixorigin#28590 — CSV DECIMAL256 loading reaches the unsupported conversion path; deployed SQL replay is pending. - PR-head behavior: PASS at package-level materialization/reader coverage; real SQL `SELECT`, `INSERT SELECT`, and `LOAD DATA` terminal verification remain pending. Exact evidence: - head: `cc67f2a92fd19a380fb7ea108ae36958f90caaf3` - target base (`matrixorigin/matrixone:main`): `269d59addd032d20897cc4d86f58de3e387a6d76` - merge-base: `269d59addd032d20897cc4d86f58de3e387a6d76` - full diff hash (binary patch from merge-base to head): `b87dc5c94210eb0448acb9383651d7716dc0250a1edc6b9fd9f1d437a88dade7` QA Decision - required: yes - reason: this changes user-visible CSV/JSONLINE external SQL behavior, and deployed SQL/BVT coverage is still pending. - production_entrypoint: CSV/JSONLINE external field materialization used by external table SELECT/INSERT SELECT and LOAD DATA. - automated_terminal_coverage: package-level reader/materialization tests, independent Decimal256 challenge, and the authored production SQL BVT case. - remaining_validation: exact-head CI, BVT runtime, real SQL `SELECT`, `INSERT SELECT`, `LOAD DATA`, and QA environment verification. Approved by: @XuPeng-SH
What type of PR is this?
Which issue(s) this PR fixes:
issue #28590
What this PR does / why we need it:
CSV and JSONLINE external paths reached the unsupported conversion branch for DECIMAL256 columns. This change parses Decimal256 values with the target precision and scale, appends the fixed Decimal256 value, validates Decimal256 rows for parallel offset calculation, and keeps numeric zero-fill and adjusted-value handling consistent with Decimal64 and Decimal128.
Production file:
pkg/sql/colexec/external/external.goRegression coverage:
pkg/sql/colexec/external/decimal256_test.gotest/distributed/cases/load_data/decimal256_external_load.sqltest/distributed/cases/load_data/decimal256_external_load.resulttest/distributed/resources/load_data/decimal256_external.csvtest/distributed/resources/load_data/decimal256_external.jlScope and non-goals:
externalwrite/encode.goand Parquet paths are unchanged because they already support Decimal256.makeTypeandisDirectParallelLoadTyperemain unchanged so Decimal256 continues through the varchar intermediate path for parallel loading.Validation:
pkg/sql/colexec/externalpackage tests.json.Numberobject/array inputs, NULL, and parallel boundary behavior.-race -count=3.git diff --check: PASS.SELECT,INSERT SELECT, andLOAD DATAterminal verification remain pending.Exact evidence:
cc67f2a92fd19a380fb7ea108ae36958f90caaf3matrixorigin/matrixone:main):269d59addd032d20897cc4d86f58de3e387a6d76269d59addd032d20897cc4d86f58de3e387a6d76b87dc5c94210eb0448acb9383651d7716dc0250a1edc6b9fd9f1d437a88dade7QA Decision
SELECT,INSERT SELECT,LOAD DATA, and QA environment verification.