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 2020/06/23 22:04:52 UTC

[GitHub] [druid] maytasm opened a new pull request #10063: Make return type consistent for HyperUniquesAggregator and HyperUniquesVectorAggregator when no value found

maytasm opened a new pull request #10063:
URL: https://github.com/apache/druid/pull/10063


   Make return type consistent for HyperUniquesAggregator and HyperUniquesVectorAggregator when no value found
   
   ### Description
   
   This bug was discovered by turning on vectorization. In HyperUniquesAggregator, when a column is empty, `collector` will be null and the get() method will returns null. In HyperUniquesVectorAggregator, when a column is empty, get() method will still returns a HyperLogLogCollector (from the call to `HyperUniquesBufferAggregator.doGet(buf, position);`). In HyperUniquesAggregatorFactory#estimateCardinality (called by HyperUniquesAggregatorFactory#finalizeComputation) we return integer 0 if input is null, while we return long/double value. otherwise. Hence, for the above mentioned case, the non-vectorize returns integer 0 while the vectorize returns long/double 0. The test failed since we are expecting integer 0. 
   This PR, make sure that for the case when the input to HyperUniquesAggregatorFactory#estimateCardinality is null, we still return 0 with the same value type as when it is not null.  
   
   This PR has:
   - [x] been self-reviewed.
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/licenses.yaml)
   - [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
   - [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
   - [ ] added integration tests.
   - [ ] been tested in a test Druid cluster.
   


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



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


[GitHub] [druid] maytasm merged pull request #10063: Fix HyperUniquesAggregatorFactory.estimateCardinality null handling to respect output type

Posted by GitBox <gi...@apache.org>.
maytasm merged pull request #10063:
URL: https://github.com/apache/druid/pull/10063


   


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



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


[GitHub] [druid] maytasm commented on a change in pull request #10063: Make return type consistent for HyperUniquesAggregator and HyperUniquesVectorAggregator when no value found

Posted by GitBox <gi...@apache.org>.
maytasm commented on a change in pull request #10063:
URL: https://github.com/apache/druid/pull/10063#discussion_r444536063



##########
File path: processing/src/main/java/org/apache/druid/query/QueryContexts.java
##########
@@ -59,7 +59,7 @@
   public static final boolean DEFAULT_USE_CACHE = true;
   public static final boolean DEFAULT_POPULATE_RESULTLEVEL_CACHE = true;
   public static final boolean DEFAULT_USE_RESULTLEVEL_CACHE = true;
-  public static final Vectorize DEFAULT_VECTORIZE = Vectorize.FALSE;
+  public static final Vectorize DEFAULT_VECTORIZE = Vectorize.TRUE;

Review comment:
       Just to see if anything else fail. Will make this change in a separate PR with relevant doc change




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



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


[GitHub] [druid] clintropolis commented on pull request #10063: Fix HyperUniquesAggregatorFactory.estimateCardinality null handling to respect output type

Posted by GitBox <gi...@apache.org>.
clintropolis commented on pull request #10063:
URL: https://github.com/apache/druid/pull/10063#issuecomment-648509082


   >FWIW I like that the result type will be consistent after this change, and I can't think of any computations going awry if the returned value is 0d instead of 0L
   
   I consider the existing behavior a bug, it should have always been respecting the output type. Using one of the tests that had to change, it didn't really make sense that null handling mode should change the output type.


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



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