Skip to content

Commit

Permalink
[cdc] source postgres: add optional to schema fields
Browse files Browse the repository at this point in the history
  • Loading branch information
yurii-bidiuk committed May 19, 2022
1 parent 1edc0de commit 3fbe5d4
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void converterFor(final RelationalColumn field, final ConverterRegistrati
}

private void registerText(final RelationalColumn field, final ConverterRegistration<SchemaBuilder> registration) {
registration.register(SchemaBuilder.string(), x -> {
registration.register(SchemaBuilder.string().optional(), x -> {
if (x == null) {
return DebeziumConverterUtils.convertDefaultValue(field);
}
Expand All @@ -56,7 +56,7 @@ private void registerText(final RelationalColumn field, final ConverterRegistrat
}

private void registerDate(final RelationalColumn field, final ConverterRegistration<SchemaBuilder> registration) {
registration.register(SchemaBuilder.string(), x -> {
registration.register(SchemaBuilder.string().optional(), x -> {
if (x == null) {
return DebeziumConverterUtils.convertDefaultValue(field);
} else if (x instanceof PGInterval) {
Expand All @@ -78,7 +78,7 @@ private String convertInterval(final PGInterval pgInterval) {
}

private void registerMoney(final RelationalColumn field, final ConverterRegistration<SchemaBuilder> registration) {
registration.register(SchemaBuilder.string(), x -> {
registration.register(SchemaBuilder.string().optional(), x -> {
if (x == null) {
return DebeziumConverterUtils.convertDefaultValue(field);
} else if (x instanceof Double) {
Expand Down

0 comments on commit 3fbe5d4

Please sign in to comment.