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
bug: only_null
for nullable column returns true when column is empty
#8000
Labels
C-bug
Category: something isn't working
Comments
Not related to join, the following case also will return error SELECT (NULL NOT IN (0.1, 0.2, 0.3,0.4)) ::BIGINT FROM t1;
ERROR 1105 (HY000): Code: 1010, displayText = Can't cast column from null into non-nullable type (while in processor thread 0). |
Hi @xudong963 |
You can check the explain mysql> explain SELECT (false and NULL NOT IN (0.1, 0.2, 0.3)) ::BIGINT FROM t1,t0;
+------------------------------------------------------------+
| explain |
+------------------------------------------------------------+
| EvalScalar |
| ├── expressions: [0] |
| └── HashJoin |
| ├── join type: CROSS |
| ├── build keys: [] |
| ├── probe keys: [] |
| ├── filters: [] |
| ├── TableScan(Build) |
| │ ├── table: default.default.t0 |
| │ ├── read rows: 0 |
| │ ├── read bytes: 0 |
| │ ├── partitions total: 0 |
| │ ├── partitions scanned: 0 |
| │ └── push downs: [filters: [], limit: NONE] |
| └── TableScan(Probe) |
| ├── table: default.default.t1 |
| ├── read rows: 1 |
| ├── read bytes: 30 |
| ├── partitions total: 1 |
| ├── partitions scanned: 1 |
| └── push downs: [filters: [], limit: NONE] |
+------------------------------------------------------------+
21 rows in set (0.04 sec)
Read 0 rows, 0.00 B in 0.004 sec., 0 rows/sec., 0.00 B/sec.
mysql> explain SELECT (false and NULL NOT IN (0.1, 0.2, 0.3,0.4)) ::BIGINT FROM t1,t0;
+------------------------------------------------------------------------------------------+
| explain |
+------------------------------------------------------------------------------------------+
| EvalScalar |
| ├── expressions: [CAST(and(false, not(in(NULL, (0.1, 0.2, 0.3, 0.4)))) AS BIGINT)] |
| └── HashJoin |
| ├── join type: CROSS |
| ├── build keys: [] |
| ├── probe keys: [] |
| ├── filters: [] |
| ├── TableScan(Build) |
| │ ├── table: default.default.t0 |
| │ ├── read rows: 0 |
| │ ├── read bytes: 0 |
| │ ├── partitions total: 0 |
| │ ├── partitions scanned: 0 |
| │ └── push downs: [filters: [], limit: NONE] |
| └── TableScan(Probe) |
| ├── table: default.default.t1 |
| ├── read rows: 1 |
| ├── read bytes: 30 |
| ├── partitions total: 1 |
| ├── partitions scanned: 1 |
| └── push downs: [filters: [], limit: NONE] |
+------------------------------------------------------------------------------------------+
21 rows in set (0.03 sec)
Read 0 rows, 0.00 B in 0.005 sec., 0 rows/sec., 0.00 B/sec.
mysql> The result depends on how databend processes |
sundy-li
changed the title
bug: return error after adding form and join
bug: return error after adding from and join
Oct 1, 2022
xudong963
changed the title
bug: return error after adding from and join
bug: Oct 8, 2022
only_null
for nullable column returns true when column is empty
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Search before asking
Version
main
What's Wrong?
return error after adding form and join.
ref clickhouse
How to Reproduce?
Are you willing to submit PR?
The text was updated successfully, but these errors were encountered: