Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
JackieTien97 committed Jun 17, 2024
1 parent dd232f5 commit 213457c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -751,16 +751,15 @@ private TimeRange getTimeRange(
}

private long parseTimeValue(RelationalSqlParser.TimeValueContext ctx, long currentTime) {
if (ctx.DECIMAL_INTEGER_LITERAL() != null) {
if (ctx.INTEGER_VALUE() != null) {
try {
if (ctx.MINUS() != null) {
return -Long.parseLong(ctx.DECIMAL_INTEGER_LITERAL().getText());
return -Long.parseLong(ctx.INTEGER_VALUE().getText());
}
return Long.parseLong(ctx.DECIMAL_INTEGER_LITERAL().getText());
return Long.parseLong(ctx.INTEGER_VALUE().getText());
} catch (NumberFormatException e) {
throw new SemanticException(
String.format(
"Can not parse %s to long value", ctx.DECIMAL_INTEGER_LITERAL().getText()));
String.format("Can not parse %s to long value", ctx.INTEGER_VALUE().getText()));
}
} else {
return parseDateExpression(ctx.dateExpression(), currentTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ propertyValue
queryNoWith
: queryTerm
(ORDER BY sortItem (',' sortItem)*)?
(FILL '(' (LINEAR | PREVIOUS | literalExpression) (',' duration=timeduration)? ')')?
(FILL '(' (LINEAR | PREVIOUS | literalExpression) (',' duration=timeDuration)? ')')?
(OFFSET offset=rowCount)?
(LIMIT limit=limitRowCount)?
;
Expand Down Expand Up @@ -419,11 +419,11 @@ groupBy
;

groupingElement
: TIME '(' (timeRange ',')? windowInterval=timeduration (',' windowStep=timeduration)?')' #timenGrouping
: TIME '(' (timeRange ',')? windowInterval=timeDuration (',' windowStep=timeDuration)?')' #timenGrouping
| VARIATION '(' expression (',' delta=number)? (',' propertyAssignments)? ')' #variationGrouping
| CONDITION '(' expression (',' keepExpression)? (',' propertyAssignments)? ')' #conditionGrouping
| SESSION '(' timeInterval=timeduration ')' #sessionGrouping
| COUNT '(' expression ',' countNumber=DECIMAL_INTEGER_LITERAL (',' propertyAssignments)? ')' #countGrouping
| SESSION '(' timeInterval=timeDuration ')' #sessionGrouping
| COUNT '(' expression ',' countNumber=INTEGER_VALUE (',' propertyAssignments)? ')' #countGrouping
| groupingSet #singleGroupingSet
// the following three haven't been supported yet
| ROLLUP '(' (groupingSet (',' groupingSet)*)? ')' #rollup
Expand All @@ -438,11 +438,11 @@ timeRange

timeValue
: dateExpression
| (PLUS | MINUS)? DECIMAL_INTEGER_LITERAL
| (PLUS | MINUS)? INTEGER_VALUE
;

dateExpression
: datetimeLiteral ((PLUS | MINUS) timeduration)*
: datetimeLiteral ((PLUS | MINUS) timeDuration)*
;

datetimeLiteral
Expand All @@ -451,7 +451,7 @@ datetimeLiteral
;

keepExpression
: (KEEP (EQ | LT | LTE | GT | GTE))? DECIMAL_INTEGER_LITERAL
: (KEEP (EQ | LT | LTE | GT | GTE))? INTEGER_VALUE
;

groupingSet
Expand Down Expand Up @@ -610,12 +610,8 @@ intervalField
: YEAR | MONTH | WEEK | DAY | HOUR | MINUTE | SECOND | MILLISECOND | MICROSECOND | NANOSECOND
;

timeduration
: (DECIMAL_INTEGER_LITERAL intervalField)+
;

DECIMAL_INTEGER_LITERAL
: DECIMAL_INTEGER
timeDuration
: (INTEGER_VALUE intervalField)+
;

type
Expand Down Expand Up @@ -1207,31 +1203,4 @@ WS
// when splitting statements with DelimiterLexer
UNRECOGNIZED
: .
;

fragment A: [a];
fragment B: [b];
fragment C: [c];
fragment D: [d];
fragment E: [e];
fragment F: [f];
fragment G: [g];
fragment H: [h];
fragment I: [i];
fragment J: [j];
fragment K: [k];
fragment L: [l];
fragment M: [m];
fragment N: [n];
fragment O: [o];
fragment P: [p];
fragment Q: [q];
fragment R: [r];
fragment S: [s];
fragment T: [t];
fragment U: [u];
fragment V: [v];
fragment W: [w];
fragment X: [x];
fragment Y: [y];
fragment Z: [z];
;

0 comments on commit 213457c

Please sign in to comment.