Jackie-Jiang commented on a change in pull request #4216: PQL -> SQL 
enhancement - phase 1 - new Pinot Query Struct
URL: https://github.com/apache/incubator-pinot/pull/4216#discussion_r290998454
 
 

 ##########
 File path: 
pinot-common/src/main/java/org/apache/pinot/pql/parsers/Pql2Compiler.java
 ##########
 @@ -103,6 +110,24 @@ public BrokerRequest compileToBrokerRequest(String 
expression)
 
       BrokerRequest brokerRequest = new BrokerRequest();
       rootNode.updateBrokerRequest(brokerRequest);
+      try {
+        PinotQuery pinotQuery = new PinotQuery();
+        rootNode.updatePinotQuery(pinotQuery);
+        boolean validateConverter = true;
+        if (validateConverter) {
+          PinotQuery2BrokerRequestConverter converter = new 
PinotQuery2BrokerRequestConverter();
+          BrokerRequest tempBrokerRequest = converter.convert(pinotQuery);
+          boolean result = validate(brokerRequest, tempBrokerRequest);
+          if (!result) {
+            LOGGER.warn("Pinot query to broker request conversion failed. 
PQL:{}", expression);
+          }
+        }
+        brokerRequest.setPinotQuery(pinotQuery);
+      } catch (Exception e) {
+        //non fatal for now.
+        LOGGER.warn("Non fatal: Failed to populate pinot query and broker 
request. PQL:{}",
 
 Review comment:
   Prefer logging error (validate is also logging error)

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to