my7ym commented on a change in pull request #1104: [CALCITE-2900]
RelStructuredTypeFlattener generates wrong types on nested columns
URL: https://github.com/apache/calcite/pull/1104#discussion_r268478118
##########
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:
Sorry that it was not enough to do that. It will make the nested column
unrecognizable by part of the flow. In my personal project I used
PEEK_FIELDS_DEFAULT, so I stick to it here.
----------------------------------------------------------------
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