-
Notifications
You must be signed in to change notification settings - Fork 94
Closed
Description
When a nullable field type is defined in the schema of a virtualTableScan, the fields are enforced to also be nullable. Calcite's logicalValues does not enforce this match of the schema and actual field implementation. The following failing test case exposes this bug.
@Test
void lostNullabilityInVirtualTableOnRoundTrip() {
NamedStruct schema = NamedStruct.of(List.of("col1", "col2"), R.struct(N.I32, R.FP64));
Expression nullableI32 = Expression.I32Literal.builder().value(6).nullable(true).build();
VirtualTableScan virtualTableScan = createVirtualTableScan(schema, List.of(nullableI32, sb.fp64(8)));
assertFullRoundTrip(virtualTableScan);
}A workaround should either be implemented in substrait-java(potentially loosening the schema matching), or a fix in Calcite should be implemented(logicalValues should update the field list type definition when making its fields non-null).
Metadata
Metadata
Assignees
Labels
No labels