pingcap / tispark

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

[BUG] TiSpark get error result of blob data #2601

Closed shiyuhang0 closed 1 year ago

shiyuhang0 commented 1 year ago

Describe the bug

  1. Insert with mysql client
    
    CREATE TABLE `test`.`test1` (
    `col_blob0` blob not null,
    `col_double0` double not null,
    `col_bit` bit(1),
    `col_boolean` boolean,
    `col_int` int(11),
    `col_bigint` bigint(20),
    `col_decimal` decimal(11),
    `col_double1` double,
    `col_timestamp` timestamp,
    `col_date` date,
    `col_text` text,
    `col_varchar` varchar(23),
    `col_blob1` blob,
    PRIMARY KEY (`col_blob0`(3),`col_double0`) /*T![clustered_index] CLUSTERED */
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

INSERT INTO test1 VALUES (X'f5ea8adb327f305122c74e759388ba8c13fa0056fb80b717412331343d0f',0.4265801782090245,b'0',1,-1684305197,9021809809890332846,-58427171584,0.7531235568064264,'1993-12-15 16:20:58.89','6766-03-30','woMvrczYuW3lUmch','39kA3QLvFjX9akhExnnnOSV',X'16ed7bd50641ef9e36b8ad92d5ee7baaddb2cd65511a50af8d2686213fb0ac14c9ef18'); INSERT INTO test1 VALUES (X'7c98b474a34b089e78245b1a956365f2d9',0.1078673533176997,b'1',1,null,-8874811870818253822,-45890223104,0.48915445661075796,'1986-08-20 19:08:52.849','1350-10-03','iRsCGQPZlnrgio2tZ4qFYt3a9El54','eevJuuKGAHFLHqelIv00y6Z',X'20d6e8c52014d2e9c1f8caa0df47fd95e62a16f9db990f0e9b00d83e38739017a7d342f897ce5140');

2. get from tispark

select col_blob0 from tidb_catalog.test.test1

3. get result from tispark

+----------+ | col_blob0| +----------+ |[7C 98 B4]| |[F5 EA 8A]| +----------+


4.  get result from MySQL cli

+----------------------------------------------------------------+ | col_blob0 | +----------------------------------------------------------------+ | 0x7C98B474A34B089E78245B1A956365F2D9 | | 0xF5EA8ADB327F305122C74E759388BA8C13FA0056FB80B717412331343D0F | +----------------------------------------------------------------+

**What did you do**
<!-- 
If possible, please provide a code receipt to produce this issue.
e.g., 
1. run `spark-shell --jars xxx.jar`
2. in spark-shell, run 

val df = spark.sql(“select sum(b) from t where a = 1”) df.show(20)

4. update some data through TiDB
6. in spark-shell, run

val df = spark.sql(“select sum(b) from t where a = 1”) df.show(20)


 -->

**What do you expect**
<!-- A clear and concise description of what you expected to happen. -->

**What happens instead**
<!-- If an error occurs, please provide complete error stack. -->

<!-- 
**Screenshots**
If applicable, add screenshots to help explain your problem.
 -->

**Spark and TiSpark version info**
<!-- What version of Spark and TiSpark are you using? (Provide Spark version and run `spark.sql(“select ti_version()”).show(false)` in spark-shell) -->

<!--
**Additional context**
Add any other context about the problem here.
You may also provide TiDB version here if it is related to the issue.
-->
github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 14 days since being marked as stale.