Skip to content

Add support for scalar subqueries in BETWEEN expressions #3667

Closed
@andygrove

Description

@andygrove

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

echo "1,2" > test.csv
❯ create external table test (a decimal(10,2), b decimal(10,2)) stored as csv location 'test.csv';
0 rows in set. Query took 0.002 seconds.
❯ select * from test where a between (select distinct a from test) and (select distinct b from test);

NotImplemented("Physical plan does not support logical expression (<subquery>)")

This works fine in Postgres:

select * from test where a between (select distinct a from test) and (select distinct b from test);
  a   |  b   
------+------
 1.00 | 2.00
(1 row)

Describe the solution you'd like
Make this query work

Describe alternatives you've considered
None

Additional context
None

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestoptimizerOptimizer rulessqlSQL Planner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions