Ring-k commented on a change in pull request #440: reconstruct antlrv3 grammar 
to improve performance
URL: https://github.com/apache/incubator-iotdb/pull/440#discussion_r334732471
 
 

 ##########
 File path: 
server/src/main/java/org/apache/iotdb/db/qp/strategy/LogicalGenerator.java
 ##########
 @@ -829,42 +819,56 @@ private long parseTimeUnit(AstNode node) throws 
LogicalOperatorException {
     return timeInterval;
   }
 
+//  private void print(AstNode node, AstNode parent, int level) {
+//    if(parent == null) System.out.println("["+level+++"]\t"+ "root\t" + 
node.getText());
+//    else System.out.println("["+level+++"]\t"+ parent.getText()+"\t" + 
node.getText());
+//    for(Object o : node.getChildren()){
+//      print((AstNode) o, node, level);
+//    }
+//  }
+
   private Pair<Path, String> parseLeafNode(AstNode node) throws 
LogicalOperatorException {
     if (node.getChildCount() != 2) {
       throw new LogicalOperatorException(
-          "error format in SQL statement, please check whether SQL statement 
is correct.");
+              "error format in SQL statement, please check whether SQL 
statement is correct.");
     }
     AstNode col = node.getChild(0);
-    if (col.getType() != TSParser.TOK_PATH) {
+    if (col.getType() != TqlParser.TOK_PATH) {
       throw new LogicalOperatorException(
-          "error format in SQL statement, please check whether SQL statement 
is correct.");
+              "error format in SQL statement, please check whether SQL 
statement is correct.");
     }
     Path seriesPath = parsePath(col);
     AstNode rightKey = node.getChild(1);
     String seriesValue;
-    if (rightKey.getType() == TSParser.TOK_PATH) {
-      seriesValue = parsePath(rightKey).getFullPath();
-    } else if (rightKey.getType() == TSParser.TOK_DATETIME) {
+    if(rightKey.getChild(0).getType() == TqlParser.TOK_DATETIME){
       if (!seriesPath.equals(SQLConstant.RESERVED_TIME)) {
         throw new LogicalOperatorException("Date can only be used to time");
       }
-      seriesValue = parseTokenTime(rightKey);
-    } else if (rightKey.getType() == TSParser.TOK_FLOAT_COMB) {
-      seriesValue = parseTokens(rightKey);
-    } else {
-      seriesValue = rightKey.getText();
+      seriesValue = parseTokenTime(rightKey.getChild(0));
+    }else{
+      seriesValue = cascadeChildrenText(rightKey);
     }
+//    if (rightKey.getType() == TqlParser.TOK_PATH) {
 
 Review comment:
   The useless codes are removed. Thanks!

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

Reply via email to