-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix: make sure JOIN ON expression is boolean type #11423
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -988,7 +988,6 @@ statement ok | |
DROP TABLE department | ||
|
||
|
||
# Test issue: https://github.com/apache/datafusion/issues/11269 | ||
statement ok | ||
CREATE TABLE t1 (v0 BIGINT) AS VALUES (-503661263); | ||
|
||
|
@@ -998,11 +997,22 @@ CREATE TABLE t2 (v0 DOUBLE) AS VALUES (-1.663563947387); | |
statement ok | ||
CREATE TABLE t3 (v0 DOUBLE) AS VALUES (0.05112015193508901); | ||
|
||
# Test issue: https://github.com/apache/datafusion/issues/11269 | ||
query RR | ||
SELECT t3.v0, t2.v0 FROM t1,t2,t3 WHERE t3.v0 >= t1.v0; | ||
---- | ||
0.051120151935 -1.663563947387 | ||
|
||
# Test issue: https://github.com/apache/datafusion/issues/11414 | ||
query IRR | ||
SELECT * FROM t1 INNER JOIN t2 ON NULL RIGHT JOIN t3 ON TRUE; | ||
---- | ||
NULL NULL 0.051120151935 | ||
|
||
# ON expression must be boolean type | ||
query error DataFusion error: type_coercion\ncaused by\nError during planning: Join condition must be boolean type, but got Utf8 | ||
SELECT * FROM t1 INNER JOIN t2 ON 'TRUE' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This query is available in PostgreSQL, but not available in Spark. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the error is clear and is a reasonable behavior. If it is important for someone's usecase, perhaps we can add support for it then There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the structure you have now implemented (in the analyzer) makes it pretty easy to support if desired |
||
|
||
statement ok | ||
DROP TABLE t1; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's redundant because the reduce operation will be performed inside the join_on function.