This is an automated email from the ASF dual-hosted git repository. geniuspig pushed a commit to branch support_bracket in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
commit 851fd517d72d57befa3c98ca73f551628c46b085 Author: zhutianci <[email protected]> AuthorDate: Wed May 27 13:05:18 2020 +0800 support bracket --- .../antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4 | 19 ++++++++++++++----- .../org/apache/iotdb/db/qp/plan/PhysicalPlanTest.java | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/server/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4 b/server/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4 index 025f19b..dca474c 100644 --- a/server/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4 +++ b/server/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4 @@ -347,7 +347,12 @@ nodeName | DURATION | encoding | dataType - | constant + | dateExpression + | MINUS? EXPONENT + | MINUS? INT + | booleanClause + | FILE + | (ID | OPERATOR_IN)? LS_BRACKET ID? RS_BRACKET ID? ; nodeNameWithoutStar @@ -356,7 +361,12 @@ nodeNameWithoutStar | DURATION | encoding | dataType - | constant + | dateExpression + | MINUS? EXPONENT + | MINUS? INT + | booleanClause + | FILE + | (ID | OPERATOR_IN)? LS_BRACKET ID? RS_BRACKET ID? ; dataType @@ -373,8 +383,7 @@ constant | MINUS? realLiteral | MINUS? INT | STRING_LITERAL - | TRUE - | FALSE + | booleanClause ; booleanClause @@ -1083,7 +1092,7 @@ fragment Z ; fragment PATH_FRAGMENT - : ('a'..'z'|'A'..'Z'|'0'..'9'|'_'|'-'|'.')* + : ('a'..'z'|'A'..'Z'|'0'..'9'|'_'|'-')* ; WS diff --git a/server/src/test/java/org/apache/iotdb/db/qp/plan/PhysicalPlanTest.java b/server/src/test/java/org/apache/iotdb/db/qp/plan/PhysicalPlanTest.java index e150032..dba51d3 100644 --- a/server/src/test/java/org/apache/iotdb/db/qp/plan/PhysicalPlanTest.java +++ b/server/src/test/java/org/apache/iotdb/db/qp/plan/PhysicalPlanTest.java @@ -818,7 +818,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 with datatype=FLOAT, encoding=RLE, compression=SNAPPY tags(tag1=v1, tag2=v2) attributes(attr1=v1, attr2=v2)"; + String sqlStr1 = "create timeseries root.3e-3.-1.1/2.SNAPPY.RLE.81+12.+2.s/io.in[jack] with datatype=FLOAT, encoding=RLE, compression=SNAPPY tags(tag1=v1, tag2=v2) attributes(attr1=v1, attr2=v2)"; PhysicalPlan plan1 = processor.parseSQLToPhysicalPlan(sqlStr1); Assert.assertEquals(OperatorType.CREATE_TIMESERIES, plan1.getOperatorType()); }
