-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Different serialization behaviour for Postgres hstore type between normal and CDC sync #11953
Comments
I added some test data with type hstore to Postgres DB: How hstore type is represented now by source-postgres: An acceptance criteria for this ticket is to represent For normal mode all Postgres values are mapped on PostgresSourceOperations.setJsonField(). Theoretically to represent
or add one more if-else condition:
But there is a problem with Workaround:
Note: this approach will be working only for new connections and won't work for already configured connection. To make it work for existing connections, customer should refresh source schema on UI. My pessimistic estimation for this implementation is 13 SP as we need to change the build of JSON schema and keep it compatible with other JDBC source-connectors. @grishick could you please share your opinion? Are these steps OK for you? |
@yurii-bidiuk have you looked into using |
Environment
Current Behavior
The Postgres source connector shows a different serialization behaviour for the hstore type between normal and CDC syncs.
Consider the following source data where the
payload
column is of typehstore
:When using CDC, the Postgres source connector will serialize the hstore as a string with value
{"my_key":"my value"}
.However, when using a source without enabled CDC the serialized string has the value
"my_key"=>"my value"
Expected Behavior
The values should be consistent between the two different sync strategies.
The JSON string that the CDC source generates should be more desirable as it is easier to parse. It might even be best to serialize it as an object and not as a string as it could then directly be mapped to a VARIANT in Snowflake without an additional custom transformation that parses the varchar.
Steps to Reproduce
wal2json
plugin and publicationThe text was updated successfully, but these errors were encountered: