walterddr commented on code in PR #10336:
URL: https://github.com/apache/pinot/pull/10336#discussion_r1131945053


##########
pinot-common/src/main/java/org/apache/pinot/common/utils/request/RequestUtils.java:
##########
@@ -48,6 +48,14 @@ public class RequestUtils {
   private RequestUtils() {
   }
 
+  public static SqlNodeAndOptions parseQuery(String query)
+          throws SqlCompilationException {
+    long parserStartTimeNs = System.nanoTime();
+    SqlNodeAndOptions sqlNodeAndOptions = 
CalciteSqlParser.compileToSqlNodeAndOptions(query);
+    sqlNodeAndOptions.setParseTimeNs(System.nanoTime() - parserStartTimeNs);
+    return sqlNodeAndOptions;
+  }

Review Comment:
   use a `private static final JsonNode EMPTY_OBJECT_NODE = new 
ObjectMapper().createObjectNode();
   ```suggestion
       return parserQuery(query, EMPTY_OBJECT_NODE);
     }
   ```



##########
pinot-common/src/main/java/org/apache/pinot/common/utils/request/RequestUtils.java:
##########
@@ -48,6 +48,14 @@ public class RequestUtils {
   private RequestUtils() {
   }
 
+  public static SqlNodeAndOptions parseQuery(String query)
+          throws SqlCompilationException {
+    long parserStartTimeNs = System.nanoTime();
+    SqlNodeAndOptions sqlNodeAndOptions = 
CalciteSqlParser.compileToSqlNodeAndOptions(query);
+    sqlNodeAndOptions.setParseTimeNs(System.nanoTime() - parserStartTimeNs);
+    return sqlNodeAndOptions;
+  }

Review Comment:
   use a `private static final JsonNode EMPTY_OBJECT_NODE = new 
ObjectMapper().createObjectNode();`
   ```suggestion
       return parserQuery(query, EMPTY_OBJECT_NODE);
     }
   ```



-- 
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-unsubscr...@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to