clintropolis commented on a change in pull request #6974: sql support for
dynamic parameters
URL: https://github.com/apache/druid/pull/6974#discussion_r380423301
##########
File path: sql/src/main/java/org/apache/druid/sql/calcite/planner/Calcites.java
##########
@@ -397,4 +402,44 @@ public static int collapseFetch(int innerFetch, int
outerFetch, int outerOffset)
}
return fetch;
}
+
+ public static Class<?> sqlTypeNameJdbcToJavaClass(SqlTypeName typeName)
+ {
+ JDBCType jdbcType = JDBCType.valueOf(typeName.getJdbcOrdinal());
+ switch (jdbcType) {
+ case CHAR:
+ case VARCHAR:
+ case LONGVARCHAR:
+ return String.class;
+ case NUMERIC:
+ case DECIMAL:
+ return BigDecimal.class;
+ case BIT:
+ return Boolean.class;
+ case TINYINT:
+ return Byte.class;
+ case SMALLINT:
+ return Short.class;
+ case INTEGER:
+ return Integer.class;
+ case BIGINT:
+ return Long.class;
+ case REAL:
+ return Float.class;
+ case FLOAT:
Review comment:
Added link to docs I used as reference for mappings from JDBC to Java types
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]