code
stringlengths
23
201k
docstring
stringlengths
17
96.2k
func_name
stringlengths
0
235
language
stringclasses
1 value
repo
stringlengths
8
72
path
stringlengths
11
317
url
stringlengths
57
377
license
stringclasses
7 values
protected R visitNil(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitNil
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitBoolean(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitBoolean
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitInt(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitInt
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitSmallInt(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitSmallInt
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitBigInt(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitBigInt
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitTinyInt(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitTinyInt
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitFloat(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitFloat
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitDouble(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitDouble
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitVarchar(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitVarchar
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitChar(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitChar
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitString(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitString
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitBinary(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitBinary
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitDecimal(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitDecimal
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitDate(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitDate
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitDateLiteral(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitDateLiteral
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitTimestamp(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitTimestamp
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitTableTokOrCol(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitTableTokOrCol
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitInsert(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitInsert
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitIsNull(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitIsNull
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitIsNotNull(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitIsNotNull
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitCTE(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitCTE
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitWindowSpec(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitWindowSpec
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitPartitioningSpec(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitPartitioningSpec
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitDistributeBy(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitDistributeBy
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitWindowRange(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitWindowRange
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitWindowValues(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitWindowValues
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitPreceding(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitPreceding
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitFollowing(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitFollowing
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitCurrentRow(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitCurrentRow
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
protected R visitIntervalLiteral(ASTNode node, C ctx) { return visitChildren(node, ctx).get(0); }
Provides a AST visitor functionality by calling appropriately named visitor method based on node type. We need to provide this because Hive AST object model does not provide properly typed nodes accepting visitors. @param node hive parse tree node to visit @param ctx abstract context passed to visitor methods @return...
visitIntervalLiteral
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/AbstractASTVisitor.java
BSD-2-Clause
public SqlNode processSql(String sql) { return process(sql, null); }
Creates a parse tree for input sql. The input SQL must NOT contain any Dali function names. It is okay for the sql to refer to dali views that use dali functions. @param sql sql statement to convert to parse tree @return Calcite SqlNode representing parse tree that calcite framework can understand
processSql
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
public SqlNode process(String sql, @Nullable Table hiveView) { ParseDriver pd = new CoralParseDriver(); try { ASTNode root = pd.parse(sql); return processAST(root, hiveView); } catch (ParseException e) { throw new RuntimeException(e); } }
Creates a parse tree for input sql. The input SQL must NOT contain any Dali function names. It is okay for the sql to refer to dali views that use dali functions. @param sql sql statement to convert to parse tree @return Calcite SqlNode representing parse tree that calcite framework can understand
process
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
private SqlNode processAST(ASTNode node, @Nullable Table hiveView) { ParseContext ctx = new ParseContext(hiveView); return visit(node, ctx); }
Creates a parse tree for input sql. The input SQL must NOT contain any Dali function names. It is okay for the sql to refer to dali views that use dali functions. @param sql sql statement to convert to parse tree @return Calcite SqlNode representing parse tree that calcite framework can understand
processAST
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitTabAlias(ASTNode node, ParseContext ctx) { List<SqlNode> sqlNodes = visitChildren(node, ctx); checkState(sqlNodes.size() == 1); return sqlNodes.get(0); }
Creates a parse tree for input sql. The input SQL must NOT contain any Dali function names. It is okay for the sql to refer to dali views that use dali functions. @param sql sql statement to convert to parse tree @return Calcite SqlNode representing parse tree that calcite framework can understand
visitTabAlias
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitLateralView(ASTNode node, ParseContext ctx) { return visitLateralViewInternal(node, ctx, false); }
Creates a parse tree for input sql. The input SQL must NOT contain any Dali function names. It is okay for the sql to refer to dali views that use dali functions. @param sql sql statement to convert to parse tree @return Calcite SqlNode representing parse tree that calcite framework can understand
visitLateralView
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitLateralViewOuter(ASTNode node, ParseContext ctx) { return visitLateralViewInternal(node, ctx, true); }
Creates a parse tree for input sql. The input SQL must NOT contain any Dali function names. It is okay for the sql to refer to dali views that use dali functions. @param sql sql statement to convert to parse tree @return Calcite SqlNode representing parse tree that calcite framework can understand
visitLateralViewOuter
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
private SqlNode visitLateralViewInternal(ASTNode node, ParseContext ctx, boolean isOuter) { List<SqlNode> sqlNodes = visitChildren(node, ctx); checkState(sqlNodes.size() == 2 && sqlNodes.get(0) instanceof SqlNodeList); // rightNode is AS.createCall(unnest, t, col) SqlNode rightNode = Iterables.getOnlyE...
Creates a parse tree for input sql. The input SQL must NOT contain any Dali function names. It is okay for the sql to refer to dali views that use dali functions. @param sql sql statement to convert to parse tree @return Calcite SqlNode representing parse tree that calcite framework can understand
visitLateralViewInternal
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
private SqlNode visitLateralViewUDTF(List<SqlNode> sqlNodes, List<SqlNode> aliasOperands, SqlCall tableFunctionCall) { SqlNode lateralCall = SqlStdOperatorTable.LATERAL.createCall(ZERO, new SqlLateralOperator(SqlKind.COLLECTION_TABLE).createCall(ZERO, tableFunctionCall)); final String functionName = tab...
For generic UDTFs, we treat them as LinkedIn UDFs and make the following conversion: SELECT a, t.col1 FROM test.tableOne LATERAL VIEW `com.linkedin.coral.hive.hive2rel.CoralTestUDTF`(`tableone`.`a`) `t` -> SELECT a, t.col1 FROM test.tableOne LATERAL COLLECTION_TABLE(`com.linkedin.coral.hive.hive2rel.CoralTestUDTF`(`ta...
visitLateralViewUDTF
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
private SqlNode visitLateralViewExplode(List<SqlNode> sqlNodes, List<SqlNode> aliasOperands, SqlCall tableFunctionCall, boolean isOuter) { final int operandCount = aliasOperands.size(); // explode array if operandCount == 3: LATERAL VIEW EXPLODE(op0) op1 AS op2 // explode map if operandCount == 4: LAT...
For generic UDTFs, we treat them as LinkedIn UDFs and make the following conversion: SELECT a, t.col1 FROM test.tableOne LATERAL VIEW `com.linkedin.coral.hive.hive2rel.CoralTestUDTF`(`tableone`.`a`) `t` -> SELECT a, t.col1 FROM test.tableOne LATERAL COLLECTION_TABLE(`com.linkedin.coral.hive.hive2rel.CoralTestUDTF`(`ta...
visitLateralViewExplode
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitSelectExpr(ASTNode node, ParseContext ctx) { List<SqlNode> sqlNodes = visitChildren(node, ctx); if (sqlNodes.size() == 1) { return sqlNodes.get(0); } else if (sqlNodes.size() == 2) { return new SqlBasicCall(SqlStdOperatorTable.AS, sqlNodes.toArray(new SqlNode[0...
See {@link #visitWindowSpec(ASTNode, ParseContext)} for SQL, AST Tree and SqlNode Tree examples
visitSelectExpr
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitSelectDistinct(ASTNode node, ParseContext ctx) { ctx.keywords = new SqlNodeList(ImmutableList.of(SqlSelectKeyword.DISTINCT.symbol(ZERO)), ZERO); return visitSelect(node, ctx); }
See {@link #visitWindowSpec(ASTNode, ParseContext)} for SQL, AST Tree and SqlNode Tree examples
visitSelectDistinct
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitSelect(ASTNode node, ParseContext ctx) { List<SqlNode> sqlNodes = visitChildren(node, ctx); ctx.selects = new SqlNodeList(sqlNodes, ZERO); return ctx.selects; }
See {@link #visitWindowSpec(ASTNode, ParseContext)} for SQL, AST Tree and SqlNode Tree examples
visitSelect
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitTabRefNode(ASTNode node, ParseContext ctx) { List<SqlNode> sqlNodes = visitChildren(node, ctx); checkState(sqlNodes != null && !sqlNodes.isEmpty()); if (sqlNodes.size() == 1) { return sqlNodes.get(0); } if (sqlNodes.size() == 2) { return new SqlBasicCal...
See {@link #visitWindowSpec(ASTNode, ParseContext)} for SQL, AST Tree and SqlNode Tree examples
visitTabRefNode
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitTabnameNode(ASTNode node, ParseContext ctx) { List<SqlNode> sqlNodes = visitChildren(node, ctx); List<String> names = sqlNodes.stream().map(s -> ((SqlIdentifier) s).names).flatMap(List::stream).collect(Collectors.toList()); return new SqlIdentifier(names, ZERO); ...
See {@link #visitWindowSpec(ASTNode, ParseContext)} for SQL, AST Tree and SqlNode Tree examples
visitTabnameNode
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
protected SqlNode visitSubqueryOp(ASTNode node, ParseContext ctx) { throw new UnhandledASTTokenException(node); }
See {@link #visitWindowSpec(ASTNode, ParseContext)} for SQL, AST Tree and SqlNode Tree examples
visitSubqueryOp
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
private SqlOperator getSubQueryOp(ASTNode node, ParseContext ctx) { checkState(node.getChildren().size() == 1, node.dump()); String opName = ((ASTNode) node.getChildren().get(0)).getText(); if (opName.equalsIgnoreCase("in")) { return SqlStdOperatorTable.IN; } else if (opName.equalsIgnoreCase("exis...
See {@link #visitWindowSpec(ASTNode, ParseContext)} for SQL, AST Tree and SqlNode Tree examples
getSubQueryOp
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitSubqueryExpr(ASTNode node, ParseContext ctx) { ArrayList<Node> children = node.getChildren(); checkState(children.size() >= 2); SqlOperator op = getSubQueryOp((ASTNode) node.getChildren().get(0), ctx); SqlNode subQuery = visit((ASTNode) children.get(1), ctx); List<...
See {@link #visitWindowSpec(ASTNode, ParseContext)} for SQL, AST Tree and SqlNode Tree examples
visitSubqueryExpr
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitSubquery(ASTNode node, ParseContext ctx) { ParseContext subQueryContext = new ParseContext(ctx.getHiveTable().orElse(null)); List<SqlNode> sqlNodes = visitChildren(node, subQueryContext); if (sqlNodes.size() == 1) { return sqlNodes.get(0); } else if (sqlNodes.siz...
See {@link #visitWindowSpec(ASTNode, ParseContext)} for SQL, AST Tree and SqlNode Tree examples
visitSubquery
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitFrom(ASTNode node, ParseContext ctx) { List<SqlNode> children = visitChildren(node, ctx); if (children.size() == 1) { ctx.from = children.get(0); return children.get(0); } // TODO: handle join throw new UnsupportedASTException(node.dump()); }
See {@link #visitWindowSpec(ASTNode, ParseContext)} for SQL, AST Tree and SqlNode Tree examples
visitFrom
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitIdentifier(ASTNode node, ParseContext ctx) { return new SqlIdentifier(node.getText(), ZERO); }
See {@link #visitWindowSpec(ASTNode, ParseContext)} for SQL, AST Tree and SqlNode Tree examples
visitIdentifier
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitStringLiteral(ASTNode node, ParseContext ctx) { // TODO: Add charset here. UTF-8 is not supported by calcite String text = node.getText(); checkState(text.length() >= 2); return SqlLiteral.createCharString(removeBackslashBeforeQuotes(text.substring(1, text.length() - 1...
See {@link #removeBackslashBeforeQuotes} We use removeBackslashBeforeQuotes to remove the backslash before quotes, so that we maintain patterns like {@code I'm} or {@code abc"xyz} as is in the java object in memory, the escaped literal string representation will be generated when the SqlNode is written to string by the...
visitStringLiteral
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
private String removeBackslashBeforeQuotes(String input) { // matches a \' or \" literal pattern Pattern pattern = Pattern.compile("\\\\['\"]"); Matcher matcher = pattern.matcher(input); StringBuffer res = new StringBuffer(); while (matcher.find()) { String replacement = matcher.group().subst...
See {@link #removeBackslashBeforeQuotes} We use removeBackslashBeforeQuotes to remove the backslash before quotes, so that we maintain patterns like {@code I'm} or {@code abc"xyz} as is in the java object in memory, the escaped literal string representation will be generated when the SqlNode is written to string by the...
removeBackslashBeforeQuotes
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitBigintLiteral(ASTNode node, ParseContext ctx) { String text = node.getText(); checkState(text.length() >= 2); return SqlLiteral.createExactNumeric(text.substring(0, text.length() - 1), ZERO); }
See {@link #removeBackslashBeforeQuotes} We use removeBackslashBeforeQuotes to remove the backslash before quotes, so that we maintain patterns like {@code I'm} or {@code abc"xyz} as is in the java object in memory, the escaped literal string representation will be generated when the SqlNode is written to string by the...
visitBigintLiteral
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitDateLiteral(ASTNode node, ParseContext ctx) { String text = node.getText(); checkState(text.length() >= 2); return SqlLiteral.createCharString(text.substring(1, text.length() - 1), ZERO); }
See {@link #removeBackslashBeforeQuotes} We use removeBackslashBeforeQuotes to remove the backslash before quotes, so that we maintain patterns like {@code I'm} or {@code abc"xyz} as is in the java object in memory, the escaped literal string representation will be generated when the SqlNode is written to string by the...
visitDateLiteral
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitQueryNode(ASTNode node, ParseContext ctx) { ArrayList<Node> children = node.getChildren(); checkState(children != null && !children.isEmpty()); SqlNode cte = null; ParseContext qc = new ParseContext(ctx.getHiveTable().orElse(null)); for (Node child : node.getChildr...
See {@link #removeBackslashBeforeQuotes} We use removeBackslashBeforeQuotes to remove the backslash before quotes, so that we maintain patterns like {@code I'm} or {@code abc"xyz} as is in the java object in memory, the escaped literal string representation will be generated when the SqlNode is written to string by the...
visitQueryNode
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
protected SqlNode visitNil(ASTNode node, ParseContext ctx) { return visitChildren(node, ctx).get(0); }
See {@link #visitCTE(ASTNode, ParseContext) visitCTE} for details
visitNil
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitBoolean(ASTNode node, ParseContext ctx) { return createBasicTypeSpec(SqlTypeName.BOOLEAN); }
See {@link #visitCTE(ASTNode, ParseContext) visitCTE} for details
visitBoolean
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitInt(ASTNode node, ParseContext ctx) { return createBasicTypeSpec(SqlTypeName.INTEGER); }
See {@link #visitCTE(ASTNode, ParseContext) visitCTE} for details
visitInt
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitSmallInt(ASTNode node, ParseContext ctx) { return createBasicTypeSpec(SqlTypeName.SMALLINT); }
See {@link #visitCTE(ASTNode, ParseContext) visitCTE} for details
visitSmallInt
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitBigInt(ASTNode node, ParseContext ctx) { return createBasicTypeSpec(SqlTypeName.BIGINT); }
See {@link #visitCTE(ASTNode, ParseContext) visitCTE} for details
visitBigInt
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitTinyInt(ASTNode node, ParseContext ctx) { return createBasicTypeSpec(SqlTypeName.TINYINT); }
See {@link #visitCTE(ASTNode, ParseContext) visitCTE} for details
visitTinyInt
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitFloat(ASTNode node, ParseContext ctx) { return createBasicTypeSpec(SqlTypeName.FLOAT); }
See {@link #visitCTE(ASTNode, ParseContext) visitCTE} for details
visitFloat
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitDouble(ASTNode node, ParseContext ctx) { return createBasicTypeSpec(SqlTypeName.DOUBLE); }
See {@link #visitCTE(ASTNode, ParseContext) visitCTE} for details
visitDouble
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitVarchar(ASTNode node, ParseContext ctx) { return createBasicTypeSpec(SqlTypeName.VARCHAR); }
See {@link #visitCTE(ASTNode, ParseContext) visitCTE} for details
visitVarchar
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitChar(ASTNode node, ParseContext ctx) { return createBasicTypeSpec(SqlTypeName.CHAR); }
See {@link #visitCTE(ASTNode, ParseContext) visitCTE} for details
visitChar
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitString(ASTNode node, ParseContext ctx) { return createBasicTypeSpec(SqlTypeName.VARCHAR); }
See {@link #visitCTE(ASTNode, ParseContext) visitCTE} for details
visitString
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitBinary(ASTNode node, ParseContext ctx) { return createBasicTypeSpec(SqlTypeName.BINARY); }
See {@link #visitCTE(ASTNode, ParseContext) visitCTE} for details
visitBinary
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitDecimal(ASTNode node, ParseContext ctx) { if (node.getChildCount() == 2) { try { final SqlTypeNameSpec typeNameSpec = new SqlBasicTypeNameSpec(SqlTypeName.DECIMAL, Integer.parseInt(((ASTNode) node.getChildren().get(0)).getText()), Integer.pars...
See {@link #visitCTE(ASTNode, ParseContext) visitCTE} for details
visitDecimal
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitDate(ASTNode node, ParseContext ctx) { return createBasicTypeSpec(SqlTypeName.DATE); }
See {@link #visitCTE(ASTNode, ParseContext) visitCTE} for details
visitDate
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitTimestamp(ASTNode node, ParseContext ctx) { return createBasicTypeSpec(SqlTypeName.TIMESTAMP); }
See {@link #visitCTE(ASTNode, ParseContext) visitCTE} for details
visitTimestamp
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitIsNull(ASTNode node, ParseContext ctx) { return SqlLiteral.createCharString("is null", ZERO); }
See {@link #visitCTE(ASTNode, ParseContext) visitCTE} for details
visitIsNull
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitIsNotNull(ASTNode node, ParseContext ctx) { return SqlLiteral.createCharString("is not null", ZERO); }
See {@link #visitCTE(ASTNode, ParseContext) visitCTE} for details
visitIsNotNull
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitKeywordLiteral(ASTNode node, ParseContext ctx) { return SqlLiteral.createCharString(node.getText(), ZERO); }
See {@link #visitCTE(ASTNode, ParseContext) visitCTE} for details
visitKeywordLiteral
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitCTE(ASTNode node, ParseContext ctx) { // ASTNode tree from Hive Antlr // TOK_QUERY // - TOK_FROM // - TOK_INSERT // -- TOK_DESTINATION // -- TOK_SELECT // - TOK_CTE <-- processed by this method visitCTE // -- TOK_SUBQUERY // --- TOK_QUERY ...
See {@link #visitCTE(ASTNode, ParseContext) visitCTE} for details
visitCTE
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitWindowSpec(ASTNode node, ParseContext ctx) { // See Apache Hive source code: https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java#L4339 // "private RelNode genSelectForWindowing(QB qb, RelNode srcRel, HashSet<ColumnInfo> ne...
See {@link #visitSubquery(ASTNode, ParseContext) visitSubquery} for details
visitWindowSpec
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitPartitioningSpec(ASTNode node, ParseContext ctx) { SqlNode partitionList = visitOptionalChildByType(node, ctx, HiveParser.TOK_DISTRIBUTEBY); SqlNode orderList = visitOptionalChildByType(node, ctx, HiveParser.TOK_ORDERBY); return new SqlWindow(ZERO, null, null, partitionLis...
See {@link #visitSubquery(ASTNode, ParseContext) visitSubquery} for details
visitPartitioningSpec
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitDistributeBy(ASTNode node, ParseContext ctx) { return new SqlNodeList(visitChildren(node, ctx), ZERO); }
See {@link #visitSubquery(ASTNode, ParseContext) visitSubquery} for details
visitDistributeBy
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitWindowRange(ASTNode node, ParseContext ctx) { // Hive AST: // TOK_WINDOWRANGE (ROWS ...) // CURRENT // FOLLOWING // 1 List<SqlNode> sqlNodeList = visitChildren(node, ctx); SqlNode preceding = sqlNodeList.get(0); SqlNode ...
See {@link #visitSubquery(ASTNode, ParseContext) visitSubquery} for details
visitWindowRange
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitWindowValues(ASTNode node, ParseContext ctx) { // Hive AST: // TOK_WINDOWVALUES (VALUES ...) // CURRENT // FOLLOWING // 1 // Reuse the same code of visitWindowRange since the AST structure is exactly the same return visitWi...
See {@link #visitSubquery(ASTNode, ParseContext) visitSubquery} for details
visitWindowValues
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitPreceding(ASTNode node, ParseContext ctx) { SqlNode sqlNode = visitChildren(node, ctx).get(0); if (sqlNode.getKind() == SqlKind.LITERAL && sqlNode.toString().equalsIgnoreCase("'UNBOUNDED'")) { return SqlWindow.createUnboundedPreceding(ZERO); } else { return Sql...
See {@link #visitSubquery(ASTNode, ParseContext) visitSubquery} for details
visitPreceding
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitFollowing(ASTNode node, ParseContext ctx) { SqlNode sqlNode = visitChildren(node, ctx).get(0); if (sqlNode.getKind() == SqlKind.LITERAL && sqlNode.toString().equalsIgnoreCase("'UNBOUNDED'")) { return SqlWindow.createUnboundedFollowing(ZERO); } else { return Sql...
See {@link #visitSubquery(ASTNode, ParseContext) visitSubquery} for details
visitFollowing
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitCurrentRow(ASTNode node, ParseContext ctx) { return SqlWindow.createCurrentRow(ZERO); }
See {@link #visitSubquery(ASTNode, ParseContext) visitSubquery} for details
visitCurrentRow
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
private SqlDataTypeSpec createBasicTypeSpec(SqlTypeName type) { final SqlTypeNameSpec typeNameSpec = new SqlBasicTypeNameSpec(type, ZERO); return new SqlDataTypeSpec(typeNameSpec, ZERO); }
See {@link #visitSubquery(ASTNode, ParseContext) visitSubquery} for details
createBasicTypeSpec
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitTableTokOrCol(ASTNode node, ParseContext ctx) { return visitChildren(node, ctx).get(0); }
See {@link #visitSubquery(ASTNode, ParseContext) visitSubquery} for details
visitTableTokOrCol
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
private SqlIntervalQualifier fromASTIntervalTypeToSqlIntervalQualifier(ASTNode node) { switch (node.getType()) { case HiveParser.TOK_INTERVAL_DAY_LITERAL: return new SqlIntervalQualifier(TimeUnit.DAY, null, ZERO); case HiveParser.TOK_INTERVAL_DAY_TIME_LITERAL: return new SqlIntervalQuali...
See {@link #visitSubquery(ASTNode, ParseContext) visitSubquery} for details
fromASTIntervalTypeToSqlIntervalQualifier
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override protected SqlNode visitIntervalLiteral(ASTNode node, ParseContext ctx) { // Hive Antlr Tree looks like the following: // ASTNode(token.type = TOK_INTERVAL_DAY_LITERAL, token.text="'28'") // Calcite SqlNode Tree looks like the following: // SqlIntervalLiteral(1 /* sign */, "28" /* unquote...
See {@link #visitSubquery(ASTNode, ParseContext) visitSubquery} for details
visitIntervalLiteral
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
Optional<Table> getHiveTable() { return hiveTable; }
See {@link #visitSubquery(ASTNode, ParseContext) visitSubquery} for details
getHiveTable
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java
BSD-2-Clause
@Override public Tree dupNode() { return new ASTNode(this); }
Constructor. @param t Token for the CommonTree Node
dupNode
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNode.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNode.java
BSD-2-Clause
@Override public ArrayList<Node> getChildren() { if (super.getChildCount() == 0) { return null; } ArrayList<Node> ret_vec = new ArrayList<>(); for (int i = 0; i < super.getChildCount(); ++i) { ret_vec.add((Node) super.getChild(i)); } return ret_vec; }
Constructor. @param t Token for the CommonTree Node
getChildren
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNode.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNode.java
BSD-2-Clause
public String getName() { return (Integer.valueOf(super.getToken().getType())).toString(); }
Constructor. @param t Token for the CommonTree Node
getName
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNode.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNode.java
BSD-2-Clause
public ASTNodeOrigin getOrigin() { return origin; }
@return information about the object from which this ASTNode originated, or null if this ASTNode was not expanded from an object reference
getOrigin
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNode.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNode.java
BSD-2-Clause
public void setOrigin(ASTNodeOrigin origin) { this.origin = origin; }
Tag this ASTNode with information about the object from which this node originated. @param origin {@link ASTNodeOrigin} object
setOrigin
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNode.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNode.java
BSD-2-Clause
public String dump() { StringBuilder sb = new StringBuilder("\n"); dump(sb, ""); return sb.toString(); }
Tag this ASTNode with information about the object from which this node originated. @param origin {@link ASTNodeOrigin} object
dump
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNode.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNode.java
BSD-2-Clause
private void dump(StringBuilder sb, String ws) { sb.append(ws); sb.append(toString()); sb.append("\n"); ArrayList<Node> children = getChildren(); if (children != null) { for (Node node : getChildren()) { if (node instanceof ASTNode) { ((ASTNode) node).dump(sb, ws + " "); ...
Tag this ASTNode with information about the object from which this node originated. @param origin {@link ASTNodeOrigin} object
dump
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNode.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNode.java
BSD-2-Clause
public String getObjectType() { return objectType; }
@return the type of the object from which an ASTNode originated, e.g. "view".
getObjectType
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNodeOrigin.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNodeOrigin.java
BSD-2-Clause
public String getObjectName() { return objectName; }
@return the name of the object from which an ASTNode originated, e.g. "v".
getObjectName
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNodeOrigin.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNodeOrigin.java
BSD-2-Clause
public String getObjectDefinition() { return objectDefinition; }
@return the definition of the object from which an ASTNode originated, e.g. <code>select x+1 as y from t</code>.
getObjectDefinition
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNodeOrigin.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNodeOrigin.java
BSD-2-Clause
public String getUsageAlias() { return usageAlias; }
@return the alias of the object from which an ASTNode originated, e.g. "v1" (this can help with debugging context-dependent expansions)
getUsageAlias
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNodeOrigin.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNodeOrigin.java
BSD-2-Clause
public ASTNode getUsageNode() { return usageNode; }
@return the expression node triggering usage of an object from which an ASTNode originated, e.g. <code>v as v1</code> (this can help with debugging context-dependent expansions)
getUsageNode
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNodeOrigin.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ASTNodeOrigin.java
BSD-2-Clause
@Override public Object create(Token payload) { return new ASTNode(payload); }
Creates an ASTNode for the given token. The ASTNode is a wrapper around antlr's CommonTree class that implements the Node interface. @param payload The token. @return Object (which is actually an ASTNode) for the token.
create
java
linkedin/coral
coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ParseDriver.java
https://github.com/linkedin/coral/blob/master/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/parser/ParseDriver.java
BSD-2-Clause