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/10/10 17:36:58 UTC

[GitHub] [incubator-druid] jnaous commented on issue #8624: Use targetRowsPerSegment for single-dim partitions

jnaous commented on issue #8624: Use targetRowsPerSegment for single-dim partitions
URL: https://github.com/apache/incubator-druid/pull/8624#issuecomment-540692941
 
 
   I'll also add that if the default is change in the future, this makes
   refactoring easier. I think we should use constants instead of literal
   values generally because they make refactoring easier and make it easier to
   understand why a particular value is used.
   
   On Wed, Oct 9, 2019 at 1:54 PM Chi Cao Minh <no...@github.com>
   wrote:
   
   > *@ccaominh* commented on this pull request.
   > ------------------------------
   >
   > In
   > indexing-hadoop/src/main/java/org/apache/druid/indexer/DeterminePartitionsJob.java
   > <https://github.com/apache/incubator-druid/pull/8624#discussion_r333227957>
   > :
   >
   > > @@ -661,7 +661,7 @@ protected void innerReduce(Context context, SortableBytes keyBytes, Iterable<Dim
   >          }
   >
   >          // See if we need to cut a new partition ending immediately before this dimension value
   > -        if (currentDimPartition.rows > 0 && currentDimPartition.rows + dvc.numRows >= config.getTargetPartitionSize()) {
   > +        if (currentDimPartition.rows > 0 && currentDimPartition.rows + dvc.numRows > config.getTargetPartitionSize()) {
   >
   > When I was adding tests, I was expecting partitions sizes to match the
   > expected target but they were sized to one less than the target because of
   > this line. In practice, since the partition sizes are much larger than 1,
   > the difference is negligible, so I'm ok with reverting this change too.
   >
   > Related to your suggestion, I'll update the PR description to explain why
   > the single-dim partitioning is being changed to use targetRowsPerSegment.
   > ------------------------------
   >
   > In
   > indexing-hadoop/src/test/java/org/apache/druid/indexer/DeterminePartitionsJobTest.java
   > <https://github.com/apache/incubator-druid/pull/8624#discussion_r333227998>
   > :
   >
   > > @@ -51,6 +52,11 @@
   >  @RunWith(Parameterized.class)
   >  public class DeterminePartitionsJobTest
   >  {
   > +  @Nullable
   > +  private static final Long NO_TARGET_ROWS_PER_SEGMENT = null;
   >
   > The named constant can be useful for tools that do not display the
   > parameter names (e.g., diff tools like the github PR diff). Perhaps the
   > name can be improved (e.g., DEFAULT_TARGET_ROWS_PER_SEGMENT)?
   >
   > —
   > You are receiving this because you are subscribed to this thread.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/incubator-druid/pull/8624?email_source=notifications&email_token=AAPSYCWOZZQVHBXS3IL47LLQNZAHPA5CNFSM4I5HFRZ2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCHOOWQY#discussion_r333227957>,
   > or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AAPSYCWTXLEWBX26MVHWORLQNZAHPANCNFSM4I5HFRZQ>
   > .
   >
   
   
   -- 
   Jad Naous
   Imply | VP R&D
   650-521-3425
   jad.naous@imply.io
   

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