Skip to content

Select declared table columns in JDBC scans. - #864

Open
ekas-7 wants to merge 2 commits into
apache:mainfrom
ekas-7:fix/jdbc-table-source-column-projection
Open

ekas-7 wants to merge 2 commits into
apache:mainfrom
ekas-7:fix/jdbc-table-source-column-projection

Conversation

@ekas-7

@ekas-7 ekas-7 commented Oct 30, 2026

Copy link
Copy Markdown

Summary

  • Keep column names on TableSource, including when the operator is copied.
  • When a JDBC scan has no projection or aggregation, select those columns instead of *. JdbcTableSource.createSqlClause() still returns only the table name, so it stays in the FROM clause (SELECT name, age FROM customer).
  • Names that are not plain identifiers, such as ST_AsText(geom), still use *.
  • WayangTableScan.fields is now used to choose which columns are passed to the table source.

Test plan

  • TableSourceTest (names are kept, and a copy does not share the array)
  • JdbcExecutorTest: declared columns, expression-style names, and a projection overriding the source columns
  • Trino and Presto full-scan assertions updated to expect the explicit column list (SELECT order_id, customer_id, region, amount FROM orders)

Fixes : #648

Column names on a table source were dropped when the operator was copied, and JDBC scans always used SELECT * because the table clause is only the FROM target. Keep the names and use them as the SELECT list when they are plain identifiers.
@ekas-7

ekas-7 commented Nov 3, 2026

Copy link
Copy Markdown
Author

@novatechflow can u kindly review this PR

@ekas-7

ekas-7 commented Nov 10, 2026

Copy link
Copy Markdown
Author

@zkaoudi can u kindly review this

Keep declared-column SELECT lists for table sources after JDBC sources switched to the configuration-aware SQL API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fields are never queried, why?

1 participant