cestercian opened a new pull request, #2611:
URL: https://github.com/apache/datafusion-ballista/pull/2611
# Which issue does this PR close?
Closes #2603.
# Rationale for this change
The TPC-H table schema `match` existed as three identical copies, in the
scheduler `test_utils`, the `tpch_plan_stability` fixtures and the `tpch`
benchmark binary. A schema change had to be made three times, and nothing kept
them in sync.
# What changes are included in this PR?
- New `ballista_core::test_utils::tpch::tpch_schema(table)`, holding the one
copy of the schema with the existing signed-integers note. It panics with
`unknown tpch table {name}` for anything else, which the fixtures copy already
did. It has two small unit tests: every table's column count, and the
unknown-table panic.
- `ballista_scheduler::test_utils::datafusion_test_context`, the plan
stability fixtures and `benchmarks/src/bin/tpch.rs` now call it. Their local
copies are deleted.
- `get_tbl_tpch_table_schema` in the benchmark is unchanged except that it
now builds on the shared function.
The module is a plain `pub mod` in `ballista-core` (not `cfg(test)`),
because the scheduler's integration tests and the benchmarks binary are
separate crates and need to import it. Happy to move it behind a feature or
rename it if you'd prefer somewhere else.
# Are there any user-facing changes?
No runtime changes. `ballista_scheduler::test_utils::get_tpch_schema` is
removed in favour of `ballista_core::test_utils::tpch::tpch_schema`. It was
only a test helper and nothing else in the repo uses it, but it was `pub`, so
flagging it.
# How I tested it
- `cargo fmt --all -- --check`
- `cargo clippy -p ballista-core -p ballista-scheduler -p
ballista-benchmarks --all-targets -- -D warnings`
- `cargo test -p ballista-core --lib test_utils` (2 passed)
- `cargo test -p ballista-scheduler`: all passed, including the
`tpch_plan_stability` snapshots, so the plans are unchanged.
- I didn't run the benchmarks themselves. They only compile under clippy
`--all-targets`.
I used an AI coding agent to help with this change. I reviewed the diff and
the test output before opening it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]