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

json, expression: implicitly convert JSON string to time types #53363

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

YangKeao
Copy link
Member

@YangKeao YangKeao commented May 17, 2024

What problem does this PR solve?

Issue Number: close #53243, close #53352

Problem Summary:

Two problem:

  1. TiDB didn't allow inserting json string as an item of DATE/DATETIME/TIMESTAMP array.
  2. TiDB didn't use the correct fsp when converting JSON to DATE/DATETIME/TIMESTAMP.

What changed and how does it work?

  1. Implicitly converting JSON string to DATE/DATETIME/TIMESTAMP when we are converting them to DATE/DATETIME/TIMESTAMP array.
  2. Deprecate the original method GetTime which uses the DefaultFsp, and implement a new method on BinaryJSON to return types.Time with the provided Fsp.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

Fix the issue that JSON string array cannot be converted to DATE/DATETIME/TIMESTAMP array.
Fix the issue that when converting JSON to DATE/DATETIME/TIMESTAMP, the precision is ignored.

Copy link

ti-chi-bot bot commented May 17, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign windtalker for approval. For more information see the Code Review Process.

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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 17, 2024
@YangKeao
Copy link
Member Author

/hold

I remembered another issue: #50370. I need to check whether this PR will bring some potential correctness issue later 🤔 .

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 17, 2024
Copy link

codecov bot commented May 17, 2024

Codecov Report

Attention: Patch coverage is 95.23810% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 74.5644%. Comparing base (1c4a9c6) to head (6abc68d).
Report is 46 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #53363        +/-   ##
================================================
+ Coverage   72.4996%   74.5644%   +2.0647%     
================================================
  Files          1505       1505                
  Lines        429646     430456       +810     
================================================
+ Hits         311492     320967      +9475     
+ Misses        98849      89563      -9286     
- Partials      19305      19926       +621     
Flag Coverage Δ
integration 49.2237% <85.7142%> (?)
unit 71.3363% <80.9523%> (-0.0627%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 50.3892% <ø> (+8.9648%) ⬆️

@YangKeao
Copy link
Member Author

/retest

Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
Copy link

tiprow bot commented May 17, 2024

@YangKeao: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
fast_test_tiprow 6abc68d link true /test fast_test_tiprow

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@YangKeao YangKeao marked this pull request as draft May 24, 2024 06:18
@ti-chi-bot ti-chi-bot bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multi-valued index should implicitly cast the json type Cast json to datetime didn't have a correct fsp
1 participant