Create top level table schema.
Create top level table schema.
Create a StructType from a sequence of StructFields.
Create a StructType from a sequence of StructFields.
Create an expression from the given context.
Create an expression from the given context. This method just passes the context on to the visitor and only takes care of typing (We assume that the visitor returns an Expression here).
Create an alias (SubqueryAlias) for a sub-query.
Create an alias (SubqueryAlias) for a sub-query. This is practically the same as visitAliasedRelation and visitNamedExpression, ANTLR4 however requires us to use 3 different hooks. We could add alias names for output columns, for example:
SELECT col1, col2 FROM testData AS t(col1, col2)
Create an alias (SubqueryAlias) for a join relation.
Create an alias (SubqueryAlias) for a join relation. This is practically the same as visitAliasedQuery and visitNamedExpression, ANTLR4 however requires us to use 3 different hooks. We could add alias names for output columns, for example:
SELECT a, b, c, d FROM (src1 s1 INNER JOIN src2 s2 ON s1.id = s2.id) dst(a, b, c, d)
Create a binary arithmetic expression.
Create a binary arithmetic expression. The following arithmetic operators are supported: - Multiplication: '*' - Division: '/' - Hive Long Division: 'DIV' - Modulo: '%' - Addition: '+' - Subtraction: '-' - Binary AND: '&' - Binary XOR - Binary OR: '|'
Create a unary arithmetic expression.
Create a unary arithmetic expression. The following arithmetic operators are supported: - Plus: '+' - Minus: '-' - Bitwise Not: '~'
Create a BigDecimal Literal expression.
Create a BigDecimal Literal expression.
Create a Long Literal expression.
Create a Long Literal expression.
Create a Boolean literal expression.
Create a Boolean literal expression.
Create a Cast expression.
Create a Cast expression.
Override the default behavior for all visit methods.
Override the default behavior for all visit methods. This will only return a non-null result when the context has only one child. This is done because there is no generic method to combine the results of the context children. In all other cases null is returned.
Create a top level StructField from a column definition.
Create a top level StructField from a column definition.
Create a StructType from a number of column definitions.
Create a StructType from a number of column definitions.
Create an UnresolvedAttribute expression or a UnresolvedRegex if it is a regex
quoted in
Create an UnresolvedAttribute expression or a UnresolvedRegex if it is a regex
quoted in
Create a comparison expression.
Create a comparison expression. This compares two expressions. The following comparison operators are supported: - Equal: '=' or '==' - Null-safe Equal: '<=>' - Not Equal: '<>' or '!=' - Less than: '<' - Less then or Equal: '<=' - Greater than: '>' - Greater then or Equal: '>='
Create a StructField from a column definition.
Create a StructField from a column definition.
Create a StructType from a number of column definitions.
Create a StructType from a number of column definitions.
Create a complex DataType.
Create a complex DataType. Arrays, Maps and Structures are supported.
Create a decimal literal for a regular decimal number.
Create a decimal literal for a regular decimal number.
Create a dereference expression.
Create a dereference expression. The return type depends on the type of the parent.
If the parent is an UnresolvedAttribute, it can be a UnresolvedAttribute or
a UnresolvedRegex for regex quoted in ; if the parent is some other expression,
it can be UnresolvedExtractValue.
Create a Double Literal expression.
Create a Double Literal expression.
Create a filtering correlated sub-query (EXISTS).
Create a filtering correlated sub-query (EXISTS).
Create a Extract expression.
Create a Extract expression.
Create a First expression.
Create a First expression.
Create or resolve a frame boundary expressions.
Create or resolve a frame boundary expressions.
Create a logical plan for a given 'FROM' clause.
Create a logical plan for a given 'FROM' clause. Note that we support multiple (comma separated) relations here, these get converted into a single plan by condition-less inner join.
Create a (windowed) Function expression.
Create a (windowed) Function expression.
Create a function database (optional) and name pair.
Create a function database (optional) and name pair.
Create a Sequence of Strings for a parenthesis enclosed alias list.
Create a Sequence of Strings for a parenthesis enclosed alias list.
Create a Sequence of Strings for an identifier list.
Create a Sequence of Strings for an identifier list.
Create an inline table (a virtual table in Hive parlance).
Create an inline table (a virtual table in Hive parlance).
Create an integral literal expression.
Create an integral literal expression. The code selects the most narrow integral type possible, either a BigDecimal, a Long or an Integer is returned.
Create a CalendarInterval literal expression.
Create a CalendarInterval literal expression. An interval expression can contain multiple unit value pairs, for instance: interval 2 months 2 days.
Create a CalendarInterval for a unit value pair.
Create a CalendarInterval for a unit value pair. Two unit configuration types are supported: - Single unit. - From-To unit (only 'YEAR TO MONTH' and 'DAY TO SECOND' are supported).
Create an LambdaFunction.
Create an LambdaFunction.
Create a Last expression.
Create a Last expression.
Combine a number of boolean expressions into a balanced expression tree.
Combine a number of boolean expressions into a balanced expression tree. These expressions are either combined by a logical And or a logical Or.
A balanced binary tree is created because regular left recursive trees cause considerable performance degradations and can cause stack overflows.
Invert a boolean expression.
Invert a boolean expression.
Create an aliased expression if an alias is specified.
Create an aliased expression if an alias is specified. Both single and multi-aliases are supported.
Create a named logical plan.
Create a named logical plan.
This is only used for Common Table Expressions.
Create a NULL literal expression.
Create a NULL literal expression.
Create an expression for an expression between parentheses.
Create an expression for an expression between parentheses. This is need because the ANTLR visitor cannot automatically convert the nested context into an expression.
Create a Pivot column value with or without an alias.
Create a Pivot column value with or without an alias.
Create a Position expression.
Create a Position expression.
Create a predicated expression.
Create a predicated expression. A predicated expression is a normal expression with a predicate attached to it, for example:
a + 1 IS NULL
Resolve/create a primitive type.
Resolve/create a primitive type.
Create a top-level plan with Common Table Expressions.
Create a top-level plan with Common Table Expressions.
Create a logical plan using a query specification.
Create a logical plan using a query specification.
Create a single relation referenced in a FROM clause.
Create a single relation referenced in a FROM clause. This method is used when a part of the join condition is nested, for example:
select * from t1 join (t2 cross join t3) on col1 = col2
Create a CreateStruct expression.
Create a CreateStruct expression.
Create a condition based CaseWhen expression.
Create a condition based CaseWhen expression. This has the following SQL syntax:
CASE WHEN [predicate] THEN [expression] ... ELSE [expression] END
the parse tree
Connect two queries by a Set operator.
Connect two queries by a Set operator.
Supported Set operators are: - UNION [ DISTINCT | ALL ] - EXCEPT [ DISTINCT | ALL ] - MINUS [ DISTINCT | ALL ] - INTERSECT [DISTINCT | ALL]
Create a value based CaseWhen expression.
Create a value based CaseWhen expression. This has the following SQL form:
CASE [expression] WHEN [value] THEN [expression] ... ELSE [expression] END
Create a Short Literal expression.
Create a Short Literal expression.
Create a SortOrder expression.
Create a SortOrder expression.
Create a star (i.e.
Create a star (i.e. all) expression; this selects all elements (in the specified object). Both un-targeted (global) and targeted aliases are supported.
Convert a constant of any type into a string.
Convert a constant of any type into a string. This is typically used in DDL commands, and its main purpose is to prevent slight differences due to back to back conversions i.e.: String -> Literal -> String.
Create a String literal expression.
Create a String literal expression.
Create a CreateStruct expression.
Create a CreateStruct expression.
Create a logical plan for a sub-query.
Create a logical plan for a sub-query.
Create a ScalarSubquery expression.
Create a ScalarSubquery expression.
Create an UnresolvedExtractValue expression, this is used for subscript access to an array.
Create an UnresolvedExtractValue expression, this is used for subscript access to an array.
Create an un-aliased table reference.
Create an un-aliased table reference. This is typically used for top-level table references, for example:
INSERT INTO db.tbl2 TABLE db.tbl1
Create a TableIdentifier from a 'tableName' or 'databaseName'.'tableName' pattern.
Create a TableIdentifier from a 'tableName' or 'databaseName'.'tableName' pattern.
Create an aliased table reference.
Create an aliased table reference. This is typically used in FROM clauses.
Create a table-valued function call with arguments, e.g.
Create a table-valued function call with arguments, e.g. range(1000)
Create a Byte Literal expression.
Create a Byte Literal expression.
Create a typed Literal expression.
Create a typed Literal expression. A typed literal has the following SQL syntax:
[TYPE] '[VALUE]'
Currently Date, Timestamp and Binary typed literals are supported.
Create a window definition, i.e.
Create a window definition, i.e. WindowSpecDefinition.
Create a reference to a window frame, i.e.
Create a reference to a window frame, i.e. WindowSpecReference.
Create a clause for DISTRIBUTE BY.
Create a clause for DISTRIBUTE BY.
Create a (Hive based) ScriptInputOutputSchema.
Create a (Hive based) ScriptInputOutputSchema.
An adaptation of org.apache.spark.sql.catalyst.parser.AstBuilder