NoahKusaba opened a new issue, #2945:
URL: https://github.com/apache/datafusion-ballista/issues/2945

   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   
   Ballista checks its query results against DataFusion only for queries we 
list by hand:
   - `split_union.rs`, `parallel_window.rs`, `null_aware.rs`, `coalesce.rs` and 
`nested_loop_join.rs` in `ballista/client/tests`;
   - the shared `ORDERS_QUERIES` list in `ballista/client/tests/common/mod.rs`;
   - TPC-H with `--verify`.
   
   Most other tests hard-code their expected rows. So coverage stops at the 
queries someone thought to write. For example, #2942: `split_union.rs` compares 
sorted unions with DataFusion under both planners, but none of its queries has 
branches whose sort key is constant, and the adaptive planner rejects exactly 
those.
   
   #1116 proposed reusing DataFusion's sqllogictest to find these gaps, and was 
closed as not planned. This issue revisits it with a concrete plan, since the 
pieces needed now line up.
   
   **Describe the solution you'd like**
   
   Run DataFusion's `.slt` files against standalone Ballista, comparing each 
result with the expected output in the file:
   
   - `datafusion-sqllogictest` is published (56.0.0), and the published crate 
includes its `test_files` (193 `.slt` files in 55.2.0), so Ballista can depend 
on it without vendoring the files.
   - Its `DataFusion` engine takes a `SessionContext` and runs each statement 
through `create_physical_plan` and `execute_stream`. Given a standalone 
Ballista context, that should run each query on Ballista without a new engine. 
This needs confirming.
   - A `harness = false` test in Ballista would build a standalone Ballista 
context for each file and run the file through that engine. It can reuse the 
crate's `TestFile`, its filters and its `configMatrix` support.
   - Run each file under a small matrix of settings, such as the adaptive 
planner on and off, and `ballista.scheduler.max_partitions_per_task = 1`, so 
split stages are covered too.
   - Keep a checked-in list of files that are expected to fail, each with a 
reason, so CI fails only on new failures. The list also becomes the record of 
gaps between Ballista and DataFusion that #1116 asked for.
   
   Some files will need skipping or filtering:
   - `EXPLAIN` output, which differs on Ballista;
   - files whose setup in `TestContext` registers UDFs or custom tables that 
the executors wouldn't have;
   - `SET` of options Ballista doesn't pass on;
   - statements that write local files.
   
   A first step could be a spike that runs every file once and reports pass and 
fail counts per file, to size the list of expected failures before adding it to 
CI.
   
   **Describe alternatives you've considered**
   
   - **A shared harness for our own query lists.** It would run each listed 
query under a settings matrix and compare with DataFusion. It's worth doing 
anyway, and it complements this issue, but it's still limited to the queries we 
write.
   - **More benchmark verification.** TPC-H and TPC-DS with `--verify` cover a 
fixed set of queries.
   
   **Additional context**
   
   There is precedent for running the same tests through another engine or 
execution path:
   - DataFusion runs its `.slt` files through a Substrait round-trip engine, 
and its Postgres-compatibility files against Postgres.
   - DataFusion Comet runs Spark's SQL tests with Comet enabled.
   - SQLite's sqllogictest, where the format comes from, runs the same queries 
against several engines and compares the results.
   


-- 
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]

Reply via email to