Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.26.0
-
None
-
None
Description
Currently an exception is thrown when LogicalValues having no fields is passed to RelFieldTrimmer#trimFields(LogicalValues, ImmutableBitSet, Set<RelDataTypeField>).
The reason is while trying to avoid producing an empty record, the code below is not expecting the row type of the input could be already an empty record.
public TrimResult trimFields( LogicalValues values, ImmutableBitSet fieldsUsed, Set<RelDataTypeField> extraFields) { final RelDataType rowType = values.getRowType(); final int fieldCount = rowType.getFieldCount(); // If they are asking for no fields, we can't give them what they want, // because zero-column records are illegal. Give them the last field, // which is unlikely to be a system field. if (fieldsUsed.isEmpty()) { fieldsUsed = ImmutableBitSet.range(fieldCount - 1, fieldCount); }
Attachments
Issue Links
- Blocked
-
IGNITE-14541 Calcite engine. HAVING fails on scalar
- Open
- is related to
-
CALCITE-4597 Allow RelNodes to have an empty row type (zero fields)
- Open