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);
}
Aggregations