> > Basically I know the function return a list so I want to access each > element of it. Ideally I can get a List<Expression> ret = > Expressions.call(FindMethod("myFunc")) > Can you elaborate on what do you want? i.e., *List<Expression> ret* If you want to get the element of a method call result, you can evaluate the expression and cast it to list.
For example, assume "myFunc" in SqlFunctions. * public static List<Long> myFunc() { return Arrays.asList(1L, 2L); }* * MethodCallExpression mce = Expressions.call(SqlFunctions.class, "myFunc"); List<Long> ret = (List<Long>) Expressions.evaluate(mce);* Best, Rui Wang <amaliu...@apache.org> 于2019年12月31日周二 下午12:14写道: > Hi community, > > Let's say I define a function like this: > > List<Long> myFunc() { > // function body > // do something > // return a list of long > } > > Then by linq4j library, I can > > Expression ret = Expressions.call( > FindMethod("myFunc") > ) > > > my question is, how to make the returned expression of the call to be a > list, or something equivalent? > > Basically I know the function return a list so I want to access each > element of it. Ideally I can get a List<Expression> ret = > Expressions.call(FindMethod("myFunc")) > > > -Rui >