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

executor: support single precision value in json agg #37389

Merged
merged 2 commits into from
Aug 29, 2022

Conversation

YangKeao
Copy link
Member

Signed-off-by: YangKeao [email protected]

What problem does this PR solve?

Issue Number: close #37287

Problem Summary:

The json_objectagg and json_arrayagg can receive float now 🍻 .

What is changed and how it works?

Convert the float value into double before writing into the map. I also moved the validation/conversion of data type from AppendFinalResult2Chunk to UpdatePartialResult, which will make it find the problem or convert the data ASAP.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code
CREATE TABLE t1 (a FLOAT, b DOUBLE, c DECIMAL(10, 2));
INSERT INTO t1 VALUES (1.0, 2.0, 3.0),(1.0, 3.0, 9.0),(1.0, 4.0, 16.0),(1.0, 5.0, 25.0);
SELECT JSON_VALID(JSON_ARRAYAGG(a)) FROM t1;

It gives

+------------------------------+
| JSON_VALID(JSON_ARRAYAGG(a)) |
+------------------------------+
|                            1 |
+------------------------------+

Release note

Fix the issue that the single precision float cannot be used in json aggregation funtions

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 25, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • xhebox
  • xiongjiwei

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 submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/needs-triage-completed release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 25, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Aug 25, 2022

@xiongjiwei

This comment was marked as resolved.

@xiongjiwei
Copy link
Contributor

please add the manual test into the test file

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 29, 2022
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Aug 29, 2022
@xhebox
Copy link
Contributor

xhebox commented Aug 29, 2022

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: cfa5c01

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 29, 2022
@ti-chi-bot ti-chi-bot merged commit a1af5af into pingcap:master Aug 29, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Aug 29, 2022

TiDB MergeCI notify

🔴 Bad News! [2] CI still failing after this pr merged.
These failed integration tests don't seem to be introduced by the current PR.

CI Name Result Duration Compare with Parent commit
idc-jenkins-ci-tidb/common-test 🔴 failed 2, success 9, total 11 13 min Existing failure
idc-jenkins-ci-tidb/integration-common-test 🔴 failed 2, success 15, total 17 12 min Existing failure
idc-jenkins-ci/integration-cdc-test 🟢 all 36 tests passed 36 min Existing passed
idc-jenkins-ci-tidb/tics-test 🟢 all 1 tests passed 18 min Existing passed
idc-jenkins-ci-tidb/sqllogic-test-2 🟢 all 28 tests passed 7 min 52 sec Existing passed
idc-jenkins-ci-tidb/integration-ddl-test 🟢 all 6 tests passed 5 min 26 sec Existing passed
idc-jenkins-ci-tidb/sqllogic-test-1 🟢 all 26 tests passed 5 min 14 sec Existing passed
idc-jenkins-ci-tidb/mybatis-test 🟢 all 1 tests passed 3 min 53 sec Existing passed
idc-jenkins-ci-tidb/integration-compatibility-test 🟢 all 1 tests passed 3 min 37 sec Existing passed
idc-jenkins-ci-tidb/plugin-test 🟢 build success, plugin test success 4min Existing passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON_ARRAYAGG reprot unsupported second argument type
5 participants