Skip to content

Commit

Permalink
Merge branch 'geoip' of https://github.com/Bit-Quill/opensearch-spark
Browse files Browse the repository at this point in the history
…into geoip

Signed-off-by: Kenrick Yap <[email protected]>

# Conflicts:
#	ppl-spark-integration/src/main/antlr4/OpenSearchPPLParser.g4
  • Loading branch information
14yapkc1 committed Dec 11, 2024
2 parents dfaeb91 + ddffae8 commit 11a316c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions ppl-spark-integration/src/main/antlr4/OpenSearchPPLParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ commands
| fillnullCommand
| fieldsummaryCommand
| flattenCommand
| expandCommand
| trendlineCommand
;

commandName
Expand Down Expand Up @@ -83,9 +85,11 @@ commandName
| PATTERNS
| LOOKUP
| RENAME
| EXPAND
| FILLNULL
| FIELDSUMMARY
| FLATTEN
| TRENDLINE
;

searchCommand
Expand Down Expand Up @@ -245,10 +249,26 @@ nullableReplacementExpression
: nullableField = fieldExpression EQUAL nullableReplacement = valueExpression
;

expandCommand
: EXPAND fieldExpression (AS alias = qualifiedName)?
;

flattenCommand
: FLATTEN fieldExpression (AS alias = identifierSeq)?
;

trendlineCommand
: TRENDLINE (SORT sortField)? trendlineClause (trendlineClause)*
;

trendlineClause
: trendlineType LT_PRTHS numberOfDataPoints = INTEGER_LITERAL COMMA field = fieldExpression RT_PRTHS (AS alias = qualifiedName)?
;

trendlineType
: SMA
| WMA
;

kmeansCommand
: KMEANS (kmeansParameter)*
Expand Down Expand Up @@ -416,6 +436,7 @@ logicalExpression
comparisonExpression
: left = valueExpression comparisonOperator right = valueExpression # compareExpr
| valueExpression NOT? IN valueList # inExpr
| expr1 = functionArg NOT? BETWEEN expr2 = functionArg AND expr3 = functionArg # between
;

valueExpressionList
Expand Down Expand Up @@ -452,6 +473,7 @@ booleanExpression
| isEmptyExpression # isEmptyExpr
| valueExpressionList NOT? IN LT_SQR_PRTHS subSearch RT_SQR_PRTHS # inSubqueryExpr
| EXISTS LT_SQR_PRTHS subSearch RT_SQR_PRTHS # existsSubqueryExpr
| cidrMatchFunctionCall # cidrFunctionCallExpr
;

isEmptyExpression
Expand Down Expand Up @@ -531,6 +553,10 @@ booleanFunctionCall
: conditionFunctionBase LT_PRTHS functionArgs RT_PRTHS
;

cidrMatchFunctionCall
: CIDRMATCH LT_PRTHS ipAddress = functionArg COMMA cidrBlock = functionArg RT_PRTHS
;

convertedDataType
: typeName = DATE
| typeName = TIME
Expand Down Expand Up @@ -1162,4 +1188,7 @@ keywordsCanBeId
| SEMI
| ANTI
| GEOIP
| BETWEEN
| CIDRMATCH
| trendlineType
;

0 comments on commit 11a316c

Please sign in to comment.