[
https://issues.apache.org/jira/browse/ARROW-11174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Neal Richardson resolved ARROW-11174.
-------------------------------------
Resolution: Fixed
Issue resolved by pull request 9532
[https://github.com/apache/arrow/pull/9532]
> [C++][Dataset] Make Expressions available for projection
> --------------------------------------------------------
>
> Key: ARROW-11174
> URL: https://issues.apache.org/jira/browse/ARROW-11174
> Project: Apache Arrow
> Issue Type: New Feature
> Components: C++
> Affects Versions: 2.0.0
> Reporter: Ben Kietzman
> Assignee: Ben Kietzman
> Priority: Major
> Labels: pull-request-available
> Fix For: 4.0.0
>
> Time Spent: 5h
> Remaining Estimate: 0h
>
> RecordBatchProjector should be replaced by an expression calling the
> "project" compute function.
> Projection currently supports only reordering and subselection of fields,
> materializing virtual columns where necessary. Replacement with an Expression
> will enable specifying arbitrary expressions for projected columns:
> {code:java}
> // project an explicit selection:
> // SELECT a as "a", b as "b" ...
> project({field_ref("a"), field_ref("b")}, {"a", "b"});
> // project an arithmetic expression:
> // SELECT a + b as "a + b" ...
> project({add(field_ref("a"), field_ref("b"))}, {"a + b"}){code}
> This will also allow the same expression optimization machinery used for
> filters to be directly applied to projections. Virtual columns become a
> consequence of constant folding:
> {code:java}
> // project in a partition where a == 3:
> assert(
> SimplifyWithGuarantee(
> project({field_ref("a"), field_ref("b")}, {"a", "b"}),
> equal(field_ref("a"), literal(3))
> )
> == project({literal(3), field_ref("b")}, {"a", "b"})
> ){code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)