Skip to content

Commit e6782ce

Browse files
rustyconoverclaude
andcommitted
test(fixture): add multi_branch_iceberg example-catalog fixture
Adds a multi_branch_iceberg Table (columns=n int64) + its table_scan_branches_get case to the example worker: a VGI sequence(50) hot arm + a native iceberg_scan('/tmp/vgi_iceberg_branch') cold arm, with required_extensions=["iceberg"] so the C++ rewriter auto-loads iceberg. Backs the vgi extension's multi_branch_iceberg.test, which seeds the iceberg table via COPY … TO (FORMAT iceberg) and asserts the hot/cold union, filter pushdown into the iceberg arm, and branch introspection. Dev-only fixture; no wire-protocol change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 0df7a6a commit e6782ce

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

‎vgi/_test_fixtures/worker.py‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,16 @@ def _build_enum_stats() -> dict[str, ColumnStatisticsInput]:
702702
columns=schema(n=pa.int64()),
703703
comment="Multi-branch: sequence(50) + read_parquet — used by multi_branch_heterogeneous.test",
704704
),
705+
# Iceberg cold arm: one VGI sequence() hot arm + one native
706+
# iceberg_scan arm. The iceberg table is created by the test at a
707+
# well-known path via COPY … TO (FORMAT iceberg) (see
708+
# multi_branch_iceberg.test). Demonstrates iceberg_scan as a
709+
# first-class cold-tier branch — the flagship lakehouse example.
710+
Table(
711+
name="multi_branch_iceberg",
712+
columns=schema(n=pa.int64()),
713+
comment="Multi-branch: sequence(50) + iceberg_scan — used by multi_branch_iceberg.test",
714+
),
705715
# Column reconciliation: 3 read_parquet branches, the test creates
706716
# the parquet files with deliberately different column orders and
707717
# a missing column on one branch. Canonical schema (a, b) is
@@ -1331,6 +1341,28 @@ def table_scan_branches_get(
13311341
required_extensions=[],
13321342
)
13331343

1344+
# multi_branch_iceberg: one VGI arm (sequence(50)) + one native
1345+
# iceberg_scan arm pointing at a well-known iceberg table dir the test
1346+
# creates via COPY … TO (FORMAT iceberg) before querying. The iceberg
1347+
# table has a single column "n" holding values 50..99. Total rows = 100.
1348+
# required_extensions=["iceberg"] so the rewriter auto-loads it.
1349+
if schema_name.lower() == "data" and name.lower() == "multi_branch_iceberg":
1350+
return ScanBranchesResult(
1351+
branches=[
1352+
ScanBranch(
1353+
function_name="sequence",
1354+
positional_arguments=[pa.scalar(50)],
1355+
named_arguments={},
1356+
),
1357+
ScanBranch(
1358+
function_name="iceberg_scan",
1359+
positional_arguments=[pa.scalar("/tmp/vgi_iceberg_branch", pa.string())],
1360+
named_arguments={},
1361+
),
1362+
],
1363+
required_extensions=["iceberg"],
1364+
)
1365+
13341366
# multi_branch_empty: worker deliberately returns branches=[] to
13351367
# exercise the C++ side's BinderException loud-fail. ParseScanBranchesResult
13361368
# must reject this at the wire layer.

0 commit comments

Comments
 (0)