You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/10/19 04:31:17 UTC

[GitHub] [calcite] jinxing64 commented on a change in pull request #1519: [CALCITE-3424] AssertionError thrown for user-defined table function with array argument

jinxing64 commented on a change in pull request #1519: [CALCITE-3424] AssertionError thrown for user-defined table function with array argument
URL: https://github.com/apache/calcite/pull/1519#discussion_r336721779
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/jdbc/JavaTypeFactoryImpl.java
 ##########
 @@ -251,9 +251,16 @@ public static RelDataType toSql(final RelDataTypeFactory typeFactory,
               type.getFieldNames()),
           type.isNullable());
     } else if (type instanceof JavaType) {
-      return typeFactory.createTypeWithNullability(
-          typeFactory.createSqlType(type.getSqlTypeName()),
-          type.isNullable());
+      SqlTypeName sqlTypeName = type.getSqlTypeName();
+      final RelDataType relDataType;
+      if (sqlTypeName == SqlTypeName.ARRAY) {
+        RelDataType elementType = type.getComponentType() == null
+            ? typeFactory.createSqlType(SqlTypeName.ANY) : type.getComponentType();
 
 Review comment:
   Does it need special consideration when it's a nested array, i.e. the element type of array is also of array

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services