You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "xy (Jira)" <ji...@apache.org> on 2023/03/09 01:50:00 UTC
[jira] [Created] (HUDI-5908) Merge into not get the right value in update action
xy created HUDI-5908:
------------------------
Summary: Merge into not get the right value in update action
Key: HUDI-5908
URL: https://issues.apache.org/jira/browse/HUDI-5908
Project: Apache Hudi
Issue Type: Bug
Components: spark-sql
Reporter: xy
{{val incDF = Seq(
HudiDataWithData(1, "lb", 8, "shu", 1646643412l),
HudiDataWithData(1, "lb", 2, "shu", 1646643412l),
HudiDataWithData(1, "lb", 7, "shu", 1646643412l),
HudiDataWithData(2, "gy", 12, "shu", 1646643193l),
HudiDataWithData(1, "cc", 22, "wei", 1646643193l),
HudiDataWithData(2, "xy", 23, "wei", 1646643193l)
).toDF
incDF.createOrReplaceTempView("inc_table")
spark.sql(
s"""
|create table hudi_cow_pt_tbl (
| id int,
| name string,
| data int,
| country string,
| ts bigint
|) using hudi
|tblproperties (
| type = 'cow',
| primaryKey = 'id',
| preCombineField = 'ts'
| )
|partitioned by (country)
|location 'D:/tmp/hudi_data/hudi_merge_test01'
|""".stripMargin)
spark.sql(
s"""
|merge into hudi_cow_pt_tbl as target
|using (
| select id, name, data, country, ts from inc_table
|) source
|on source.id = target.id
|when matched and source.data > target.data then
|update set target.data = source.data, target.ts = source.ts
|when not matched then
|insert *
|""".stripMargin)}}
h2. A clear and concise description of the problem.
when we query, record with 'lb' is 7 not 8,so it is a bug?
h2. [20230308151658945,20230308151658945_0_0,1,country=wei,c0d7ce20-c40f-4064-8e9c-22d4dd2b1e2a-0_0-14-48_20230309094305111.parquet,1,cc,44,1646643193,wei]
h2. [20230308151658945,20230308151658945_0_1,2,country=wei,c0d7ce20-c40f-4064-8e9c-22d4dd2b1e2a-0_0-14-48_20230309094305111.parquet,2,xy,46,1646643193,wei]
h2. [20230308214428068,20230308214428068_1_0,2,country=shu,28617435-0f34-4c3f-a9e1-859611b68094-0_1-14-49_20230309094305111.parquet,2,gy,12,1646643193,shu]
h2. [20230309094305111,20230309094305111_1_1,1,country=shu,28617435-0f34-4c3f-a9e1-859611b68094-0_1-14-49_20230309094305111.parquet,1,lb,7,1646643412,shu]
{{}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)