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

[FLINK-33208] Support the writable metadata timestamp #24

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

Tan-JiaLiang
Copy link
Contributor

What is the purpose of the change

Currently, the hbase sink does not support write data with timestamp, which may cause the data to be written out of order. I suggest to support the timestamp writable metadata for hbase connector so that we can set the timestamp when we writing.

Brief change log

  • support the writable metadata timestamp

Verifying this change

This change is already covered by existing tests, such as

  • org.apache.flink.connector.hbase1.HBaseConnectorITCase#testTableSinkWithTimestampMetadata
  • org.apache.flink.connector.hbase2.HBaseConnectorITCase#testTableSinkWithTimestampMetadata

@MartijnVisser
Copy link
Contributor

@ferenc-csaky can you also help with this one? I'll also ping you on some of the other HBase PRs 😅

@Tan-JiaLiang
Copy link
Contributor Author

@MartijnVisser Thanks for all the reviewer request, @ferenc-csaky you can review when you are free, I'll always keep an eye on all my PRs until it finish, thank you master!

@Tan-JiaLiang Tan-JiaLiang force-pushed the FLINK-33208 branch 3 times, most recently from 06f741a to 3e9c4c9 Compare November 6, 2023 07:18
@MartijnVisser
Copy link
Contributor

CC @ferenc-csaky

@Tan-JiaLiang Tan-JiaLiang force-pushed the FLINK-33208 branch 2 times, most recently from ae06346 to fed3c91 Compare November 10, 2023 10:24
Copy link
Contributor

@ferenc-csaky ferenc-csaky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think handling WritableMetadata as an enum makes interactions with the class kinf of hard to read.

I also wondered about is it make sense to handle interactions with WritableMetadata as it has multiple different metadata, while we only have TIMESTAMP for now? I would introduce those changes when there are other metadata type(s), cause if we do not add any, we have unnecessary complexity.

I opened a PR to your fork where I created a TimestampMetadata class and simplified interactions, did some refactor to eliminate duplications.

PTAL

@Tan-JiaLiang
Copy link
Contributor Author

I think handling WritableMetadata as an enum makes interactions with the class kinf of hard to read.

I didn't think much of it at first, I just followed the WritableMetadata design of flink-connector-kafka.. Because I think it's best to be consistent with these kinds of implementations. But I rethink about it, for now the connectors have split into two different projects, and your refactor is better IMO, so +1 for your suggestion.

I also wondered about is it make sense to handle interactions with WritableMetadata as it has multiple different metadata, while we only have TIMESTAMP for now?

Yes, there also FLINK-30460 should also be supported IMO. After this PR merged, I'll support it ASAP.

I cherry-pick your PR and do a little bit of optimization, PTAL.

And one more question, i want to keep your changes, but i want to squash all the commit in one too (maybe it can good for maintainer merge my PR), any suggestion? Seems git can not keep one commit two authors.

@ferenc-csaky
Copy link
Contributor

And one more question, i want to keep your changes, but i want to squash all the commit in one too (maybe it can good for maintainer merge my PR), any suggestion? Seems git can not keep one commit two authors.

Feel free to squash the commit, if you put a co author line to the end of the commit msg that is perfect:

Co-authored-by: Ferenc Csaky <[email protected]>

Copy link
Contributor

@ferenc-csaky ferenc-csaky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, LGTM!

@Tan-JiaLiang
Copy link
Contributor Author

And one more question, i want to keep your changes, but i want to squash all the commit in one too (maybe it can good for maintainer merge my PR), any suggestion? Seems git can not keep one commit two authors.

Feel free to squash the commit, if you put a co author line to the end of the commit msg that is perfect:

Co-authored-by: Ferenc Csaky <[email protected]>

Nice! I got it.

@MartijnVisser MartijnVisser merged commit ce15c1b into apache:main Nov 14, 2023
7 checks passed
MartijnVisser pushed a commit that referenced this pull request Nov 14, 2023
Co-authored-by: Tan-JiaLiang <[email protected]>
Co-authored-by: Ferenc Csaky <[email protected]>
(cherry picked from commit ce15c1b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants