gianm commented on a change in pull request #9111: Add HashJoinSegment, a
virtual segment for joins.
URL: https://github.com/apache/druid/pull/9111#discussion_r366004860
##########
File path:
processing/src/main/java/org/apache/druid/segment/QueryableIndexStorageAdapter.java
##########
@@ -103,7 +98,8 @@ public int getDimensionCardinality(String dimension)
{
ColumnHolder columnHolder = index.getColumnHolder(dimension);
if (columnHolder == null) {
- return 0;
+ // NullDimensionSelector has cardinality = 1 (one null, nothing else).
+ return 1;
Review comment:
The impact is low, because the method is only used in two places, and both
of those are for algorithm selection in cases where we have a special
low-cardinality algorithm. In one place, the cardinality is just compared to a
constant `400000`, so returning 0 vs 1 here wouldn't change the behavior. In
the other place, a cardinality of 0 is treated as unknown so the 'safe'
algorithm is selected, which works fine at any cardinality. This change would
cause it to (correctly) use the special low-cardinality algorithm.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]