Search in sources :

Example 1 with StackableAstVisitorContext

use of com.facebook.presto.sql.tree.TISStackableAstVisitor.StackableAstVisitorContext in project tis by qlangtech.

the class TableReferenceVisitor method visitJoin.

@Override
protected NodeProcessResult<?> visitJoin(Join node, StackableAstVisitorContext<Integer> context) {
    final Type type = node.getType();
    Relation left = node.getLeft();
    processLeftOrRightRelation(context, left, null, null);
    Relation right = node.getRight();
    Optional<JoinOn> joinOn = node.getCriteria().filter(criteria -> criteria instanceof JoinOn).map(criteria -> (JoinOn) criteria);
    processLeftOrRightRelation(context, right, joinOn, type);
    return null;
}
Also used : IDataTupleCreator(com.qlangtech.tis.sql.parser.tuple.creator.IDataTupleCreator) FunctionDataTupleCreator(com.qlangtech.tis.sql.parser.tuple.creator.impl.FunctionDataTupleCreator) ColRef(com.qlangtech.tis.sql.parser.tuple.creator.impl.ColRef) StringUtils(org.apache.commons.lang.StringUtils) com.facebook.presto.sql.tree(com.facebook.presto.sql.tree) TisGroupBy(com.qlangtech.tis.sql.parser.TisGroupBy) TableTupleCreator(com.qlangtech.tis.sql.parser.tuple.creator.impl.TableTupleCreator) TabCriteriaEntityRecognizeVisitor(com.qlangtech.tis.sql.parser.tuple.creator.impl.TabCriteriaEntityRecognizeVisitor) Stream(java.util.stream.Stream) IDumpNodeMapContext(com.qlangtech.tis.sql.parser.IDumpNodeMapContext) StackableAstVisitorContext(com.facebook.presto.sql.tree.TISStackableAstVisitor.StackableAstVisitorContext) Optional(java.util.Optional) Type(com.facebook.presto.sql.tree.Join.Type) NodeProcessResult(com.qlangtech.tis.sql.parser.NodeProcessResult) Joiner(com.google.common.base.Joiner) NodeUtils(com.qlangtech.tis.sql.parser.utils.NodeUtils) Type(com.facebook.presto.sql.tree.Join.Type)

Aggregations

com.facebook.presto.sql.tree (com.facebook.presto.sql.tree)1 Type (com.facebook.presto.sql.tree.Join.Type)1 StackableAstVisitorContext (com.facebook.presto.sql.tree.TISStackableAstVisitor.StackableAstVisitorContext)1 Joiner (com.google.common.base.Joiner)1 IDumpNodeMapContext (com.qlangtech.tis.sql.parser.IDumpNodeMapContext)1 NodeProcessResult (com.qlangtech.tis.sql.parser.NodeProcessResult)1 TisGroupBy (com.qlangtech.tis.sql.parser.TisGroupBy)1 IDataTupleCreator (com.qlangtech.tis.sql.parser.tuple.creator.IDataTupleCreator)1 ColRef (com.qlangtech.tis.sql.parser.tuple.creator.impl.ColRef)1 FunctionDataTupleCreator (com.qlangtech.tis.sql.parser.tuple.creator.impl.FunctionDataTupleCreator)1 TabCriteriaEntityRecognizeVisitor (com.qlangtech.tis.sql.parser.tuple.creator.impl.TabCriteriaEntityRecognizeVisitor)1 TableTupleCreator (com.qlangtech.tis.sql.parser.tuple.creator.impl.TableTupleCreator)1 NodeUtils (com.qlangtech.tis.sql.parser.utils.NodeUtils)1 Optional (java.util.Optional)1 Stream (java.util.stream.Stream)1 StringUtils (org.apache.commons.lang.StringUtils)1