You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 73e3c2a
Browse filesBrowse the repository at this point in the historyBrowse files
chore: Add primary key constraints for TPC-H, TPC-DS (apache#22646)
## Which issue does this PR close?
- Closesapache#22595.
## Rationale for this change
The TPC-DS and TPC-H specifications define primary keys, but we
previously did not include those constraints when defining the TPC-DS
and TPC-H schemas. Including the constraints enables the query optimizer
to generate better plans (e.g., by leveraging FDs); it also makes the
benchmark setup closer to a realistic TPC-DS/H benchmark run.
To enable this, we need to fix `MemTable::load`: `MemTable` could be
constructed `with_constraints`, but those constraints were not attached
to the table returned by `MemTable::load`.
There is some duplication here: we define two copies of the primary keys
of both TPC-DS and TPC-H, because `benchmarks` and `test-utils` can't
easily share code. This could be improved but I'll defer that for now.
## What changes are included in this PR?
* Fix `MemTable::load` to include constraints on the newly loaded table
* Refactor `MemTable::load` to use `collect_partitioned`
* Add unit tests for new `MemTable::load` behavior
* Add TPC-DS and TPC-H primary keys to `benchmarks`
* Add TPC-DS and TPC-H primary keys to `test-utils`
* Add TPC-H primary keys to SLT schema definitions
## Are these changes tested?
New tests added for `MemTable::load` constraint behavior. SLT fixtures
updated for change in TPC schemas and plans.
## Are there any user-facing changes?
No.
0 commit comments