Skip to content

fix(isthmus)!: apply the emit mapping a virtual table carries - #1189

Open
alexandrefimov wants to merge 2 commits into
substrait-io:mainfrom
alexandrefimov:issue-1160-virtual-table-emit
Open

fix(isthmus)!: apply the emit mapping a virtual table carries#1189
alexandrefimov wants to merge 2 commits into
substrait-io:mainfrom
alexandrefimov:issue-1160-virtual-table-emit

Conversation

@alexandrefimov

@alexandrefimov alexandrefimov commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

visit(VirtualTableScan) routed neither half of the relation's RelCommon: a scan whose emit mapping drops a column converted carrying all of them, under a row type that reported one, and the names of its hint were dropped with it. It goes through applyRelCommon now, like every relation whose conversion applies a mapping.

A NamedWrite and a NamedDdl cannot apply one. A TableModify's row type is a single ROWCOUNT column, and a CreateTable or a CreateView produces the object it creates, so there are no columns for a mapping to select; visit(NamedUpdate) already refuses one for that reason, and these two now do the same instead of dropping it.

A mapping is materialised as a projection, so a scan carrying one comes back from Calcite as a projection over a virtual table rather than as the scan it went in as -- the shape every relation with a mapping returns as. Without a mapping there is no projection for the hint's names to land on, and the table keeps the names its schema gives it.

Closes #1160

BREAKING CHANGE: a NamedWrite or a NamedDdl carrying an emit mapping no longer converts to Calcite. It used to convert with the mapping dropped, which produced a plan that did not describe the relation it came from.

…he ones that cannot be

A VirtualTableScan routed neither its emit mapping nor its hint, so a scan whose
mapping drops a column converted carrying all of them, with a row type that
reported one. It goes through applyRelCommon now, like every other relation
whose conversion applies one.

A NamedWrite and a NamedDdl cannot: a TableModify's row type is a single
ROWCOUNT column, and a CreateTable or a CreateView produces the object it
creates. They refuse a mapping the way visit(NamedUpdate) already does, rather
than dropping it.

Closes substrait-io#1160
Nothing covered the case a reader asks about first: with no mapping there is no
projection for the names to land on, so the table keeps the names its schema
gives it.
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.

isthmus: visit(VirtualTableScan) ignores the emit mapping

1 participant