apache / apache/doris-flink-connector

[Feature] Optimize the synchronization of primary key field and unique field

Open
#216 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
385
Forks
279
Avg merge
2d 2h
Merged PRs (30d)
6

Description

### Search before asking

- [X] I had searched in the [issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and found no similar issues.

### Description

如果源数据库表不使用主键,请检查源数据库表中是否存在唯一的键索引。如果表中存在唯一键索引,请使用相应的唯一键索引字段作为Doris唯一键的字段。使用唯一键索引时,有必要调整Doris表创建语句中的字段顺序。这种调整确保了Doris表中的字段与唯一键索引中字段的顺序相匹配

If the source database table does not use a primary key, then check if there is a unique key index in the source database table. If a unique key index exists in the table, use the corresponding unique key index field as the field for the Doris unique key. When using a unique key index, it is necessary to adjust the field order in the Doris table creation statement. This adjustment ensures that the fields in the Doris table match the order of the fields in the unique key index

### Use case

_No response_

### Related issues

_No response_

### Are you willing to submit PR?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by locating the connector logic that reads source-table keys and builds the Doris table definition, then trace how primary and unique indexes are selected. Done means a source table without a primary key can use its unique index, with the Doris unique-key fields and column order matching that index.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
data-engineering, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.