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

Wrong schema of ExchangeSender when expand operator is enabled #56367

Open
gengliqi opened this issue Sep 27, 2024 · 2 comments
Open

Wrong schema of ExchangeSender when expand operator is enabled #56367

gengliqi opened this issue Sep 27, 2024 · 2 comments

Comments

@gengliqi
Copy link
Contributor

gengliqi commented Sep 27, 2024

Bug Report

See pingcap/tiflash#9314.
In the case above, the schema of ExchangeSender_40 should be (nullable_int64, nullable_int64, int64) but the TiDB gives (int64, int64, int64), causing the error when converting a nullable type to a non-nullable type.

1. Minimal reproduce step (Required)

mysql> create table t(a int not null, b int not null);
Query OK, 0 rows affected (0.08 sec)

mysql> insert into t values(1,2);
Query OK, 1 row affected (0.03 sec)

mysql> alter table t set tiflash replica 1;
Query OK, 0 rows affected (0.06 sec)

mysql> set @@tidb_opt_enable_three_stage_multi_distinct_agg=on;
Query OK, 0 rows affected (0.00 sec)

mysql> select count(distinct a), count(distinct b) from t;
ERROR 1105 (HY000): other error for mpp stream: Code: 349, e.displayText() = DB::Exception: Cannot convert NULL value to non-Nullable type, e.what() = DB::Exception,

2. What did you expect to see? (Required)

Run successfully

3. What did you see instead (Required)

Error

4. What is your TiDB version? (Required)

Master

@gengliqi gengliqi added the type/bug The issue is confirmed as a bug. label Sep 27, 2024
@gengliqi
Copy link
Contributor Author

/sig planner

@gengliqi
Copy link
Contributor Author

/cc @AilinKid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants