Commits


Benjamin Kietzman authored and Neal Richardson committed 57376d28cf4
ARROW-10322: [C++][Dataset] Minimize Expression This PR replaces the `Expression` class hierarchy with a simpler discriminated union of: - literal values - field references - call expressions which simply wrap a function name, a vector of arguments, and options. ```c++ Expression add_1_to_i32 = call("add", {field_ref("i32"), literal(1)}); ``` This reduces the overhead of supporting new compute functions in dataset filters: execution and validation against a schema are already implemented and tested in `compute::`. Only serialization and equality comparison need to be manually wired up, and only if the function requires nontrivial function options. TODO replace projection with expressions as well. The `struct` function is provided to replace `RecordBatchProjector`, invocable with `call` as with any other compute function: ```c++' Expression projection = call("struct", {field_ref("f32"), add_1_to_i32}, StructOptions{"f32_renamed", "i32 + 1"}); ``` Closes #8894 from bkietz/10322-Minimize-Expression-to-a- Lead-authored-by: Benjamin Kietzman <bengilgit@gmail.com> Co-authored-by: Neal Richardson <neal.p.richardson@gmail.com> Signed-off-by: Neal Richardson <neal.p.richardson@gmail.com>