[
https://issues.apache.org/jira/browse/HUDI-8278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17923253#comment-17923253
]
Ekaterina Belousova edited comment on HUDI-8278 at 2/3/25 10:41 AM:
--------------------------------------------------------------------
in [pr|https://github.com/apache/hudi/pull/12766]add message for flink config
{code:java}
@Test
void testHUDI_8278() {
TableEnvironment tableEnv = batchTableEnv;
String hoodieTableDDL = sql("t1")
.field("id int")
.field("name string")
.field("price double")
.field("ts bigint")
.pkField("id")
.noPartition()
.option(FlinkOptions.RECORD_KEY_FIELD, "name")
.option(FlinkOptions.PATH, tempFile.getAbsolutePath())
.option(FlinkOptions.PAYLOAD_CLASS_NAME,
DefaultHoodieRecordPayload.class.getName())
.end();
tableEnv.executeSql(hoodieTableDDL); final String insertInto1 = "insert
into t1 values\n"
+ "(1,'a1',20,20)";
execInsertSql(tableEnv, insertInto1);
} {code}
!Screenshot from 2025-02-03 17-12-12.png!
was (Author: JIRAUSER308444):
in [ pr #12766|[https://github.com/apache/hudi/pull/12766]] add message for
flink config
{code:java}
@Test
void testHUDI_8278() {
TableEnvironment tableEnv = batchTableEnv;
String hoodieTableDDL = sql("t1")
.field("id int")
.field("name string")
.field("price double")
.field("ts bigint")
.pkField("id")
.noPartition()
.option(FlinkOptions.RECORD_KEY_FIELD, "name")
.option(FlinkOptions.PATH, tempFile.getAbsolutePath())
.option(FlinkOptions.PAYLOAD_CLASS_NAME,
DefaultHoodieRecordPayload.class.getName())
.end();
tableEnv.executeSql(hoodieTableDDL); final String insertInto1 = "insert
into t1 values\n"
+ "(1,'a1',20,20)";
execInsertSql(tableEnv, insertInto1);
} {code}
!Screenshot from 2025-02-03 17-12-12.png!
> HUDI is not honouring specified primary keys while creating table and
> inserting data
> ------------------------------------------------------------------------------------
>
> Key: HUDI-8278
> URL: https://issues.apache.org/jira/browse/HUDI-8278
> Project: Apache Hudi
> Issue Type: Sub-task
> Components: flink-sql, spark-sql
> Affects Versions: 0.15.0
> Reporter: Ranga Reddy
> Assignee: Ekaterina Belousova
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.1.0
>
> Attachments: Screenshot from 2025-02-03 17-12-12.png, Screenshot from
> 2025-02-03 17-34-32.png
>
>
> Create the Hudi table using SQL(Spark/Flink) by specifying primary keys (for
> example id,name) and while inserting the data to hudi table specify the
> different primary keys (for example id,salary). Hudi is not honouring the
> primary keys specified in while creating table. Expectation should be fail
> the application without inserting data.
> **Issue:**
> https://github.com/apache/hudi/issues/12024
--
This message was sent by Atlassian Jira
(v8.20.10#820010)