zabetak commented on a change in pull request #1104: [CALCITE-2900] 
RewriteRexShuttle generates wrong type during flatten for structured type when 
visitInputRef
URL: https://github.com/apache/calcite/pull/1104#discussion_r268437059
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/test/catalog/Fixture.java
 ##########
 @@ -109,16 +109,23 @@
             .build();
     empListType =
         typeFactory.createArrayType(empRecordType, -1);
+
+    // Subclass ObjectSqlType to make nested field queryable.
     addressType =
-        new ObjectSqlType(SqlTypeName.STRUCTURED,
+        new ObjectSqlType(
+            SqlTypeName.STRUCTURED,
             new SqlIdentifier("ADDRESS", SqlParserPos.ZERO),
             false,
             Arrays.asList(
                 new RelDataTypeFieldImpl("STREET", 0, varchar20Type),
                 new RelDataTypeFieldImpl("CITY", 1, varchar20Type),
                 new RelDataTypeFieldImpl("ZIP", 2, intType),
                 new RelDataTypeFieldImpl("STATE", 3, varchar20Type)),
-            RelDataTypeComparability.NONE);
+            RelDataTypeComparability.NONE) {
+          @Override public StructKind getStructKind() {
+            return StructKind.PEEK_FIELDS_DEFAULT;
 
 Review comment:
   I guess before it was StructKind.FULLY_QUALIFIED, wasn't this enough to 
demonstrate the problem?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to