This is an automated email from the ASF dual-hosted git repository.
jiangtian pushed a commit to branch dev_TTL
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/dev_TTL by this push:
new c456dad update antlr files
c456dad is described below
commit c456dadf7eca683abcc26002bff97d3cad121ab4
Author: jt <[email protected]>
AuthorDate: Thu Sep 12 17:58:33 2019 +0800
update antlr files
---
.../antlr3/org/apache/iotdb/db/sql/parse/TSLexer.g | 2 ++
.../org/apache/iotdb/db/sql/parse/TSParser.g | 23 ++++++++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/server/src/main/antlr3/org/apache/iotdb/db/sql/parse/TSLexer.g
b/server/src/main/antlr3/org/apache/iotdb/db/sql/parse/TSLexer.g
index 1d65efa..cbfe520 100644
--- a/server/src/main/antlr3/org/apache/iotdb/db/sql/parse/TSLexer.g
+++ b/server/src/main/antlr3/org/apache/iotdb/db/sql/parse/TSLexer.g
@@ -77,6 +77,7 @@ KW_INDEX: 'INDEX';
KW_INTO: 'INTO';
KW_WITH: 'WITH';
KW_SET: 'SET';
+KW_UNSER: 'UNSET';
KW_DELETE: 'DELETE';
KW_UPDATE: 'UPDATE';
KW_VALUES: 'VALUES';
@@ -94,6 +95,7 @@ KW_USING: 'USING';
KW_LIST: 'LIST';
KW_OF: 'OF';
KW_ALL: 'ALL';
+KW_TTL: 'TTL';
KW_WATERMARK_EMBEDDING : 'WATERMARK_EMBEDDING';
diff --git a/server/src/main/antlr3/org/apache/iotdb/db/sql/parse/TSParser.g
b/server/src/main/antlr3/org/apache/iotdb/db/sql/parse/TSParser.g
index bca8cdd..9e7ce88 100644
--- a/server/src/main/antlr3/org/apache/iotdb/db/sql/parse/TSParser.g
+++ b/server/src/main/antlr3/org/apache/iotdb/db/sql/parse/TSParser.g
@@ -78,6 +78,7 @@ TOK_SLIMIT;
TOK_SOFFSET;
TOK_LIMIT;
TOK_FLOAT_COMB;
+TOK_TTL;
TOK_GRANT_WATERMARK_EMBEDDING;
TOK_REVOKE_WATERMARK_EMBEDDING;
@@ -96,6 +97,7 @@ TOK_COMPRESSOR;
TOK_CLAUSE;
TOK_TIMESERIES;
TOK_SET;
+TOK_UNSET;
TOK_ADD;
TOK_PROPERTY;
TOK_LABEL;
@@ -182,12 +184,14 @@ ArrayList<ParseError> errors = new
ArrayList<ParseError>();
xlateMap.put("KW_FUNCTION", "FUNCTION");
xlateMap.put("KW_WITH", "WITH");
xlateMap.put("KW_SET", "SET");
+ xlateMap.put("KW_UNSET", "UNSET");
xlateMap.put("KW_UPDATE", "UPDATE");
xlateMap.put("KW_VALUES", "VALUES");
xlateMap.put("KW_KEY", "KEY");
xlateMap.put("KW_ENABLE", "ENABLE");
xlateMap.put("KW_DISABLE", "DISABLE");
xlateMap.put("KW_ALL", "ALL");
+ xlateMap.put("KW_TTL", "TTL");
// Operators
xlateMap.put("DOT", ".");
@@ -362,6 +366,7 @@ execStatement
| indexStatement
| quitStatement
| listStatement
+ | ttlStatement
;
@@ -902,4 +907,22 @@ constant
: number
| StringLiteral
| dateFormat
+ ;
+
+ttlStatement
+ :
+ setTTLStatement
+ | unsetTTLStatement
+ ;
+
+setTTLStatement
+ :
+ KW_SET KW_TTL KW_TO path=prefixPath time=DATETIME
+ -> ^(TOK_TTL TOK_SET $path $time)
+ ;
+
+unsetTTLStatement
+ :
+ KW_UNSET KW_TTL KW_TO path=prefixPath
+ -> ^(TOK_TTL TOK_UNSET $path)
;
\ No newline at end of file