Cole-Greer commented on code in PR #3233:
URL: https://github.com/apache/tinkerpop/pull/3233#discussion_r2461936237


##########
docs/src/upgrade/release-3.8.x.asciidoc:
##########
@@ -293,6 +293,89 @@ The properties file in the above example can either point 
to a remote configurat
 
 See: link:https://issues.apache.org/jira/browse/TINKERPOP-3017[TINKERPOP-3017]
 
+==== `aggregate()` with `Scope` Removed
+
+The `Scope` parameter is being removed from `aggregate()` to fix inconsistency 
between two different use cases: flow
+control vs. per-element application. This change aligns all side effect steps 
(none of the others have scope arguments)
+and reserves the `Scope` parameter exclusively for "traverser-local" 
application patterns, eliminating confusion about
+its contextual meanings.
+
+This makes the `AggregateStep` globally scoped by default with eager 
aggregation. The Lazy evaluation with `aggregate()` is
+achieved by wrapping the step in `local()`.
+
+[source,text]
+----
+// 3.7.x - scope is still supported
+gremlin> g.V().aggregate(local, "x").by("age").select("x")
+==>[29]
+==>[29,27]
+==>[29,27]
+==>[29,27,32]
+==>[29,27,32]
+==>[29,27,32,35]
+
+// 3.8.0 - must use aggregate() within local() to achieve lazy aggregation
+gremlin> g.V().local(aggregate("x").by("age")).select("x")
+==>[29]
+==>[29,27]
+==>[29,27]
+==>[29,27,32]
+==>[29,27,32]
+==>[29,27,32,35]
+----
+
+An important behavioral difference exists between the removed 
`aggregate(local)` and its replacement `local(aggregate())`.
+In 3.8.0, `local()` changed from traverser-based to object-based processing, 
always debulking incoming traversers into
+individual objects. This causes `local(aggregate())` to behave differently 
from the original `aggregate(local)`, which
+preserved bulked traversers under the old `local()` semantics. This creates an 
irreplaceable use case, making this a
+_breaking change_.

Review Comment:
   ```suggestion
   An slight behavioral difference exists between the removed 
`aggregate(local)` and its replacement `local(aggregate())`
   with respect to handling of bulked traversers. In 3.8.0, `local()` changed 
from traverser-local to object-local processing,
   always debulking incoming traversers into individual objects. This causes 
`local(aggregate())` to show true lazy, 1 object
   at a time aggregation, differing from the original `aggregate(local)`, which 
always consumed bulked traversers atomically.
   There is no workaround to preserve the old "traverser-local" semantics.
   ```



-- 
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]

Reply via email to