-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[opt](fucntion) improve json_extract function handle const column #36927
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
TPC-H: Total hot run time: 40506 ms
|
TPC-DS: Total hot run time: 174690 ms
|
ClickBench: Total hot run time: 31.28 s
|
4284194
to
02a3f4f
Compare
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
TPC-H: Total hot run time: 39882 ms
|
TPC-DS: Total hot run time: 173377 ms
|
ClickBench: Total hot run time: 30.65 s
|
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
TPC-H: Total hot run time: 40229 ms
|
TPC-DS: Total hot run time: 172842 ms
|
ClickBench: Total hot run time: 30.47 s
|
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
TPC-H: Total hot run time: 39772 ms
|
TPC-DS: Total hot run time: 174389 ms
|
ClickBench: Total hot run time: 30.79 s
|
clang-tidy review says "All clean, LGTM! 👍" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
run buildall |
TPC-H: Total hot run time: 39622 ms
|
TPC-DS: Total hot run time: 173312 ms
|
ClickBench: Total hot run time: 31.06 s
|
…6927) ## Proposed changes VARCHAR json_extract(VARCHAR json_str, VARCHAR path[, VARCHAR path] ...) ``` for (int i = 0; i < arguments.size(); i++) { column_ptrs.push_back( block.get_by_position(arguments[i]).column->convert_to_full_column_if_const()); data_columns.push_back(assert_cast<const ColumnString*>(column_ptrs.back().get())); } before not handle const column, as the input arguments are variadic, and most user case is like: json_extract(column, '$.fparam.nested_2') so could special deal with two arguments could reuse json document. ``` ``` mysql [test]>select count(json_extract(a, '$.fparam.nested_2')) from json_table_2; +---------------------------------------------+ | count(json_extract(a, '$.fparam.nested_2')) | +---------------------------------------------+ | 10000001 | +---------------------------------------------+ 1 row in set (1.06 sec) mysql [test]>select count(json_extract(a, '$.fparam.nested_2')) from json_table_2; +---------------------------------------------+ | count(json_extract(a, '$.fparam.nested_2')) | +---------------------------------------------+ | 10000001 | +---------------------------------------------+ 1 row in set (1.02 sec) mysql [test]> mysql [test]> mysql [test]>select count(json_extract(a, '$.fparam.nested_2')) from json_table_2; +---------------------------------------------+ | count(json_extract(a, '$.fparam.nested_2')) | +---------------------------------------------+ | 10000001 | +---------------------------------------------+ 1 row in set (44.22 sec) mysql [test]>select count(json_extract(a, '$.fparam.nested_2')) from json_table_2; +---------------------------------------------+ | count(json_extract(a, '$.fparam.nested_2')) | +---------------------------------------------+ | 10000001 | +---------------------------------------------+ 1 row in set (42.80 sec) ``` <!--Describe your changes.-->
Proposed changes
VARCHAR json_extract(VARCHAR json_str, VARCHAR path[, VARCHAR path] ...)