Repository navigation
[source-postgres] Fix issue #6857 - #53649
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
039a66b to
79628a7
Compare
79628a7 to
b3f1783
Compare
b3f1783 to
6fdb7d1
Compare
6fdb7d1 to
26db658
Compare
26db658 to
e76ac9d
Compare
e76ac9d to
3e51c18
Compare
3e51c18 to
dabb46e
Compare
dabb46e to
6e3863e
Compare
6e3863e to
be764ac
Compare
|
/bump-version type=patch changelog="Fix issue that column default value did not get converted"
|
640ffed to
0dcf30b
Compare
| registration.register(SchemaBuilder.string().optional(), x -> { | ||
| if (x == null) { | ||
| return DebeziumConverterUtils.convertDefaultValue(field); | ||
| return field.isOptional() ? null : getNumberConvertedValue(field.defaultValue()); |
There was a problem hiding this comment.
I understand we need to convert the default value if field.isOptional returns false.
Could you explain why do we replace
DebeziumConverterUtils.convertDefaultValue(field); with getNumberConvertedValue(field.defaultValue()) ?
There was a problem hiding this comment.
Actually you are right, we should use DebeziumConverterUtils. I think we are misuse isOptional as if it's nullable. I will take another look
Yue Li (theyueli)
left a comment
There was a problem hiding this comment.
Thanks for the fix... ideally i'm wondering if we could factor out the structure
if (x == null) {
return field.isOptional() ? null : getXXXTypeConverted(field.defaultValue());
}
I was thinking if we could use
DebeziumConverterUtils.convertDefaultValue(); to replace the getXXXTypeConverted call above, but it seems you are getting rid of the Debezium utility... (and I was wondering why in the comment above I posted)
0dcf30b to
6b7e5ef
Compare
6b7e5ef to
f6aea16
Compare
What
Fixes https://github.com/airbytehq/oncall/issues/6857
We have issue in #6857 about the data conversion error
Currently in our data type converter for debezium, we check if the value is null, if it is and column is non-nullable, we return the default value directly without conversion. Otherwise, return null as is.
Two issues here:
we should convert the default value as well then return it
it appears that we found null value in non-nullable column
How
This PR check if the column is nullable, if so, return null as is
if not, we feed the default value to conversion logic and return the result.
Review guide
User Impact
Can this PR be safely reverted and rolled back?