-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
P1 Antlr grammar #859
P1 Antlr grammar #859
Changes from 4 commits
ff222c9
281c641
596c069
4439f06
b71a9ed
950009b
faae818
bdb4848
8f3405b
c2acd9b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,9 @@ commands | |
| renameCommand | ||
| fillnullCommand | ||
| fieldsummaryCommand | ||
| flattenCommand | ||
| expandCommand | ||
| trendlineCommand | ||
; | ||
|
||
commandName | ||
|
@@ -80,16 +83,20 @@ commandName | |
| PATTERNS | ||
| LOOKUP | ||
| RENAME | ||
| FLATTEN | ||
| EXPAND | ||
| FILLNULL | ||
| FIELDSUMMARY | ||
| TRENDLINE | ||
| GEOIP | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
; | ||
|
||
searchCommand | ||
: (SEARCH)? fromClause # searchFrom | ||
| (SEARCH)? fromClause logicalExpression # searchFromFilter | ||
| (SEARCH)? logicalExpression fromClause # searchFilterFrom | ||
; | ||
|
||
fieldsummaryCommand | ||
: FIELDSUMMARY (fieldsummaryParameter)* | ||
; | ||
|
@@ -246,6 +253,26 @@ fillnullCommand | |
: expression | ||
; | ||
|
||
flattenCommand | ||
: FLATTEN fieldExpression | ||
; | ||
Comment on lines
+256
to
+257
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: is the indent level correct? (save for below) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes it is the same with the following There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are no right or wrong about 3 spaces or 4 spaces as indent level. All indent level should be same. |
||
|
||
expandCommand | ||
: EXPAND fieldExpression | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
; | ||
|
||
trendlineCommand | ||
: TRENDLINE (SORT sortField)? trendlineClause (trendlineClause)* | ||
; | ||
|
||
trendlineClause | ||
: trendlineType LT_PRTHS numberOfDataPoints = integerLiteral COMMA field = fieldExpression RT_PRTHS AS alias = fieldExpression | ||
; | ||
|
||
trendlineType | ||
: SMA | ||
| WMA | ||
; | ||
|
||
kmeansCommand | ||
: KMEANS (kmeansParameter)* | ||
|
@@ -430,6 +457,7 @@ primaryExpression | |
: evalFunctionCall | ||
| fieldExpression | ||
| literalValue | ||
| geoipFunctionCall | ||
; | ||
|
||
positionFunction | ||
|
@@ -516,6 +544,11 @@ dataTypeFunctionCall | |
: CAST LT_PRTHS expression AS convertedDataType RT_PRTHS | ||
; | ||
|
||
// geoip function | ||
geoipFunctionCall | ||
: GEOIP LT_PRTHS (datasource = functionArg COMMA)? ipAddress = functionArg (COMMA properties = stringLiteral)? RT_PRTHS | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am thinking why not reusing |
||
; | ||
|
||
// boolean functions | ||
booleanFunctionCall | ||
: conditionFunctionBase LT_PRTHS functionArgs RT_PRTHS | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: Loction -> Location