abstractdog commented on code in PR #6703:
URL: https://github.com/apache/hive/pull/6703#discussion_r3843480877


##########
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/ptf/VectorPTFGroupBatches.java:
##########
@@ -839,6 +887,12 @@ private void setRepeatingColumn(Object partitionKey, 
VectorizedRowBatch targetBa
   void preFinishPartition() throws HiveException {
     int rows = size();
 
+    for (VectorPTFEvaluatorBase evaluator : evaluators) {
+      if (evaluator.needPartitionSize()) {

Review Comment:
   I believe that VectorPTFEvaluatorBass class is already polluted with:
   ```
     public void setPartitionSize(int partitionSize) {
       this.partitionSize = partitionSize;
     }
   ```
   and:
   ```
     protected int partitionSize = -1;
   ```
   with extra checks we might end up with 1-2 calls for each evaluator: 1 
check, and maybe 1 set
   so always at least N calls (for checking), so finally somewhere between 
N...2N calls
   
   without the checks, we'll have N set calls, fixed
   
   regarding new interfaces: while it makes the code look better, the 
`instanceof` check ends up on the per-batch codepath, which can be expensive, 
so a single `setPartitionSize` call for each evaluator is still the most 
deterministic and lightweight operation, wdyt?



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