[ https://issues.apache.org/jira/browse/CALCITE-1431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15576010#comment-15576010 ]
Maryann Xue commented on CALCITE-1431: -------------------------------------- This is what I tried but didn't work: {code} return createStructType(type.getStructKind(), ignoreNullable ? new AbstractList<RelDataType>() { @Override public RelDataType get(int index) { RelDataType fieldType = type.getFieldList().get(index).getType(); return copyType(fieldType); } @Override public int size() { return type.getFieldCount(); } } : RelOptUtil.getFieldTypeList(type), type.getFieldNames()); } {code} The "ignoreNullable == true" logic kept the same, as "copyType()", while the "ignoreNullable == false" logic changed from "createTypeWithNullability()" to "RelOptUtil.getFieldTypeList(type)". So I assume the original logic was to apply the nullability of the record type to its field types, instead of using the original nullability of the field types themselves. > RelDataTypeFactoryImpl.copyType() did not copy StructKind > --------------------------------------------------------- > > Key: CALCITE-1431 > URL: https://issues.apache.org/jira/browse/CALCITE-1431 > Project: Calcite > Issue Type: Bug > Components: core > Reporter: Maryann Xue > Assignee: Maryann Xue > Priority: Minor > Labels: phoenix > Fix For: 1.11.0 > > > Now that StructKind has been introduced as an attribute of RelDataType by > CALCITE-1208, when copying a RecordType, we should also copy its StructKind. > This would be an issue in view expansion, in which columns could not be > resolved from a view the same way as they would from its original table. -- This message was sent by Atlassian JIRA (v6.3.4#6332)