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
register TABLESAMPLE SYSTEM RelationPlanner by default
Out-of-the-box TABLESAMPLE SYSTEM support, achieved through the
RelationPlanner extension API (#17843) instead of baking SQL parsing
into the in-tree SQL planner.
- New `TableSampleSystemPlanner` (RelationPlanner) in datafusion-sql,
auto-registered via `SessionStateDefaults::default_relation_planners`
and `SessionStateBuilder::with_default_features`. Lifts
`TABLESAMPLE SYSTEM(p%) [REPEATABLE(n)]` to the core `Sample`
extension node; rejects every other form at planning time with a
clear error and a pointer to RelationPlanner for downstream
semantics. `register_relation_planner` inserts at the front of the
chain, so a user-supplied planner can override built-in semantics
without touching core.
- `DefaultPhysicalPlanner::default()` now pre-registers
`SamplePhysicalPlanner` so the core `Sample` node lowers to
`SampleExec` automatically. Callers using
`with_extension_planners(...)` replace the defaults and need to
re-add `SamplePhysicalPlanner` if they want sampling.
- Restored the sqllogictest fixture
(`datafusion/sqllogictest/test_files/tablesample.slt`) — TABLESAMPLE
now works with the default `SessionContext` that the harness uses.
Drops the Rust integration test that existed only to register the
planner manually.
- Drops the redundant `relation_planner/table_sample_system.rs`
example. The remaining `table_sample.rs` example still demonstrates
registering a custom RelationPlanner ahead of the built-in one for
BERNOULLI / ROW / BUCKET semantics — note added in main.rs.
- 7 new ParquetSource unit tests around `try_push_sample` directly
(cube-root math, file-drop bounds, REPEATABLE determinism, single-
file short-circuit, target clamping). These exercise the
`FileSource` API without a SQL or SessionContext layer.
Net effect: `datafusion-cli` users get TABLESAMPLE SYSTEM(p%)
out of the box; downstream extensions can still take over by
registering their own `RelationPlanner` first.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments