Open findepi opened 5 years ago
Currently this is handled in regex and Json functions by introducing new types for the computed value, and then relying on the constant folder to convert this to constants which are bound into the generated byte code. This is of course pretty cumbersome.
Do you have thoughts on how this would work in practice?
BTW, I'd like to have a system that could capture the "extra" computed values used by PolymorphicScalarFunction.
Some functions are often invoked with one argument being a constant and they do some preparatory computations that do not need to be done for each row.
Example:
date_format
builds a format object from format string, before considering datetime argument.Such functions could benefit from "currying", allowing certain computations to be done when only some argument is bound but not all yet. The "known" argument may be a constant or may be a value which is constant for a batch of rows (e.g. partition key, or anything stored in RLE block).