You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See #567 for a logical prerequisite that makes this feature possible.
The last remaining disparity between Exp API and QL is the lack of user-defined functions in the latter. Let's create a syntax to pass UDFs as QL parameters that would to emulate mapVal(..) and mapBoolVal(..). Some examples...
Anonymous functions passed as positional parameters. Easy to define on the spot, but lack types. ?f is a special parameter syntax that expects a function:
A context for named and typed functions. More effort to setup, but the functions are reusable and the expression syntax is clean:
// Suppose we can even stick one of these contexts in the shared // Environment to define global functionsExpContextcontext = ExpContext.of()
.intFunction("myOp", this::op1)
.boolFunction("myPredicate", this::op2);
df.cols().select(
context,
"myOp(a, b, c, d) > 5 and myPredicate(e, ?)",
100);
Activity