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

Feature: decode json to string #417

Merged
merged 6 commits into from
Aug 20, 2018
Merged

Conversation

alex-lx
Copy link
Contributor

@alex-lx alex-lx commented Aug 16, 2018

Convert JSON from binary format to String format. see example below

scala>  spark.sql("select * from json_test where ").show
+-----+--------------------+
|   id|         person_desc|
+-----+--------------------+
|    1|{"authors":[{"fir...|
|    2|        {"abc":null}|
|30001|"12345678\n\"世界12...|
|30002|              "1234"|
|30003|{"abc":123,"efg":...|
+-----+--------------------+

@sre-bot
Copy link
Contributor

sre-bot commented Aug 16, 2018

Hi contributor, thanks for your PR.

This patch needs to be approved by someone of admins. They should reply with "/ok-to-test" to accept this PR for running test automatically.

@codecov-io
Copy link

codecov-io commented Aug 16, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@73f02c1). Click here to learn what that means.
The diff coverage is 4.91%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #417   +/-   ##
=========================================
  Coverage          ?   54.01%           
=========================================
  Files             ?      128           
  Lines             ?     5965           
  Branches          ?      889           
=========================================
  Hits              ?     3222           
  Misses            ?     2446           
  Partials          ?      297
Impacted Files Coverage Δ
...n/java/com/pingcap/tikv/types/DataTypeFactory.java 66% <100%> (ø)
...src/main/java/com/pingcap/tikv/types/JsonType.java 4.13% <4.13%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 73f02c1...7f99f41. Read the comment docs.

@birdstorm
Copy link
Contributor

Hi, @alex-lx. Please let me express my gratitude to your brilliant patch.

I think you could add some tests concerning JSON types, you may refer to some existing tests in IssueTestSuite. I will start the review now.

Copy link
Contributor

@birdstorm birdstorm left a comment

Choose a reason for hiding this comment

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

Nice work, LGTM as long as corresponding tests are added. Or I could add it for you, what do you think? @alex-lx

@alex-lx
Copy link
Contributor Author

alex-lx commented Aug 17, 2018

@birdstorm, thanks for your review. I will add the test soon.

@alex-lx
Copy link
Contributor Author

alex-lx commented Aug 17, 2018

Hello, @birdstorm. Test added, Please take a look.

@alex-lx alex-lx closed this Aug 17, 2018
@alex-lx alex-lx reopened this Aug 17, 2018
@sre-bot
Copy link
Contributor

sre-bot commented Aug 17, 2018

Hi contributor, thanks for your PR.

This patch needs to be approved by someone of admins. They should reply with "/ok-to-test" to accept this PR for running test automatically.

@birdstorm
Copy link
Contributor

/ok-to-test

@birdstorm
Copy link
Contributor

/run-all-tests

Copy link
Contributor

@birdstorm birdstorm left a comment

Choose a reason for hiding this comment

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

Please resolve test fails.

@alex-lx
Copy link
Contributor Author

alex-lx commented Aug 17, 2018

Sorry, I can‘t reproduce the failure in my environment. I think it may cause by the version of tidb. Would you mind if the test does not use judge() to compare with jdbc's result but just compare to the corresponding literal string?

@birdstorm
Copy link
Contributor

@alex-lx Of course, I will handle this test failure. Thanks again for your contribution.

@birdstorm
Copy link
Contributor

/run-all-tests

@birdstorm
Copy link
Contributor

Test fails due to pingcap/tidb#7389

@birdstorm
Copy link
Contributor

/run-all-tests

@birdstorm birdstorm merged commit 7613620 into pingcap:master Aug 20, 2018
@alex-lx alex-lx deleted the feature-decode-json branch August 20, 2018 15:03
birdstorm pushed a commit that referenced this pull request Aug 24, 2018
birdstorm pushed a commit that referenced this pull request Aug 24, 2018
wfxxh pushed a commit to wanfangdata/tispark that referenced this pull request Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants