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

Unexpected exception for json_extract: None const type of json path argument of function json_extract, e.what() = DB::Exception, #8510

Closed
SeaRise opened this issue Dec 13, 2023 · 3 comments · Fixed by #8555

Comments

@SeaRise
Copy link
Contributor

SeaRise commented Dec 13, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists test.t_json;
create table test.t_json(col_json json);
alter table test.t_json set tiflash replica 1;
insert into test.t_json values(null), ('[]'), ('{}'), ('{\"a\":{\"c\":{}, \"d\":{}}, \"b\":{\"e\":{}, \"f\":{}}}'); #NO_UNESCAPE

drop table if exists test.t_path;
create table test.t_path(col_path varchar(100));
alter table test.t_path set tiflash replica 1;
insert into test.t_path values(null), ('$'), ('\$[0]'), ('\$[1]'), ('\$.a'), ('\$.b'); #NO_UNESCAPE

set tidb_allow_mpp=1;
set tidb_enforce_mpp=1; 
set tidb_isolation_read_engines='tiflash'; 
select col_json, col_path, json_extract(col_json, col_path) as res from (select * from test.t_json join test.t_path) t order by col_json, col_path;

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

query success

3. What did you see instead (Required)

ERROR 1105 (HY000): other error for mpp stream: Code: 43, e.displayText() = DB::Exception: None const type of json path argument of function json_extract, e.what() = DB::Exception,

4. What is your TiFlash version? (Required)

8.0.11-TiDB-v7.6.0-alpha

@SeaRise SeaRise added the type/bug Issue for bug label Dec 13, 2023
@SeaRise
Copy link
Contributor Author

SeaRise commented Dec 13, 2023

/cc @yibin87

@yibin87
Copy link
Contributor

yibin87 commented Dec 13, 2023

Yeah, it is expected since it's very corner case and doesn't make much sense to use column as path arguments.

@SeaRise
Copy link
Contributor Author

SeaRise commented Dec 13, 2023

Okay, so the severity is set to minor level.

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

Successfully merging a pull request may close this issue.

2 participants