-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[improvement] adding runtime converter array #4042
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
base: master
Are you sure you want to change the base?
Conversation
Hi @Mrart, maybe you can help to review this. |
@iundarigun Can you update the code and add tests case for postgres pipeline to cover this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ut tests need to be added to cover this requirement.
return null; | ||
} | ||
if (Schema.Type.ARRAY.equals(schema.type()) && dbzObj instanceof List && schema.valueSchema() != null) { | ||
switch (schema.valueSchema().type()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't realize that pgsql array can only support these schema.types. There are more such as Map boleans and so on.
}); | ||
} | ||
|
||
private static Optional<DeserializationRuntimeConverter> createArrayConverter() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a more general way, there is no need to implement only in PostgreSQLDeserializationConverterFactory. Java
Inside, in DebeziumEventDeserializationSchema achieve more appropriate
Description
In the documentation doesn't mention a way to map between postgres type arrays and flink datatype.
Details
This PR add a way to process arrays. For primitive int and long is tranforming in a primitive array to create the
GenericArrayData
, and for String, the elements are being wrapped inStringData
.