clintropolis commented on a change in pull request #10370:
URL: https://github.com/apache/druid/pull/10370#discussion_r486756143



##########
File path: core/src/main/java/org/apache/druid/math/expr/Expr.java
##########
@@ -116,16 +116,39 @@ default String getBindingIfIdentifier()
   void visit(Visitor visitor);
 
   /**
-   * Programatically rewrite the {@link Expr} tree with a {@link Shuttle}.Each 
{@link Expr} is responsible for
+   * Programatically rewrite the {@link Expr} tree with a {@link Shuttle}. 
Each {@link Expr} is responsible for
    * ensuring the {@link Shuttle} can visit all of its {@link Expr} children, 
as well as updating its children
    * {@link Expr} with the results from the {@link Shuttle}, before finally 
visiting an updated form of itself.
    */
   Expr visit(Shuttle shuttle);
 
   /**
-   * Examine the usage of {@link IdentifierExpr} children of an {@link Expr}, 
constructing a {@link BindingDetails}
+   * Examine the usage of {@link IdentifierExpr} children of an {@link Expr}, 
constructing a {@link BindingAnalysis}
    */
-  BindingDetails analyzeInputs();
+  BindingAnalysis analyzeInputs();
+
+  /**
+   * Given an {@link InputBindingTypes}, compute what the output {@link 
ExprType} will be for this expression. A return
+   * value of null indicates that the given type information was not enough to 
resolve the output type, so the
+   * expression must be evaluated using default {@link #eval} handling where 
types are only known after evaluation,
+   * through {@link ExprEval#type}.
+   */
+  @Nullable
+  default ExprType getOutputType(InputBindingTypes inputTypes)
+  {
+    return null;
+  }
+
+  /**
+   * Mechanism to supply input types for the bindings which will back {@link 
IdentifierExpr}, to use in the aid of
+   * inferring the output type of an expression with {@link #getOutputType}. A 
null value means that either the binding

Review comment:
       not long term probably, but currently this will be backed by 
`ColumnCapabilities` from a `ColumnInspector`, which does not currently 
distinguish between those 2 things for all implementations.




----------------------------------------------------------------
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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to