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

support cast as json #8333

Merged
merged 65 commits into from
Nov 27, 2023
Merged

support cast as json #8333

merged 65 commits into from
Nov 27, 2023

Conversation

SeaRise
Copy link
Contributor

@SeaRise SeaRise commented Nov 8, 2023

What problem does this PR solve?

Issue Number: close #8307 close #8371

Problem Summary:

What is changed and how it works?

Because json and string are both DataTypeString in tiflash, cast as json cannot be implemented in FunctionsTiDBConversion.h, So here we implement cast as json separately.
support

  • CastIntAsJson
  • CastRealAsJson
  • CastDecimalAsJson
  • CastStringAsJson
  • CastTimeAsJson
  • CastDurationAsJson
  • CastJsonAsJson

Introduce simdjson v3.6.0 https://github.com/simdjson/simdjson/releases/tag/v3.6.0 for cast string as json.
Because some functions require tipb::FieldType, pass tipb::FieldType in DAGExpressionAnalyzerHelper.

tidb pr: pingcap/tidb#48550

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

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

None

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed do-not-merge/needs-linked-issue labels Nov 8, 2023
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 8, 2023
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 8, 2023
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 8, 2023
@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 9, 2023
@ti-chi-bot ti-chi-bot bot added the approved label Nov 23, 2023
dbms/src/Common/VectorWriter.h Outdated Show resolved Hide resolved
dbms/src/Common/VectorWriter.h Outdated Show resolved Hide resolved
dbms/src/TiDB/Decode/JsonBinary.cpp Outdated Show resolved Hide resolved
dbms/src/TiDB/Decode/JsonBinary.cpp Outdated Show resolved Hide resolved
dbms/src/Functions/FunctionsJson.h Show resolved Hide resolved
dbms/src/Functions/FunctionsJson.h Outdated Show resolved Hide resolved
dbms/src/Functions/FunctionsJson.h Outdated Show resolved Hide resolved
dbms/src/Functions/FunctionsJson.h Show resolved Hide resolved
dbms/src/Functions/FunctionsJson.h Show resolved Hide resolved
dbms/src/Functions/FunctionsJson.h Outdated Show resolved Hide resolved
@SeaRise
Copy link
Contributor Author

SeaRise commented Nov 23, 2023

/run-all-tests

@SeaRise
Copy link
Contributor Author

SeaRise commented Nov 23, 2023

/run-all-tests

@SeaRise SeaRise requested a review from windtalker November 24, 2023 01:44
dbms/src/Functions/FunctionsJson.h Outdated Show resolved Hide resolved
dbms/src/Functions/FunctionsJson.h Outdated Show resolved Hide resolved
dbms/src/Functions/FunctionsJson.h Outdated Show resolved Hide resolved
dbms/src/Functions/FunctionsJson.h Outdated Show resolved Hide resolved
dbms/src/Functions/FunctionsJson.h Outdated Show resolved Hide resolved
dbms/src/Functions/FunctionsJson.h Show resolved Hide resolved
@SeaRise SeaRise requested a review from windtalker November 27, 2023 04:33
@yibin87 yibin87 mentioned this pull request Nov 27, 2023
12 tasks
@SeaRise SeaRise requested a review from windtalker November 27, 2023 06:18
Copy link
Contributor

@windtalker windtalker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 27, 2023
Copy link
Contributor

ti-chi-bot bot commented Nov 27, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: windtalker, yibin87

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

The pull request process is described 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

Copy link
Contributor

ti-chi-bot bot commented Nov 27, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-11-23 02:11:58.139583374 +0000 UTC m=+456746.804809562: ☑️ agreed by yibin87.
  • 2023-11-27 06:24:10.031744794 +0000 UTC m=+817478.696970989: ☑️ agreed by windtalker.

@SeaRise
Copy link
Contributor Author

SeaRise commented Nov 27, 2023

/merge

Copy link
Contributor

ti-chi-bot bot commented Nov 27, 2023

@SeaRise: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

trigger some heavy tests which will not run always when PR updated.

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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 ti-community-infra/tichi repository.

@SeaRise
Copy link
Contributor Author

SeaRise commented Nov 27, 2023

/run-integration-test

@ti-chi-bot ti-chi-bot bot merged commit d1b149e into pingcap:master Nov 27, 2023
6 checks passed
@SeaRise SeaRise deleted the cast_as_json branch November 27, 2023 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce rapidjson or simdjson? Support castAsJson
3 participants