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

Illegal type Nullable(Nothing) of argument of function json_extract #49269

Closed
aytrack opened this issue Dec 8, 2023 · 3 comments
Closed

Illegal type Nullable(Nothing) of argument of function json_extract #49269

aytrack opened this issue Dec 8, 2023 · 3 comments
Labels
severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@aytrack
Copy link
Contributor

aytrack commented Dec 8, 2023

Bug Report

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists t;
create table t(a int, b json);

insert into t values (1, '{ "one potato" : 1 }'), (2, '{ "a.b" : 1 }'), (3, '{ "\\"a\\"": 1}'), (4, '{ "\\"a\\"": 1}'), (5, '{ "a": 1}'), (6, '{ "a": 1}'), (7,  '{ "a": [ [ 3, 2 ], [ { "c" : "d" }, 1 ] ], "b": { "c" : 6 }, "one potato": 7, "b.c" : 8 }'), (9, NULL);

alter table t set tiflash replica 1;
set tidb_enforce_mpp = 1;
select sleep(1);
select /*+ read_from_storage(tiflash[t]) */ json_extract(b, '$.b'), json_extract(NULL, NULL) from t;
explain select /*+ read_from_storage(tiflash[t]) */ json_extract(b, '$.b'), json_extract(NULL, NULL) from t;

introduced by #48550

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

query success

3. What did you see instead (Required)

[11:03:28]TiDB root:test> select /*+ read_from_storage(tiflash[t]) */ json_extract(b, '$.b'), json_extract(NULL, NULL) from t;
(1105, 'other error for mpp stream: Code: 43, e.displayText() = DB::Exception: Illegal type Nullable(Nothing) of argument of function json_extract, e.what() = DB::Exception,')

4. What is your TiDB version? (Required)

[11:05:08]TiDB root:test> select type,version,git_hash  from information_schema.cluster_info;
+---------+-----------------------------+------------------------------------------+
| type    | version                     | git_hash                                 |
+---------+-----------------------------+------------------------------------------+
| tidb    | 7.6.0-alpha-299-gd0feede759 | d0feede7598640dd58038ce56590ccf0b0c76dd6 |
| pd      | 7.6.0-alpha                 | 995fcef820f43758b94a2eeef8cdd91fa08deaea |
| tiflash | 7.6.0-alpha                 | 713bca0a4f65c3217192baf00dc00b8ea7c9dccc |
| tikv    | 7.6.0-alpha                 | 213299221806959c95d05d0f2d7368e597fa9281 |
+---------+-----------------------------+------------------------------------------+
@aytrack aytrack added type/bug The issue is confirmed as a bug. sig/execution SIG execution severity/major labels Dec 8, 2023
@SeaRise
Copy link
Contributor

SeaRise commented Dec 8, 2023

The reason is that json_extract does not handle only null column, not related to cast null as json
/cc @yibin87

@yibin87
Copy link
Contributor

yibin87 commented Dec 8, 2023

The reason is that json_extract does not handle only null column, not related to cast null as json /cc @yibin87

Got, I'll check it

@yibin87
Copy link
Contributor

yibin87 commented Dec 11, 2023

Should be fixed by pingcap/tiflash#8489

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

4 participants