ccaominh commented on a change in pull request #8273: Fix 
DeterminePartitionsJob reducer when total rows < targetPartitionSize
URL: https://github.com/apache/incubator-druid/pull/8273#discussion_r312300344
 
 

 ##########
 File path: 
indexing-hadoop/src/main/java/org/apache/druid/indexer/DeterminePartitionsJob.java
 ##########
 @@ -691,8 +691,9 @@ protected void innerReduce(Context context, SortableBytes 
keyBytes, Iterable<Dim
             // One more shard to go
             final ShardSpec shardSpec;
 
-            if (currentDimPartition.rows < config.getTargetPartitionSize() * 
SHARD_COMBINE_THRESHOLD) {
-              // Combine with previous shard
+            if (currentDimPartition.rows < config.getTargetPartitionSize() * 
SHARD_COMBINE_THRESHOLD &&
+                currentDimPartitions.partitions.size() > 0) {
 
 Review comment:
   Consider `!isEmpty()` over `size() > 0`: 
https://rules.sonarsource.com/java/tag/clumsy/RSPEC-1155

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to