You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2021/01/15 06:00:43 UTC

[iotdb] branch master updated: support only left bracket (#2491)

This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 3c52267  support only left bracket (#2491)
3c52267 is described below

commit 3c52267a7b18b57a4c889e1f1264334fe5bb786e
Author: Boris <ge...@apache.org>
AuthorDate: Fri Jan 15 14:00:29 2021 +0800

    support only left bracket (#2491)
---
 antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlBase.g4 | 13 +++++--------
 .../org/apache/iotdb/db/qp/physical/PhysicalPlanTest.java   |  2 +-
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlBase.g4 b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlBase.g4
index aa5e874..c902a67 100644
--- a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlBase.g4
+++ b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlBase.g4
@@ -418,16 +418,14 @@ suffixPath
     ;
 
 nodeName
-    : ID
+    : ID STAR?
     | STAR
     | DOUBLE_QUOTE_STRING_LITERAL
-    | ID STAR
     | DURATION
     | encoding
     | dataType
     | dateExpression
-    | MINUS? EXPONENT
-    | MINUS? INT
+    | MINUS? (EXPONENT | INT)
     | booleanClause
     | CREATE
     | INSERT
@@ -523,7 +521,7 @@ nodeName
     | SCHEMA
     | TRACING
     | OFF
-    | (ID | OPERATOR_IN)? LS_BRACKET ID? RS_BRACKET ID?
+    | (ID | OPERATOR_IN)? LS_BRACKET ID? RS_BRACKET? ID?
     | compressor
     | GLOBAL
     | PARTITION
@@ -538,8 +536,7 @@ nodeNameWithoutStar
     | encoding
     | dataType
     | dateExpression
-    | MINUS? EXPONENT
-    | MINUS? INT
+    | MINUS? ( EXPONENT | INT)
     | booleanClause
     | CREATE
     | INSERT
@@ -635,7 +632,7 @@ nodeNameWithoutStar
     | SCHEMA
     | TRACING
     | OFF
-    | (ID | OPERATOR_IN)? LS_BRACKET ID? RS_BRACKET ID?
+    | (ID | OPERATOR_IN)? LS_BRACKET ID? RS_BRACKET? ID?
     | compressor
     | GLOBAL
     | PARTITION
diff --git a/server/src/test/java/org/apache/iotdb/db/qp/physical/PhysicalPlanTest.java b/server/src/test/java/org/apache/iotdb/db/qp/physical/PhysicalPlanTest.java
index 4dd9297..3e17d00 100644
--- a/server/src/test/java/org/apache/iotdb/db/qp/physical/PhysicalPlanTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/qp/physical/PhysicalPlanTest.java
@@ -1041,7 +1041,7 @@ public class PhysicalPlanTest {
 
   @Test
   public void testSpecialCharacters() throws QueryProcessException {
-    String sqlStr1 = "create timeseries root.3e-3.-1.1/2.SNAPPY.RLE.81+12.+2.s/io.in[jack].desc with "
+    String sqlStr1 = "create timeseries root.3e-3.-1.1/2.SNAPPY.RLE.81+12.+2.s/io.in[jack].hel[jjj.desc with "
         + "datatype=FLOAT, encoding=RLE, compression=SNAPPY tags(tag1=v1, tag2=v2)"
         + " attributes(attr1=v1, attr2=v2)";
     PhysicalPlan plan1 = processor.parseSQLToPhysicalPlan(sqlStr1);