gianm commented on a change in pull request #8047: optimize single input column
multi-value expressions
URL: https://github.com/apache/incubator-druid/pull/8047#discussion_r309497062
##########
File path:
processing/src/main/java/org/apache/druid/segment/virtual/ExpressionSelectors.java
##########
@@ -230,8 +230,9 @@ public static DimensionSelector makeDimensionSelector(
&& capabilities.getType() == ValueType.STRING
&& capabilities.isDictionaryEncoded()
&& capabilities.isComplete()
- && !capabilities.hasMultipleValues()
- && !exprDetails.getArrayColumns().contains(column)
+ && !exprDetails.hasInputArrays()
+ && !exprDetails.isOutputArray()
+ && (!capabilities.hasMultipleValues() ||
exprDetails.getFreeVariables().size() == 1)
) {
// Optimization for dimension selectors that wrap a single underlying
string column.
Review comment:
The flag chain above is getting complicated!
Could you please alter this comment to reflect what it's looking for? If I
understand it right, that should be something like:
> Optimization for dimension selectors that wrap a single underlying string
column. The string column can be multi-valued, but if so, it must be implicitly
mappable (i.e. the expression is not treating it as an array, not wanting to
output an array, and the multi-value dimension appears exactly once).
By the way, I have to assume logic like this is being used elsewhere to
implicitly map expressions that go through the non-optimized selector. Is there
any opportunity to extract the logic into a common helper method? It would make
it easier for readers and probably less error prone too.
----------------------------------------------------------------
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]