You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Andy Grove (Jira)" <ji...@apache.org> on 2020/12/24 19:06:00 UTC

[jira] [Assigned] (ARROW-10753) [Rust] [DataFusion] Negative numbers in SQL WHERE clause not parsed correctly

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

Andy Grove reassigned ARROW-10753:
----------------------------------

    Assignee: Evan Chan

> [Rust] [DataFusion] Negative numbers in SQL WHERE clause not parsed correctly
> -----------------------------------------------------------------------------
>
>                 Key: ARROW-10753
>                 URL: https://issues.apache.org/jira/browse/ARROW-10753
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Rust - DataFusion
>    Affects Versions: 2.0.0
>         Environment: Any (MacOS 10.15.6)
>            Reporter: Evan Chan
>            Assignee: Evan Chan
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 3.0.0
>
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> Negative numbers in SQL WHERE clauses are not parsed correctly:
>  
> ```
> > create external table blogs stored as PARQUET location '../../testing/data/parquet/generated_simple_numerics/blogs.par0 rows in set. Query took 0 seconds.
> > select reply, blog_id from blogs where blog_id >= -1000;
> InternalError("SQL binary operator cannot be interpreted as a unary operator")
> ```
> The above can be seen with different data files, and with both integer and floating point negative numbers.    The exception comes from planner.rs sql_to_rex() function, in the UnaryOp case, so it is data independent.   [~jorgecarleitao]  seems you have made commits here, WDYT?
> I'm not sure if the problem is SQLParser itself but the fix seems quite easy, basically to parse this:
> UnaryOp \{ op: Minus, expr: Value(Number("1")) }
> It can be seen in latest master also.
> I'm up for contributing a fix if this is confirmed as a bug.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)