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

remove json_unquote() from expressions-pushed-down.md #5564

Merged
merged 1 commit into from
May 6, 2021

Conversation

kolbe
Copy link
Contributor

@kolbe kolbe commented May 5, 2021

I removed JSON_UNQUOTE() because this expression is not currently pushed down.

pingcap/tidb@721782d

MySQL [test]> explain analyze select count(*) from t2 where json_unquote(json_extract(j, '$[0]')) < 10;
+-----------------------------+---------+---------+-----------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+------+
| id                          | estRows | actRows | task      | access object | execution info                                                                                                                                                                                              | operator info                                                           | memory    | disk |
+-----------------------------+---------+---------+-----------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+------+
| StreamAgg_7                 | 1.00    | 1       | root      |               | time:1.36ms, loops:2                                                                                                                                                                                        | funcs:count(1)->Column#3                                                | 636 Bytes | N/A  |
| └─Selection_11              | 1.60    | 2       | root      |               | time:1.35ms, loops:2                                                                                                                                                                                        | lt(cast(json_unquote(cast(json_extract(cast(test.t2.j), "$[0]")))), 10) | 628 Bytes | N/A  |
|   └─TableReader_13          | 2.00    | 2       | root      |               | time:1.3ms, loops:3, cop_task: {num: 1, max: 1.24ms, proc_keys: 2, rpc_num: 1, rpc_time: 1.22ms, copr_cache_hit_ratio: 0.00}                                                                                | data:TableRangeScan_12                                                  | 219 Bytes | N/A  |
|     └─TableRangeScan_12     | 2.00    | 2       | cop[tikv] | table:t2      | tikv_task:{time:0s, loops:1}, scan_detail: {total_process_keys: 2, total_keys: 4, rocksdb: {delete_skipped_count: 0, key_skipped_count: 2, block: {cache_hit_count: 0, read_count: 0, read_byte: 0 Bytes}}} | range:[0,+inf], keep order:false, stats:pseudo                          | N/A       | N/A  |
+-----------------------------+---------+---------+-----------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+------+
4 rows in set, 1 warning (0.002 sec)

MySQL [test]> show warnings;
+---------+------+----------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                      |
+---------+------+----------------------------------------------------------------------------------------------+
| Warning | 1105 | Scalar function 'json_unquote'(signature: JsonUnquoteSig) can not be pushed to storage layer |
+---------+------+----------------------------------------------------------------------------------------------+
1 row in set (0.000 sec)

First-time contributors' checklist

What is changed, added or deleted? (Required)

Which TiDB version(s) do your changes apply to? (Required)

  • master (the latest development version)
  • v5.0 (TiDB 5.0 versions)
  • v4.0 (TiDB 4.0 versions)
  • v3.1 (TiDB 3.1 versions)
  • v3.0 (TiDB 3.0 versions)
  • v2.1 (TiDB 2.1 versions)

What is the related PR or file link(s)?

  • This PR is translated from:
  • Other reference link(s):

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

I removed JSON_UNQUOTE() because this expression is not currently pushed down.

pingcap/tidb@721782d

```
MySQL [test]> explain analyze select count(*) from t2 where json_unquote(json_extract(j, '$[0]')) < 10;
+-----------------------------+---------+---------+-----------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+------+
| id                          | estRows | actRows | task      | access object | execution info                                                                                                                                                                                              | operator info                                                           | memory    | disk |
+-----------------------------+---------+---------+-----------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+------+
| StreamAgg_7                 | 1.00    | 1       | root      |               | time:1.36ms, loops:2                                                                                                                                                                                        | funcs:count(1)->Column#3                                                | 636 Bytes | N/A  |
| └─Selection_11              | 1.60    | 2       | root      |               | time:1.35ms, loops:2                                                                                                                                                                                        | lt(cast(json_unquote(cast(json_extract(cast(test.t2.j), "$[0]")))), 10) | 628 Bytes | N/A  |
|   └─TableReader_13          | 2.00    | 2       | root      |               | time:1.3ms, loops:3, cop_task: {num: 1, max: 1.24ms, proc_keys: 2, rpc_num: 1, rpc_time: 1.22ms, copr_cache_hit_ratio: 0.00}                                                                                | data:TableRangeScan_12                                                  | 219 Bytes | N/A  |
|     └─TableRangeScan_12     | 2.00    | 2       | cop[tikv] | table:t2      | tikv_task:{time:0s, loops:1}, scan_detail: {total_process_keys: 2, total_keys: 4, rocksdb: {delete_skipped_count: 0, key_skipped_count: 2, block: {cache_hit_count: 0, read_count: 0, read_byte: 0 Bytes}}} | range:[0,+inf], keep order:false, stats:pseudo                          | N/A       | N/A  |
+-----------------------------+---------+---------+-----------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+------+
4 rows in set, 1 warning (0.002 sec)

MySQL [test]> show warnings;
+---------+------+----------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                      |
+---------+------+----------------------------------------------------------------------------------------------+
| Warning | 1105 | Scalar function 'json_unquote'(signature: JsonUnquoteSig) can not be pushed to storage layer |
+---------+------+----------------------------------------------------------------------------------------------+
1 row in set (0.000 sec)
```
@ti-chi-bot ti-chi-bot requested a review from TomShawn May 5, 2021 21:55
@ti-chi-bot ti-chi-bot added missing-translation-status This PR does not have translation status info. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 5, 2021
@TomShawn
Copy link
Contributor

TomShawn commented May 6, 2021

/label needs-cherry-pick-master
/label needs-cherry-pick-4.0
/translation doing
/assign @Liuxiaozhen12
/cc @zz-jason @morgo

@ti-chi-bot ti-chi-bot added the translation/doing This PR's assignee is translating this PR. label May 6, 2021
@ti-chi-bot ti-chi-bot requested review from morgo and zz-jason May 6, 2021 02:33
@ti-chi-bot ti-chi-bot added needs-cherry-pick-master Should cherry pick this PR to master branch. needs-cherry-pick-4.0 and removed missing-translation-status This PR does not have translation status info. labels May 6, 2021
@morgo
Copy link
Contributor

morgo commented May 6, 2021

/LGTM

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • morgo

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label May 6, 2021
@TomShawn
Copy link
Contributor

TomShawn commented May 6, 2021

/lgtm

@TomShawn
Copy link
Contributor

TomShawn commented May 6, 2021

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: b79986f

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label May 6, 2021
@ti-chi-bot ti-chi-bot merged commit 66542ff into pingcap:release-5.0 May 6, 2021
ti-srebot pushed a commit to ti-srebot/docs that referenced this pull request May 6, 2021
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #5565

ti-srebot pushed a commit to ti-srebot/docs that referenced this pull request May 6, 2021
@ti-srebot
Copy link
Contributor

cherry pick to master in PR #5566

@Liuxiaozhen12
Copy link
Contributor

/remove-translation doing
/translation done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-master Should cherry pick this PR to master branch. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants