technicolorbeat opened a new pull request, #27879: URL: https://github.com/apache/datafusion/pull/27879
## Which issue does this PR close? Closes #24754. ## Rationale for this change On a registered table, `SELECT * FROM t TABLESAMPLE SYSTEM (10 PERCENT)` currently succeeds as a full scan when no relation planner handles the clause. Other unsupported modifiers can also be dropped during planning, changing the meaning of the query. ## What changes are included in this PR? - Keep modifier validation in the default planner, after registered `RelationPlanner` extensions get a chance to handle the relation. - Return a feature-specific planning error for unsupported modifiers on tables, derived tables, and table functions. Match the fields of these SQL AST variants explicitly so a future field requires a planning decision. ## What is the testing strategy for this PR? - `relation_modifiers.slt` covers a successful plain scan and SQL-visible errors, including the reported `TABLESAMPLE` query, a CTE reference, and a derived table. Disabling the table sampling check made both the plain-table and CTE sampling regressions fail. - `table_sample_requires_relation_planner` runs the same query with two extension setups. It verifies the error when a planner passes the relation through and the one-row result when an extension handles sampling. ## Are there any user-facing changes? Queries with an unsupported modifier now fail during planning with an error that identifies the clause. ## AI usage disclosure OpenAI Codex assisted with the implementation and tests. -- 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]
