rdblue commented on code in PR #18629:
URL: https://github.com/apache/iceberg/pull/18629#discussion_r4744947999
##########
api/src/main/java/org/apache/iceberg/expressions/Binder.java:
##########
@@ -48,16 +48,101 @@ private Binder() {}
* <p>The expression cannot contain references that are already bound, or an
{@link
* IllegalStateException} will be thrown.
*
+ * <p>A value expression is bound as by {@link #bind(StructType,
ValueExpression, boolean)}.
+ *
* @param struct The {@link StructType struct type} to resolve references by
name.
* @param expr An {@link Expression expression} to rewrite with bound
references.
* @param caseSensitive A boolean flag to control whether the bind should
enforce case
* sensitivity.
* @return the expression rewritten with bound references
* @throws ValidationException if literals do not match bound references
* @throws IllegalStateException if any references are already bound
+ * @throws UnsupportedOperationException if the expression calls a function
outside {@code
+ * iceberg_functions}; use {@link #bind(StructType, Expression, boolean,
FunctionBinder)} to
+ * resolve other functions
*/
public static Expression bind(StructType struct, Expression expr, boolean
caseSensitive) {
- return ExpressionVisitors.visit(expr, new BindVisitor(struct,
caseSensitive));
+ return bind(struct, expr, caseSensitive, IcebergFunctions.INSTANCE);
+ }
+
+ /**
+ * Replaces all unbound references with bound references to fields in the
given struct, using a
+ * function binder to resolve function calls.
Review Comment:
"and" uses a function binder to resolve function calls?
Will `iceberg_functions` also be resolved automatically or is the function
binder responsible for that?
--
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]