[ 
https://issues.apache.org/jira/browse/TINKERPOP-3080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17849626#comment-17849626
 ] 

ASF GitHub Bot commented on TINKERPOP-3080:
-------------------------------------------

saikiranboga commented on code in PR #2616:
URL: https://github.com/apache/tinkerpop/pull/2616#discussion_r1615518557


##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateGlobalStep.java:
##########
@@ -122,8 +121,16 @@ protected Traverser.Admin<S> processNextStart() {
 
     @Override
     public void processAllStarts() {
+        final TraversalSideEffects sideEffects = 
this.getTraversal().getSideEffects();
+
+        // Pre-defined Operator such as addAll and assign will reduce over the 
whole input set, rather than
+        // applying a single input one by one.
+        final boolean isOperatorForBulkSet = 
sideEffects.getReducer(sideEffectKey) == Operator.addAll ||

Review Comment:
   nit: suggest renaming this to `bulkReducingOperator` or something similar to 
callout observation towards the nature of reducing operators instead of 
limiting to BulkSet. addAll works with either maps or any collection and assign 
works with any type of input.





> AggregateStep can support all Operators predefined in TinkerPop
> ---------------------------------------------------------------
>
>                 Key: TINKERPOP-3080
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-3080
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: language, process
>            Reporter: Norio Akagi
>            Priority: Major
>             Fix For: 3.7.3
>
>
> Currently, {{AggreteGlobalStep}} and {{AggreteLocalStep}} only support addAll 
> and assign as Operator. This is because they use BulkSet to apply to 
> Operator. Only addAll and assign can work with BulkSet, so for other 
> operators it results in a type casting failure.
> They can be more flexible to work with any operators depending on what is set 
> by {{{}withSideEffect(){}}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to