singhpk234 commented on code in PR #17343:
URL: https://github.com/apache/iceberg/pull/17343#discussion_r4189672014


##########
api/src/main/java/org/apache/iceberg/expressions/Expressions.java:
##########
@@ -317,6 +319,55 @@ public static <T> UnboundTerm<T> transform(String name, 
Transform<?, T> transfor
     return new UnboundTransform<>(ref(name), transform);
   }
 
+  /**
+   * Create a reference to a function by identifier, in the catalog of the 
referencing object.
+   *
+   * <p>Identifier parts are used as given and are never parsed or split. A 
part that contains dots
+   * is a single part, not a namespace followed by a function name.
+   *
+   * @param identifier namespace names followed by the function name
+   * @return a function reference
+   */
+  public static FunctionReference function(String... identifier) {
+    return new FunctionReference(null, Arrays.asList(identifier));
+  }
+
+  /**
+   * Create a reference to a function by identifier, in the catalog of the 
referencing object.
+   *
+   * @param identifier namespace names followed by the function name
+   * @return a function reference
+   */
+  public static FunctionReference function(List<String> identifier) {
+    return new FunctionReference(null, identifier);
+  }
+
+  /**
+   * Create a reference to a function in a specific catalog.
+   *
+   * @param catalog a catalog name
+   * @param identifier namespace names followed by the function name
+   * @return a function reference
+   */
+  public static FunctionReference function(String catalog, List<String> 
identifier) {
+    return new FunctionReference(catalog, identifier);
+  }
+
+  /**
+   * Create an expression that applies a function to zero or more arguments.
+   *
+   * <p>Each argument must be a value expression ({@link Term}), a predicate 
({@link Expression}),
+   * or a constant. Constants are converted to {@link Literal}.
+   *
+   * @param function a function reference
+   * @param arguments value expressions, predicates, or constants passed to 
the function
+   * @param <T> the Java type of this term
+   * @return an unbound apply expression
+   */
+  public static <T> UnboundApply<T> apply(FunctionReference function, 
List<Object> arguments) {

Review Comment:
   > This helper may need to be omitted until we have the type hierarchy built 
out with a type for ValueExpression + Predicate, which I think is called 
FUNC_ARG in the spec (maybe FunctionArg here?).
   
   precisely, hence i couldn't find some thing better than Object, should i 
make this package private (so its not a public api ? ) and meanwhile when we 
have the hierarchy changes we could remove this ? 



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

Reply via email to