Skip to content

[substrait] [sqllogictest] Operator precedence in SQL parsing #18794

@hsiang-c

Description

@hsiang-c

Describe the bug

We tried to test a few arithmetic overflow cases in sqllogictest and found that :: has higher precedence over minus sign (-).

To Reproduce

> select -128::tinyint;
Arrow error: Cast error: Can't cast value 128 to type Int8

> select (-128)::tinyint;
+-------------+
| Int64(-128) |
+-------------+
| -128        |
+-------------+
1 row(s) fetched.
Elapsed 0.003 seconds.

Expected behavior

> select -128::tinyint;
+-------------+
| Int64(-128) |
+-------------+
| -128        |
+-------------+

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions