Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] [seatunnel-connector-flink-jdbc] Data loss occurs when partition_column (partition mode) is set #2032

Closed
3 tasks done
ic4y opened this issue Jun 19, 2022 · 0 comments · Fixed by #2033
Closed
3 tasks done
Labels

Comments

@ic4y
Copy link
Contributor

ic4y commented Jun 19, 2022

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

After setting partition_column, it will cause data loss, and the data loss is equal to the number of partitions.

The reason is that the sql partition read uses partitionColumn >= ? AND partitionColumn + < ? , which does not include the upper bound.

But the upper and lower bounds are not repeated when splitting ParameterValues.

For example

partition_id=(1,2,3,4,5,6,7,8,9,10)
partition number is 2

Then ParameterValues=[[1,5][6,10]]

Two SQL statements will be generated
1、partition_id >= 1 AND partition_id < 5
2、partition_id >= 6 AND partition_id < 10

In this way, two data of id=5 and 10 will be lost. The lost data is equal to the number of partitions. The larger the number of partitions, the more data is lost.

So sql also needs to include the upper bound,like partitionColumn >= ? AND partitionColumn + <= ?

SeaTunnel Version

dev

SeaTunnel Config

None

Running Command

None

Error Exception

None

Flink or Spark Version

No response

Java or Scala Version

No response

Screenshots

image
image

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant