CallMethodViaReflection Expression¶
CallMethodViaReflection is a non-deterministic expression that represents a static method call (in Scala or Java) using reflect and java_method standard functions.
CallMethodViaReflection supports fallback mode for expression code generation.
Creating Instance¶
CallMethodViaReflection takes the following to be created:
- Children Expressions
CallMethodViaReflection is created when:
reflectstandard function is used
evalInternal¶
Nondeterministic
evalInternal is part of the Nondeterministic abstraction.
evalInternal...FIXME
initializeInternal¶
Nondeterministic
initializeInternal is part of the Nondeterministic abstraction.
initializeInternal...FIXME
Demo¶
import org.apache.spark.sql.catalyst.expressions.CallMethodViaReflection
import org.apache.spark.sql.catalyst.expressions.Literal
val expr = CallMethodViaReflection(
Literal("java.time.LocalDateTime") ::
Literal("now") :: Nil)
scala> println(expr.numberedTreeString)
00 reflect(java.time.LocalDateTime, now, true)
01 :- java.time.LocalDateTime
02 +- now