Repository navigation
fix(metadata): align ARRAY Arrow child names with DBSQL - #391
Conversation
Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>
There was a problem hiding this comment.
Verdict: 1 Low
Looks good — the item→element change is correct and aligns ARRAY child naming with DBSQL/Spark's Arrow convention (ArrowUtils names list children element), reversing a prior comment that was wrong. I verified all remaining item occurrences are test fixtures, not production reconstruction, so there's no new inconsistency. One low note: the wiremock parity test is self-referential (both branches built from the same fabricated element-named payload), so the server-match premise rests on the ignored e2e path.
| } | ||
| } | ||
|
|
||
| #[tokio::test] |
There was a problem hiding this comment.
🔵 Low — The new execute_array_child_names_match_for_empty_and_non_empty_results test constructs both the empty and non-empty branches from the same locally-built ListArray whose child field is named "element". Because the mock IPC payload is fabricated by the test itself (not emitted by a real warehouse), the final assert_eq!(schemas[0], schemas[1]) only proves the two code paths agree with each other — it would pass identically if the kernel had chosen "item" on both sides. It cannot catch a wrong-direction choice relative to what DBSQL actually sends.
The actual correctness premise of this PR — that DBSQL's Arrow IPC names ARRAY children "element" (matching Spark's ArrowUtils), not "item" as the prior comment asserted — is only validated by the ignored live-warehouse path. Consider adding an #[ignore] e2e assertion in tests/v0_*_e2e.rs that runs SELECT array(...) and an empty-filtered variant against a live warehouse and compares the advertised schemas, so the server-match premise is covered by something that can actually fail if DBSQL's convention differs. The unit/wiremock change itself looks correct.
Use
elementfor ARRAY child fields reconstructed from SEA type text, matching DBSQL/Thrift naming for empty results. This applies recursively to nested arrays; server-provided Arrow schemas and result values are unchanged.Adds parser coverage, an empty/non-empty ARRAY schema regression, and checks that explicit IPC child names are preserved.
Validated with the full
cargo test --offlinesuite,cargo clippy --offline --all-targets -- -D warnings, andcargo +stable fmt --all -- --check. Live warehouse tests remain ignored.Fixes PECOBLR-4126.
This PR was created with GitHub MCP.