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

Tracking(sink datatype mapping): sink type mismatch for jdbc and Debezium #9604

Closed
4 of 5 tasks
wugouzi opened this issue May 5, 2023 · 4 comments
Closed
4 of 5 tasks
Assignees
Milestone

Comments

@wugouzi
Copy link
Contributor

wugouzi commented May 5, 2023

When doing sinking, RisingWave type may need to be mapped to different types based on type of sink(Debezium, jdbc, etc.) and target DBMS (MySQL, PostgreSQL, etc.). Below is a list of things that need to be done.

@github-actions github-actions bot added this to the release-0.20 milestone May 5, 2023
@wugouzi wugouzi added the type/fix Bug fix label May 5, 2023
@wugouzi wugouzi self-assigned this May 5, 2023
@StrikeW
Copy link
Contributor

StrikeW commented May 31, 2023

  • For Date, Debezium maps it to int32, but jdbc requires a string.

I think you mean the JSON payload of Jdbc sink, after #9957 JDBC sink can support Date.

#9957 added a flag to control how Sink converts the Timestamp in JSON format:

(DataType::Timestamp, ScalarRefImpl::Timestamp(v)) => match timestamp_handling_mode {
TimestampHandlingMode::Milli => json!(v.0.timestamp_millis()),
TimestampHandlingMode::String => json!(v.0.format("%Y-%m-%d %H:%M:%S%.6f").to_string()),

But I think we can use the string representation to unify the implementation of Kafka sink and JDBC sink (JSON payload). IMO, we don't need to stick to the data type mapping of the debezium‘s Postgres connector. Making the output JSON format consistent with Debzium JSON is enough. cc @neverchanje

@tabVersion
Copy link
Contributor

IMO, we don't need to stick to the data type mapping of the debezium‘s Postgres connector. Making the output JSON format consistent with Debzium JSON is enough. cc @neverchanje

from my perspective, I accept any data format, as long as it can be ingested by the majority of downstream CDC tools. At this moment, I think sticking to debezium doc is the safest way.
Besides, if we adopt debezium type mapping table as our source of truth, there can be minor modifications when we align with customer's system in the future.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 7, 2023

This issue has been open for 60 days with no activity. Could you please update the status? Feel free to continue discussion or close as not planned.

@hzxa21
Copy link
Collaborator

hzxa21 commented Sep 11, 2023

The remaining work is tracked in #9603. I will close this issue for now. Feel free to reopen if needed.

@hzxa21 hzxa21 closed this as completed Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants