You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/08/09 01:18:16 UTC

[GitHub] [incubator-druid] ccaominh commented on a change in pull request #8273: Fix DeterminePartitionsJob reducer when total rows < targetPartitionSize

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:
users@infra.apache.org


With regards,
Apache Git Services

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