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) #2742

Closed ti-chi-bot closed 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-test

shiyuhang0 commented 1 year ago

/run-all-tests

shiyuhang0 commented 1 year ago

/run-all-tests

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/2742#pullrequestreview-1560446503): > 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/2742#pullrequestreview-1560451158): > 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

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/pingcap/tispark/blob/release-3.0/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment