yaozhongq commented on code in PR #629:
URL: https://github.com/apache/geaflow/pull/629#discussion_r2472055077
##########
geaflow/geaflow-dsl/geaflow-dsl-runtime/src/main/java/org/apache/geaflow/dsl/runtime/traversal/operator/MatchVertexOperator.java:
##########
@@ -83,6 +93,19 @@ private void processVertex(VertexRecord vertexRecord) {
graphSchema,
addingVertexFieldTypes);
loadVertexRt.update(System.currentTimeMillis() - startTs);
+
+ if (vertexProjector == null) {
+ vertexProjector = new VertexProjectorUtil(
+ graphSchema,
+ fields,
+ addingVertexFieldNames,
+ addingVertexFieldTypes
+ );
+ }
+ if (fields != null) {
Review Comment:
Constructing the project only when the field is not empty will result in
better performance.
##########
geaflow/geaflow-dsl/geaflow-dsl-plan/src/main/java/org/apache/geaflow/dsl/rel/match/EdgeMatch.java:
##########
@@ -46,6 +43,8 @@ public class EdgeMatch extends AbstractRelNode implements
SingleMatchNode, IMatc
private final String label;
+ private Set<RexFieldAccess> fields;
Review Comment:
Consider changing the name, for example: Pushdown Field
##########
geaflow/geaflow-dsl/geaflow-dsl-runtime/src/main/java/org/apache/geaflow/dsl/runtime/traversal/operator/MatchEdgeOperator.java:
##########
@@ -64,13 +75,26 @@ public void processRecord(VertexRecord vertex) {
EdgeGroup edgeGroup = loadEdges;
if (!function.getEdgeTypes().isEmpty()) {
edgeGroup = loadEdges.filter(edge ->
+
function.getEdgeTypes().contains(edge.getBinaryLabel()));
}
Map<Object, ITreePath> targetTreePaths = new HashMap<>();
+
// generate new paths.
if (needAddToPath) {
int numEdge = 0;
for (RowEdge edge : edgeGroup) {
+ if (edgeProjector == null) {
+ edgeProjector = new EdgeProjectorUtil(
+ graphSchema,
+ fields,
+ getOutputType()
+ );
+ }
+ if (fields != null) {
Review Comment:
Constructing the project only when the field is not empty will result in
better performance.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]