Akshat-Jain commented on code in PR #17038:
URL: https://github.com/apache/druid/pull/17038#discussion_r1793605018


##########
processing/src/main/java/org/apache/druid/query/operator/NaivePartitioningOperator.java:
##########
@@ -110,28 +79,7 @@ public Closeable goOrContinue(Closeable continuation, 
Receiver receiver)
           @Override
           public Signal push(RowsAndColumns rac)

Review Comment:
   @kgyrtkirk The iterator needs to be created in the receiver's push() method.
   
   Having a static receiver doesn't let us create the iterator there, since 
getIteratorForRAC() is not static.
   
   getIteratorForRAC() can't be made static since it's supposed to be an 
abstract method, with different implementations in NaivePartitioningOperator 
and GlueingPartitioningOperator.
   
   If I remove getIteratorForRAC() from the abstract class, and just have it as 
a regular non-overridden static method, then how to pass the iterator to the 
static receiver? I can't pass it in like `super.push(rac, iteratorForRac)` 
since it violates the method signature of `push()`.
   
   Also, trying to make everything static also ends up requiring us to pass 
unnecessary variables as method params, and structure everything just to make 
the receiver static, which seems unnecessary and not clean to me. We anyway 
would still have to do `new StaticReceiver(field1, field2,...)` everytime 
instead of `new Receiver()`.
   
   Thoughts?



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

Reply via email to