You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "clintropolis (via GitHub)" <gi...@apache.org> on 2023/03/22 23:19:44 UTC

[GitHub] [druid] clintropolis commented on a diff in pull request #13958: Added TYPE(native) data type for external tables

clintropolis commented on code in PR #13958:
URL: https://github.com/apache/druid/pull/13958#discussion_r1145496668


##########
sql/src/main/codegen/config.fmpp:
##########
@@ -68,6 +69,7 @@ data: {
       "CLUSTERED"
       "OVERWRITE"
       "PARTITIONED"
+      "VARIANT"

Review Comment:
   this seems stale



##########
sql/src/main/codegen/includes/common.ftl:
##########
@@ -92,3 +92,18 @@ SqlNodeList ClusterItems() :
     return new SqlNodeList(list, s.addAll(list).pos());
   }
 }
+
+SqlTypeNameSpec VariantType() :

Review Comment:
   nit: maybe rename something like `DruidTypePassthrough`?



##########
sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidTypeSystem.java:
##########
@@ -35,6 +35,8 @@ public class DruidTypeSystem implements RelDataTypeSystem
    */
   public static final int DEFAULT_TIMESTAMP_PRECISION = 3;
 
+  public static final String VARIANT_TYPE_NAME = "VARIANT";

Review Comment:
   nit: stale



##########
sql/src/main/java/org/apache/druid/sql/calcite/external/Externals.java:
##########
@@ -242,7 +242,11 @@ private static String convertType(String name, SqlDataTypeSpec dataType)
     if (typeName == null || !typeName.isSimple()) {
       throw unsupportedType(name, dataType);
     }
-    SqlTypeName type = SqlTypeName.get(typeName.getSimple());
+    String simpleName = typeName.getSimple();
+    if (StringUtils.toLowerCase(simpleName).startsWith(("complex<"))) {
+      return simpleName;
+    }
+    SqlTypeName type = SqlTypeName.get(simpleName);

Review Comment:
   nit: i know this isn't new, but these variable names are kinda confusing which initially had me wondering why we were looking up the type name of the type name 😅 but see now that `typeName` is an `SqlIdentifier` and `type` is an `SqlTypeName`.



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

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org