pingcap / tispark

TiSpark is built for running Apache Spark on top of TiDB/TiKV
Apache License 2.0
883 stars 244 forks source link

Fix TiFlash overflow (#2740) #2745

Open ti-chi-bot opened 1 year ago

ti-chi-bot commented 1 year ago

This is an automated cherry-pick of #2740

What problem does this PR solve?

Reproduce:

create and insert

CREATE TABLE test.t(`a` bigint(20) UNSIGNED NOT NULL)
insert into t values (16717361816800086255)

query from tispark with tiflash returns an error result(negative number)

 spark.conf
        .set("spark.tispark.isolation_read_engines","tiflash")
spark.sql("select * from tidb_catalog.test.t").show()

What is changed and how it works?

TiSpark requests TiFlash using TypeCHBlock encode, but forgets to handle the UNSIGNED scenes when decoded.

this pr shows how to decode it corretly

Check List

Tests

Code changes

Side effects

Related changes

shiyuhang0 commented 1 year ago

/run-all-tests profile=scala-2.12

ti-chi-bot[bot] commented 1 year ago

@shiyuhang0: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to [this](https://github.com/pingcap/tispark/pull/2745#pullrequestreview-1560448376): > Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
ti-chi-bot[bot] commented 1 year ago

@xuanyu66: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to [this](https://github.com/pingcap/tispark/pull/2745#pullrequestreview-1560450172): > Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
shiyuhang0 commented 1 year ago

/merge

ti-chi-bot[bot] commented 1 year ago

@shiyuhang0: We have migrated to builtin LGTM and approve plugins for reviewing.

Please use /approve when you want approve this pull request.

The changes announcement: LGTM plugin changes

Instructions for interacting with me using PR comments are available [here](https://prow.tidb.net/command-help). If you have questions or suggestions related to my behavior, please file an issue against the [ti-community-infra/tichi](https://github.com/ti-community-infra/tichi/issues/new?title=Prow%20issue:) repository.
xuanyu66 commented 1 year ago

/approve

shiyuhang0 commented 1 year ago

/run-all-tests profile=scala-2.12

ti-chi-bot[bot] commented 1 year ago

[LGTM Timeline notifier]

Timeline:

ti-chi-bot[bot] commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: shiyuhang0, xuanyu66

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: - ~~[OWNERS](https://github.com/pingcap/tispark/blob/release-2.4/OWNERS)~~ [shiyuhang0,xuanyu66] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
shiyuhang0 commented 1 year ago

/merge

ti-chi-bot[bot] commented 1 year ago

@shiyuhang0: We have migrated to builtin LGTM and approve plugins for reviewing.

Please use /approve when you want approve this pull request.

The changes announcement: LGTM plugin changes

Instructions for interacting with me using PR comments are available [here](https://prow.tidb.net/command-help). If you have questions or suggestions related to my behavior, please file an issue against the [ti-community-infra/tichi](https://github.com/ti-community-infra/tichi/issues/new?title=Prow%20issue:) repository.