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

expression: support JSON for builtin function COALESCE #9087

Merged
merged 6 commits into from Jan 28, 2019

Conversation

Projects
None yet
5 participants
@zz-jason
Copy link
Member

zz-jason commented Jan 16, 2019

Signed-off-by: Jian Zhang zjsariel@gmail.com

What problem does this PR solve?

Support JSON type for builtin function COALESCE, to avoid panic once we returned a nil pointer.

What is changed and how it works?

As the above said.

Check List

Tests

  • Unit test

Related changes

  • Need to cherry-pick to the release branch
expression: support Json for builtin function COALESCE
Signed-off-by: Jian Zhang <zjsariel@gmail.com>
@zz-jason

This comment has been minimized.

Copy link
Member Author

zz-jason commented Jan 16, 2019

/run-all-tests

@eurekaka

This comment has been minimized.

Copy link
Contributor

eurekaka commented Jan 17, 2019

@zz-jason CI failed, PTAL

@XuHuaiyu
Copy link
Contributor

XuHuaiyu left a comment

Please fix ci.

Show resolved Hide resolved expression/integration_test.go Outdated
@@ -202,6 +202,9 @@ func (c *coalesceFunctionClass) getFunction(ctx sessionctx.Context, args []Expre
}
sig = &builtinCoalesceDurationSig{bf}
sig.setPbCode(tipb.ScalarFuncSig_CoalesceDuration)
case types.ETJson:
sig = &builtinCoalesceJsonSig{bf}
sig.setPbCode(tipb.ScalarFuncSig_CoalesceJson)

This comment has been minimized.

@eurekaka

eurekaka Jan 22, 2019

Contributor

We need to update getSignatureByPB as well.

This comment has been minimized.

@zz-jason

zz-jason Jan 28, 2019

Author Member

getSignatureByPB is only used in mocktikv when this function is pushed to the coprocessor. I think we can do it later when we push it?

Show resolved Hide resolved expression/builtin_compare.go Outdated

zz-jason added some commits Jan 28, 2019

@zz-jason

This comment has been minimized.

Copy link
Member Author

zz-jason commented Jan 28, 2019

/run-all-tests

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Jan 28, 2019

Codecov Report

Merging #9087 into master will decrease coverage by 0.01%.
The diff coverage is 69.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9087      +/-   ##
==========================================
- Coverage   67.21%   67.19%   -0.02%     
==========================================
  Files         371      371              
  Lines       76945    76958      +13     
==========================================
- Hits        51721    51715       -6     
- Misses      20606    20622      +16     
- Partials     4618     4621       +3
Impacted Files Coverage Δ
expression/builtin_compare.go 73.9% <69.23%> (+0.1%) ⬆️
util/systimemon/systime_mon.go 80% <0%> (-20%) ⬇️
ddl/delete_range.go 75.13% <0%> (-5.3%) ⬇️
store/tikv/scan.go 73.94% <0%> (-3.37%) ⬇️
executor/index_lookup_join.go 77.28% <0%> (-0.64%) ⬇️
store/tikv/lock_resolver.go 42.65% <0%> (+0.94%) ⬆️

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 7648317...a803afe. Read the comment docs.

@eurekaka
Copy link
Contributor

eurekaka left a comment

LGTM

@XuHuaiyu
Copy link
Contributor

XuHuaiyu left a comment

LGTM

@XuHuaiyu XuHuaiyu added status/LGT2 and removed status/LGT1 labels Jan 28, 2019

@zz-jason zz-jason merged commit 6dcba1f into pingcap:master Jan 28, 2019

13 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
idc-jenkins-ci-tidb/build Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/common-test job succeeded
Details
idc-jenkins-ci-tidb/integration-common-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/integration-compatibility-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/integration-ddl-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/mybatis-test job succeeded
Details
idc-jenkins-ci-tidb/sqllogic-test-1 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/sqllogic-test-2 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/unit-test Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@zz-jason zz-jason deleted the zz-jason:bugfix/coalesce-json branch Jan 28, 2019

zz-jason added a commit to zz-jason/tidb that referenced this pull request Jan 28, 2019

zz-jason added a commit that referenced this pull request Jan 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment