Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ keyWords
| PIPESINKTYPE
| PIPEPLUGIN
| PIPEPLUGINS
| POINT
| POINTS
| POLICY
| PREVIOUS
| PREVIOUSUNTILLAST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ ddlStatement
| createLogicalView | dropLogicalView | showLogicalView | renameLogicalView | alterLogicalView
// Table View
| createTableView
// for calculation point
| createCalcPoint | alterCalcPoint | dropCalcPoint | showCalcPoint
;

dmlStatement
Expand Down Expand Up @@ -854,6 +856,30 @@ createTableView
AS prefixPath
;

createCalcPoint
: CREATE CALCULATION POINT fullPath
AS expression
STRING_LITERAL
comment?
;

alterCalcPoint
: ALTER CALCULATION POINT fullPath
(AS expression)?
(STRING_LITERAL)?
comment?
(DROP COMMENT)?
;

dropCalcPoint
: DROP CALCULATION POINTS prefixPath
;

showCalcPoint
: SHOW CALCULATION POINTS prefixPath
rowPaginationClause?
;

viewColumnDefinition
: identifier columnCategory=(TAG | TIME | FIELD) comment?
| identifier type (columnCategory=(TAG | TIME | FIELD))? comment?
Expand Down Expand Up @@ -1478,6 +1504,7 @@ expression
| leftExpression=expression operator_or rightExpression=expression
;


caseWhenThenExpression
: CASE caseExpression=expression? whenThenExpression+ (ELSE elseExpression=expression)? END
;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ CACHE
: C A C H E
;

CALCULATION
: C A L C U L A T I O N
;

CALL
: C A L L
;
Expand Down Expand Up @@ -663,6 +667,14 @@ PIPEPLUGINS
: P I P E P L U G I N S
;

POINT
: P O I N T
;

POINTS
: P O I N T S
;

POLICY
: P O L I C Y
;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ public class ASTVisitor extends IoTDBSqlParserBaseVisitor<Statement> {
public static final String INCORRECT_DATA_TYPE_MSG = "Incorrect Data type";
private ZoneId zoneId;

public boolean isUseWildcard() {
return useWildcard;
}

private boolean useWildcard = false;

private boolean lastLevelUseWildcard = false;
Expand Down Expand Up @@ -2365,7 +2369,7 @@ private void parseLoadFileAttributeClause(
/** Common Parsers. */

// IoTDB Objects ========================================================================
private MeasurementPath parseFullPath(IoTDBSqlParser.FullPathContext ctx) {
protected MeasurementPath parseFullPath(IoTDBSqlParser.FullPathContext ctx) {
List<IoTDBSqlParser.NodeNameWithoutWildcardContext> nodeNamesWithoutStar =
ctx.nodeNameWithoutWildcard();
String[] path = new String[nodeNamesWithoutStar.size() + 1];
Expand Down Expand Up @@ -2396,7 +2400,7 @@ private PartialPath parseAlignedDevice(IoTDBSqlParser.FullPathContext ctx) {
return new PartialPath(path);
}

private PartialPath parseFullPathInExpression(
protected PartialPath parseFullPathInExpression(
IoTDBSqlParser.FullPathInExpressionContext ctx, boolean canUseFullPath) {
List<IoTDBSqlParser.NodeNameContext> nodeNames = ctx.nodeName();
int size = nodeNames.size();
Expand Down Expand Up @@ -2440,7 +2444,7 @@ private PartialPath parseFullPathInIntoPath(IoTDBSqlParser.FullPathInIntoPathCon
return new PartialPath(path);
}

private PartialPath parsePrefixPath(IoTDBSqlParser.PrefixPathContext ctx) {
protected PartialPath parsePrefixPath(IoTDBSqlParser.PrefixPathContext ctx) {
List<IoTDBSqlParser.NodeNameContext> nodeNames = ctx.nodeName();
String[] path = new String[nodeNames.size() + 1];
path[0] = ctx.ROOT().getText();
Expand Down Expand Up @@ -3530,7 +3534,7 @@ private String parseConstant(ConstantContext constantContext) {
}
}

private Expression parseConstantOperand(ConstantContext constantContext) {
protected Expression parseConstantOperand(ConstantContext constantContext) {
String text = constantContext.getText();
if (constantContext.boolean_literal() != null) {
return new ConstantOperand(TSDataType.BOOLEAN, text);
Expand Down
Loading