You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Todd Farmer (Jira)" <ji...@apache.org> on 2022/07/12 14:05:02 UTC

[jira] [Assigned] (ARROW-3458) [Gandiva] Add a string based expression parser

     [ https://issues.apache.org/jira/browse/ARROW-3458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Todd Farmer reassigned ARROW-3458:
----------------------------------

    Assignee:     (was: Praveen Krishna)

This issue was last updated over 90 days ago, which may be an indication it is no longer being actively worked. To better reflect the current state, the issue is being unassigned. Please feel free to re-take assignment of the issue if it is being actively worked, or if you plan to start that work soon.

> [Gandiva] Add a string based expression parser
> ----------------------------------------------
>
>                 Key: ARROW-3458
>                 URL: https://issues.apache.org/jira/browse/ARROW-3458
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: C++, C++ - Gandiva
>            Reporter: Pindikura Ravindra
>            Priority: Major
>              Labels: gandiva
>
> Gandiva currently supports a tree-based expression builder. This requires writing a lot of code for even simple expressions.
> For eg. to build an expression for "a + b < 10", the code is :
> {code:java}
>    // schema for input fields
>   auto field0 = field("a", int32());
>   auto field1 = field("b", int32());
>   auto schema = arrow::schema({field0, field1});
>   // output fields
>   auto field_result = field("res", boolean());
>   // Build expression
>   auto node_f0 = TreeExprBuilder::MakeField(field0);
>   auto node_f1 = TreeExprBuilder::MakeField(field1);
>   auto literal_10 = TreeExprBuilder::MakeLiteral(10);
>   auto sum_expr =
>       TreeExprBuilder::MakeFunction("add", {node_f0, node_f1}, int32());
>   auto lt_expr =
>       TreeExprBuilder::MakeExpression("less_than", {sum_expr, literal_10}, field_result);
> {code}
> An alternate way to do this would be :
>  
> {code:java}
> // Build expression
> auto expr = StringExprBuilder::MakeExpression(schema, "a + b < 10", field_result);
> {code}
> The expression syntax should be close to that of SQL.
>  
> To begin with, this'll simplify writing tests. And, it will provide an easier api to work with gandiva.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)