kgyrtkirk commented on code in PR #15694:
URL: https://github.com/apache/druid/pull/15694#discussion_r1511043640
##########
processing/src/main/java/org/apache/druid/math/expr/ConstantExpr.java:
##########
@@ -100,6 +106,67 @@ public String stringify()
{
return toString();
}
+
+ @Override
+ public final ExprEval eval(ObjectBinding bindings)
+ {
+ return realEval();
+ }
+
+ protected abstract ExprEval<T> realEval();
+
+
+ @Override
+ public Expr toSingleThreaded()
+ {
+ return new ExprEvalBasedConstantExpr<T>(realEval());
+ }
+
+ /**
+ * Constant expression based on a concreate ExprEval.
+ *
+ * Not multi-thread safe.
+ */
+ @NotThreadSafe
+ @SuppressWarnings("Immutable")
+ private static final class ExprEvalBasedConstantExpr<T> extends
ConstantExpr<T>
+ {
+ private final ExprEval<T> eval;
+
+ private ExprEvalBasedConstantExpr(ExprEval<T> eval)
+ {
+ super(eval.type(), eval.value);
+ this.eval = eval;
+ }
+
+ @Override
+ public ExprEval<T> realEval()
Review Comment:
of course - my intention was to have them protected...
--
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]