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

bug: const types and nullable types are orthogonal #7241

Closed
1 of 2 tasks
hanyisong opened this issue Aug 22, 2022 · 1 comment
Closed
1 of 2 tasks

bug: const types and nullable types are orthogonal #7241

hanyisong opened this issue Aug 22, 2022 · 1 comment
Labels
C-bug Category: something isn't working

Comments

@hanyisong
Copy link
Contributor

Search before asking

  • I had searched in the issues and found no similar issues.

Version

8.0.26-v0.8.4-nightly-87ecd91-simd(rust-1.64.0-nightly-2022-08-21T16:33:10.834077235Z)

What's Wrong?

Code: 1058, displayText = downcast column error, column type: "Const(Nullable(Primitive))", expected column: "common_datavalues::columns::nullable::NullableColumn" (while in processor thread 3).

How to Reproduce?

CREATE DATABASE databend6;
USE databend6;
CREATE TABLE t0(c0 VARCHAR NULL DEFAULT(0.6883473878718107), c1 INT NOT NULL DEFAULT(1344832732));
CREATE TABLE t1(c0 VARCHAR NULL);

SELECT SUM(count) FROM (SELECT (((-1496301598 BETWEEN -426740132 AND -1105232984) IS NOT NULL AND (-1496301598 BETWEEN -426740132 AND -1105232984)) ::BIGINT)as count FROM t1 LEFT  JOIN t0 ON ((4.87945184e8)<(0.10443958640098572))) as res;

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@hanyisong hanyisong added the C-bug Category: something isn't working label Aug 22, 2022
@sundy-li
Copy link
Member

sundy-li commented Aug 24, 2022

It's fixed in the latest version.


databend > SELECT SUM(count) FROM (SELECT (((-1496301598 BETWEEN -426740132 AND -1105232984) IS NOT NULL AND (-1496301598 BETWEEN -426740132 AND -1105232984)) ::BIGINT)as count FROM t1 LEFT  JOIN t0 ON ((4.87945184e8)<(0.10443958640098572))) as res;
+------------+
| SUM(count) |
+------------+
|          0 |
+------------+
1 row in set (0.107 sec)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants