somu-imply commented on code in PR #13799:
URL: https://github.com/apache/druid/pull/13799#discussion_r1116362455
##########
processing/src/main/java/org/apache/druid/segment/UnnestDimensionCursor.java:
##########
@@ -203,8 +202,10 @@ public Class<?> classOfObject()
@Override
public int getValueCardinality()
{
- if (!allowedBitSet.isEmpty()) {
- return allowedBitSet.cardinality();
+ if (allowFilter instanceof InDimFilter) {
+ return ((InDimFilter) allowFilter).getValues().size();
+ } else if (allowFilter instanceof AndFilter) {
+ return ((AndFilter) allowFilter).getFilters().size();
Review Comment:
Valid point, we can only estimate it correctly for In filters (no in the in
filter) and selector filter (should always be 1). This can get complicated for
a filter such as d3='a' AND d3='b' where the cardinality will be equal to the
size of the filters. I think Calcite would change that to d3 IN (a,b) so we
should only handle the 2 cases
--
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]