Search in sources :

Example 6 with VertexValueType

use of com.alibaba.maxgraph.compiler.tree.value.VertexValueType in project GraphScope by alibaba.

the class TreeBuilder method processPathRequirement.

private void processPathRequirement(TreeNode treeNode, Set<String> propKeyList, Set<ValueType> pathValueList) {
    if (treeNode instanceof SourceDelegateNode) {
        processPathRequirement(SourceDelegateNode.class.cast(treeNode).getDelegate(), propKeyList, pathValueList);
        return;
    }
    if (treeNode instanceof SourceTreeNode || treeNode.getNodeType() == NodeType.AGGREGATE) {
        return;
    }
    UnaryTreeNode unaryTreeNode = UnaryTreeNode.class.cast(treeNode);
    if (treeNode instanceof RepeatTreeNode) {
        RepeatTreeNode repeatTreeNode = RepeatTreeNode.class.cast(treeNode);
        TreeNode repeatBodyTreeNode = repeatTreeNode.getRepeatBodyTreeNode();
        processPathRequirement(repeatBodyTreeNode, propKeyList, pathValueList);
    } else {
        if (treeNode.isPathFlag()) {
            treeNode.addPathRequirement();
            if (treeNode instanceof PathTreeNode) {
                ((PathTreeNode) treeNode).disablePathDelete();
            }
            ValueType inputValueType = unaryTreeNode.getInputNode().getOutputValueType();
            pathValueList.add(inputValueType);
            if (null != propKeyList && !propKeyList.isEmpty() && inputValueType instanceof VertexValueType) {
                if (unaryTreeNode.getInputNode() instanceof PropFillTreeNode) {
                    PropFillTreeNode propFillTreeNode = PropFillTreeNode.class.cast(unaryTreeNode.getInputNode());
                    propFillTreeNode.getPropKeyList().addAll(propKeyList);
                } else {
                    PropFillTreeNode propFillTreeNode = new PropFillTreeNode(null, propKeyList, schema);
                    TreeNode inputTreeNode = unaryTreeNode.getInputNode();
                    unaryTreeNode.setInputNode(propFillTreeNode);
                    propFillTreeNode.setInputNode(inputTreeNode);
                }
            }
        }
    }
    processPathRequirement(unaryTreeNode.getInputNode(), propKeyList, pathValueList);
}
Also used : VertexValueType(com.alibaba.maxgraph.compiler.tree.value.VertexValueType) VertexValueType(com.alibaba.maxgraph.compiler.tree.value.VertexValueType) ListValueType(com.alibaba.maxgraph.compiler.tree.value.ListValueType) ValueValueType(com.alibaba.maxgraph.compiler.tree.value.ValueValueType) ValueType(com.alibaba.maxgraph.compiler.tree.value.ValueType) VarietyValueType(com.alibaba.maxgraph.compiler.tree.value.VarietyValueType) SourceTreeNode(com.alibaba.maxgraph.compiler.tree.source.SourceTreeNode) SourceTreeNode(com.alibaba.maxgraph.compiler.tree.source.SourceTreeNode) EstimateCountTreeNode(com.alibaba.maxgraph.compiler.tree.source.EstimateCountTreeNode) SourceEdgeTreeNode(com.alibaba.maxgraph.compiler.tree.source.SourceEdgeTreeNode) SourceVertexTreeNode(com.alibaba.maxgraph.compiler.tree.source.SourceVertexTreeNode) SourceCreateGraphTreeNode(com.alibaba.maxgraph.compiler.tree.source.SourceCreateGraphTreeNode) SourceDelegateNode(com.alibaba.maxgraph.compiler.tree.source.SourceDelegateNode)

Aggregations

VertexValueType (com.alibaba.maxgraph.compiler.tree.value.VertexValueType)6 Message (com.alibaba.maxgraph.Message)2 LogicalEdge (com.alibaba.maxgraph.compiler.logical.LogicalEdge)2 LogicalQueryPlan (com.alibaba.maxgraph.compiler.logical.LogicalQueryPlan)2 LogicalVertex (com.alibaba.maxgraph.compiler.logical.LogicalVertex)2 VertexIdManager (com.alibaba.maxgraph.compiler.logical.VertexIdManager)2 ProcessorFilterFunction (com.alibaba.maxgraph.compiler.logical.function.ProcessorFilterFunction)2 ProcessorFunction (com.alibaba.maxgraph.compiler.logical.function.ProcessorFunction)2 SourceDelegateNode (com.alibaba.maxgraph.compiler.tree.source.SourceDelegateNode)2 SourceTreeNode (com.alibaba.maxgraph.compiler.tree.source.SourceTreeNode)2 ValueType (com.alibaba.maxgraph.compiler.tree.value.ValueType)2 HasContainer (org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer)2 QueryFlowOuterClass (com.alibaba.maxgraph.QueryFlowOuterClass)1 GraphSchema (com.alibaba.maxgraph.compiler.api.schema.GraphSchema)1 LogicalSubQueryPlan (com.alibaba.maxgraph.compiler.logical.LogicalSubQueryPlan)1 LogicalUnaryVertex (com.alibaba.maxgraph.compiler.logical.LogicalUnaryVertex)1 EdgeShuffleType (com.alibaba.maxgraph.compiler.logical.edge.EdgeShuffleType)1 ProcessorSourceFunction (com.alibaba.maxgraph.compiler.logical.function.ProcessorSourceFunction)1 ContextManager (com.alibaba.maxgraph.compiler.optimizer.ContextManager)1 FoldTreeNode (com.alibaba.maxgraph.compiler.tree.FoldTreeNode)1