refactor: validate scalar Iceberg results with native values - #710
Draft
alexanderbianchi wants to merge 11 commits into
Draft
Conversation
alexanderbianchi
force-pushed
the
iceberg/test-statistics-cases
branch
from
September 8, 2026 19:20
f8dcd0c to
ea6a73e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Native scalar validation, with less test code
Stacked on #705 (
iceberg/test-statistics-cases, basef8dcd0c18f2420602f7ee62524ff88e667c50519). This covers every scalar query-result test in the current Iceberg suite, plus the empty-result case—not just the initial three-function pilot.Net −14 lines across the whole PR: 7 files, 91 insertions / 105 deletions, including the native query API and shared assertion helper. The initial pilot was +28 lines; the expanded version is 42 lines smaller. All existing test cases remain.
Before / after
Int64(0)row, aliastripsInt64(175000)row, aliastripsCOUNT(*), both statistics settingsProjectionExec -> PlaceholderRowExecchecks andInt64(175000)result98918829105162757MAX(trip_distance * fare_amount)Float64(207508.9584)resultLIMIT 0EmptyExecand empty-table snapshotsEmptyExeccheck and zero total result rowsEight scalar-result functions (nine named cases) share the same assertion helper. The empty-result case makes ten migrated cases overall. Multi-row/multi-column results, DESCRIBE, errors, statistics, and meaningful plan snapshots remain intact; they are not replaced merely to remove snapshot macros.
Structure
IcebergTestHarness::query_rawreturns the executed native plan and Arrow batches, using one physical plan and its DataFrame task context.query() -> Result<(String, String)>stays compatible. It captures plan text before executing that same plan, preserving existing snapshots without resetting runtime state or creating a second physical plan.#[track_caller]points failures at the calling test.i64/f64expectations distinguish values that would print identically as table text. No public assertion API, dependencies, feature flags, benchmarks, or root comparator changes. No performance claim.Validation
cargo test -p datafusion-distributed-iceberg --locked— 84 tests and 1 doctest passed; no cases removedcargo clippy -p datafusion-distributed-iceberg --tests --locked -- -D warnings— passedcargo fmt --all -- --checkandgit diff --check— passedInt64(1)for the empty table fails against actualInt64(0)Int32(9891)fails against actualInt64(9891)at the filter test's call site, even though both values print as9891Validation is scoped to the Iceberg crate; distributed integration/gRPC features were not enabled. #709 remains the independent result-comparator bug fix.