cryptoe commented on code in PR #16971:
URL: https://github.com/apache/druid/pull/16971#discussion_r1740463838


##########
sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java:
##########
@@ -325,16 +326,20 @@ private static List<Object[]> parseResults(RowSignature 
rs, List<String[]> resul
         } else {
           switch (type.getType()) {
             case STRING:

Review Comment:
   the else part should call parseElement function with 
   `parseElement(val, type)`
   
   ParseElement would look like 
   ```java
   {
   switch (elementType) {
         case STRING:
           return element;
         case LONG:
           return parseLongValue(element);
         case DOUBLE:
           return Numbers.parseDoubleObject(element);
          case Array:                 
                 String[] elements = val.substring(1, val.length() - 
1).split(","); // might need to adjust this.
                 List<String> arrayElements = new ArrayList<>();
                 for (String element : elements) {
                   arrayElements.add(parseElement(element.trim(), 
type.getElementType().getType()).toString());
                 }
               return "[" + String.join(",", arrayElements) + "]";
               default:
                 throw new RuntimeException("unimplemented type: " + 
type.getType());
   }
   ```
   Then you can also handle nested arrays also if that is possible no ?
   



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