Wiki
Clone wikilogquery / Syntax
Query Syntax
selectStatement => <simpleQueryStatement>
[ORDER BY (<column_name> | <expresion> | <position>) [ASC | DESC],...)]
[LIMIT [offset, ] rowcount]
simpleQueryStatement => <simpleSelectStatement> | unionStatement
simpleSelectStatment => SELECT <select_expression>[, <select_expression> ...]
FROM <tableSource>
[WHERE <where_condition>]
[GROUP BY <expresion>[, <expression> ...]
[HAVING <where_condition>]
[PIVOT <dataExpression> ON <columnHeaderExpression>
[(BEFORE | AFTER) (position | coloumn_name)]
unionStatement => <queryStatement> [UNION <queryStatement>]
queryStatement => '(' <selectStatement> ')' | <simpleSelectStatement>
tableSource => <subTableSource> [joinClause ...]
subTableSource => <dataSource>
TRANSFORM '('<expression> AS <identifier>,...')'
dataSource => <fileDataSource> | <customDataSource> | '(' <selectStatement> ')'
fileDataSource => <string_literal> [USING <identifier>'('fieldName=<expression>, ...')']
customDataSource => <identifier>'('fieldName=<expression>, ... ')'
select_expression => (<wildcard> | <columnName> | <expression>) [AS <identifier>]
wildcard => [<identifier>'.'] *
columnName => [<identifier>'.'] <identifier>
identifier => (Letter | '_' | '#') (Letter | Digit | '_')*
'[' (~']')* ']' (']' (~']')* ']')* // [some text]
'"' (~'"')* '"' ('"' (~'"')* '"')* // " some text "
<expression>
Expressions are a combination of column names, function calls and operators
Operators: + | - | * | / | %
<table_source>
Table source can be specified as either a file name, which will then use the TEXTLINE data source, or as one of the other supported data sources
File datasource
SELECT * FROM 'file.txt'
SELECT * FROM 'file.txt' USING TEXTLINE
SELECT * FROM 'file.txt' USING CSV(heading=true)
Custom datasource
SELECT * FROM <data_source_name> [(<property>=<expression>[, <property>=<expression> ...])]
SELECT * FROM TEXTLINE(fileName='file.txt')
Updated