Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal error: Failed to coerce types Decimal128(10, 2) and Boolean in BETWEEN expression #3646

Closed
Tracked by #822
andygrove opened this issue Sep 28, 2022 · 3 comments
Labels
bug Something isn't working optimizer Optimizer rules

Comments

@andygrove
Copy link
Member

Describe the bug

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)

DataFusion:

select * from test where a between (select distinct a from test) and (select distinct b from test);

Internal("Optimizer rule 'type_coercion' failed due to unexpected error: Internal error: Failed to coerce types Decimal128(10, 2) and Boolean in BETWEEN expression. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker")

To Reproduce
As shown.

Expected behavior
Should work.

Additional context
None

@andygrove andygrove added bug Something isn't working optimizer Optimizer rules labels Sep 28, 2022
@andygrove
Copy link
Member Author

@liukun4515 You might be interested to see this type coercion issue - I plan on looking at it next week

@andygrove
Copy link
Member Author

It looks like the type coercion aspect has already been fixed in a recent commit. It now fails with a different error:

❯ 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>)")

@andygrove
Copy link
Member Author

I filed a new issue #3667 and will close this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working optimizer Optimizer rules
Projects
None yet
Development

No branches or pull requests

1 participant