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

Closed shiyuhang0 closed 1 year ago

shiyuhang0 commented 1 year ago

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

shiyuhang0 commented 1 year ago

/run-all-tests

shiyuhang0 commented 1 year ago

/run-all-tests

shiyuhang0 commented 1 year ago

/run-all-tests

shiyuhang0 commented 1 year ago

/run-all-tests

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

[APPROVALNOTIFIER] This PR is APPROVED

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

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/master/OWNERS)~~ [xuanyu66] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
ti-chi-bot[bot] commented 1 year ago

[LGTM Timeline notifier]

Timeline:

ti-chi-bot commented 1 year ago

In response to a cherrypick label: new pull request created to branch release-2.5: #2741.

ti-chi-bot commented 1 year ago

In response to a cherrypick label: new pull request created to branch release-3.0: #2742.

ti-chi-bot commented 1 year ago

In response to a cherrypick label: new pull request created to branch release-3.1: #2743.

ti-chi-bot commented 1 year ago

In response to a cherrypick label: new pull request created to branch release-3.2: #2744.

ti-chi-bot commented 1 year ago

In response to a cherrypick label: new pull request created to branch release-2.4: #2745.