[ 
https://issues.apache.org/jira/browse/CALCITE-1431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15576479#comment-15576479
 ] 

Julian Hyde commented on CALCITE-1431:
--------------------------------------

My mistake, you have to copy. Try this:

{code}
    return createStructType(type.getStructKind(),
        new AbstractList<RelDataType>() {
          @Override public RelDataType get(int index) {
            RelDataType fieldType =
                type.getFieldList().get(index).getType();
            if (ignoreNullable) {
              return copyType(fieldType);
            } else {
              return createTypeWithNullability(fieldType, nullable);
            }
          }

          @Override public int size() {
            return type.getFieldCount();
          }
        },
        type.getFieldNames());
  }
{code}

> 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)

Reply via email to