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


##########
sql/src/main/java/org/apache/druid/sql/calcite/planner/SqlParameterizerShuttle.java:
##########
@@ -129,13 +129,12 @@ private SqlNode createArrayLiteral(Object value, int posn)
     List<SqlNode> args = new ArrayList<>(list.size());
     for (int i = 0, listSize = list.size(); i < listSize; i++) {
       Object element = list.get(i);
-      if (element == null) {
-        throw InvalidSqlInput.exception("parameter [%d] is an array, with an 
illegal null at index [%d]", posn + 1, i);
-      }
       SqlNode node;
-      if (element instanceof String) {
+      if (element == null) {
+        node = SqlLiteral.createNull(SqlParserPos.ZERO);
+      } else if (element instanceof String) {
         node = SqlLiteral.createCharString((String) element, 
SqlParserPos.ZERO);
-      } else if (element instanceof Integer || element instanceof Long) {
+      } else if (element instanceof Integer || element instanceof Long || 
element instanceof Double) {

Review Comment:
   hmm, `createExactNumeric` doesn't really seem appropriate for `Double`, 
shouldn't that be handled with a separate else case, something like
   ```
   ...
         } else if (element instanceof Float || element instanceof Double) {
           node = SqlLiteral.createApproxNumeric(element.toString(), 
SqlParserPos.ZERO);
         }
   ...
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to