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

Vladimir Sitnikov edited comment on CALCITE-4217 at 9/2/20, 7:57 PM:
---------------------------------------------------------------------

{quote}People who are trying to treat a cross type as a struct need to know 
that they are doing the wrong thing.{quote}

Just to double-check, my current proposal is:
1) Leave RelCrossType#isStruct as is: return false
2) Replace {{assert isStruct}} in {{RelDataTypeImpl#getFieldList}} and 
{{RelDataTypeImpl#getFieldCount}} with {{assert fieldList != null : "fieldList 
is null for " + this}}

That would make getFieldCount work for CrossType, and CrossType.isStruct() 
would still be {{false}}

WDYT?


was (Author: vladimirsitnikov):
{quote}People who are trying to treat a cross type as a struct need to know 
that they are doing the wrong thing.{quote}

Just to double-check, my current proposal is:
1) Leave RelCrossType#isStruct as is: return false
2) Replace {{assert isStruct}} in {{RelDataTypeImpl#getFieldList}} and 
{{RelDataTypeImpl#getFieldCount}} with {{assert fieldList != null : "fieldList 
is null for " + this}}

That would make getFieldCount and getFieldList work for CrossType, and 
CrossType.isStruct() would still be {{false}}

WDYT?

> RelCrossType#isStruct should be true rather than false
> ------------------------------------------------------
>
>                 Key: CALCITE-4217
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4217
>             Project: Calcite
>          Issue Type: Sub-task
>          Components: core
>    Affects Versions: 1.25.0
>            Reporter: Vladimir Sitnikov
>            Priority: Major
>
> Currently RelCrossType#isStruct returns false even though the default 
> implementation in {{org.apache.calcite.rel.type.RelDataTypeImpl#isStruct}} is 
> {{return fieldList != null}}
> That results in {{getFieldList}} throwing assertion error (because it asserts 
> {{isStruct}}), however RelCrossType#getFieldNames works OK because it asserts 
> {{fieldList != null}}
> I think it should be OK if we remove {{isStruct() { return false; } }} 
> override and use {{isStruct}} assertion in both {{getFieldList}} and 
> {{getFieldNames}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to