clintropolis commented on code in PR #14287:
URL: https://github.com/apache/druid/pull/14287#discussion_r1198202220
##########
processing/src/main/java/org/apache/druid/math/expr/Expr.java:
##########
@@ -185,10 +185,28 @@ default <T> ExprVectorProcessor<T>
asVectorProcessor(VectorInputBindingInspector
throw Exprs.cannotVectorize(this);
}
+
+ /**
+ * Decorates the cache key builder by adding extra elements if stringify
alone is not sufficient
+ * to create the cache key. Override this method in such cases then, for
e.g. {@link org.apache.druid.query.expression.LookupExprMacro}}
+ * @param builder
+ */
Review Comment:
nit: i dont think we really need to link to things that override this,
rather we should indicate that it is for use to append additional information
to the default implementation of `getCacheKey`, such as if the expression
relies on some external state. How about something like:
```suggestion
/**
* Decorates the {@link CacheKeyBuilder} for the default implementation of
{@link #getCacheKey()}. The default cache
* key implementation includes the output of {@link #stringify()} and then
uses a {@link Shuttle} to call this method
* on all children. The stringified representation is sufficient for most
expressions, but for any which rely on
* external state that might change, this method allows the cache key to
change when the state does, even if the
* expression itself is otherwise the same.
*/
```
--
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]