Skip to content

fix(metadata): align ARRAY Arrow child names with DBSQL - #391

Merged
vuanhphung merged 2 commits into
mainfrom
fix/array-arrow-child-name
Oct 8, 2026
Merged

vuanhphung merged 2 commits into
mainfrom
fix/array-arrow-child-name

Conversation

@vuanhphung

@vuanhphung vuanhphung commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Use element for 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 --offline suite, cargo clippy --offline --all-targets -- -D warnings, and cargo +stable fmt --all -- --check. Live warehouse tests remain ignored.

Fixes PECOBLR-4126.


This PR was created with GitHub MCP.

Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

@vuanhphung
vuanhphung enabled auto-merge October 8, 2026 22:36

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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.

Merged via the queue into main with commit d74427e Oct 8, 2026
24 checks passed

This branch was previously deployed

1 inactive deployment
azure-prod — 7b459756 Deployed Oct 8, 2026 by oss-reviewer-bot[bot] via followup #1971
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant