visit(NamedWrite) never reads getOutputMode() on the INSERT and DELETE paths -- only handleCreateTableAs checks it, for CTAS -- and returns a LogicalTableModify whose row type is a single ROWCOUNT column:
|
return LogicalTableModify.create( |
|
targetTable, |
|
requireCatalogReader(relOptSchema, write.getNames()), |
|
input, |
|
operation, |
|
null, |
|
null, |
|
false); |
The plan says otherwise. AbstractWriteRel.deriveRecordType() returns the input's record type, and the spec documents OUTPUT_MODE_MODIFIED_RECORDS as returning the records the operator inserted, deleted or updated, further manipulable upstream. So a write declaring MODIFIED_RECORDS converts to a relation that reports one column where the plan declares the input's, and a parent reading it resolves its references against columns that are not there.
isthmus produces those plans itself -- the export direction stamps the mode on every INSERT and DELETE:
|
.outputMode(AbstractWriteRel.OutputMode.MODIFIED_RECORDS) |
#1189 refuses an emit mapping on a write because the mode is dropped, and its message says so, but the drop itself is still silent. Either refuse MODIFIED_RECORDS the way the mapping is now refused, or model it.
Found while reviewing #1189.
visit(NamedWrite)never readsgetOutputMode()on the INSERT and DELETE paths -- onlyhandleCreateTableAschecks it, for CTAS -- and returns aLogicalTableModifywhose row type is a single ROWCOUNT column:substrait-java/isthmus/src/main/java/io/substrait/isthmus/SubstraitRelNodeConverter.java
Lines 1100 to 1107 in 934a60e
The plan says otherwise.
AbstractWriteRel.deriveRecordType()returns the input's record type, and the spec documentsOUTPUT_MODE_MODIFIED_RECORDSas returning the records the operator inserted, deleted or updated, further manipulable upstream. So a write declaringMODIFIED_RECORDSconverts to a relation that reports one column where the plan declares the input's, and a parent reading it resolves its references against columns that are not there.isthmus produces those plans itself -- the export direction stamps the mode on every INSERT and DELETE:
substrait-java/isthmus/src/main/java/io/substrait/isthmus/SubstraitRelVisitor.java
Line 798 in 934a60e
#1189 refuses an emit mapping on a write because the mode is dropped, and its message says so, but the drop itself is still silent. Either refuse
MODIFIED_RECORDSthe way the mapping is now refused, or model it.Found while reviewing #1189.