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

Source postgres CDC failing parsing an array or date value #20930

Closed
rodireich opened this issue Dec 29, 2022 · 4 comments
Closed

Source postgres CDC failing parsing an array or date value #20930

rodireich opened this issue Dec 29, 2022 · 4 comments
Assignees
Labels

Comments

@rodireich
Copy link
Contributor

rodireich commented Dec 29, 2022

Environment

  • Deployment: Cloud

  • Source Connector and version: postgres 1.0.34

  • Step where error happened: Sync job

Current Behavior

On an array of date column sync failing with the following error:

2022-12-18 10:32:12 �[44msource�[0m > Failed to properly convert data value for 'public.WaitSpots.unavailableDays' of type _date for row [675bd40d-161a-4557-adc1-c7b19d514503, 4a4b4cee-f406-4ea8-8da6-a04531ebef7f, null, b41e4e0c-b121-4274-9f9b-e6e9800c6cec, {"evenings": true, "mornings": true, "afternoons": true}, null, 2023-01-12T21:00:00.000+0000, 2022-10-23T01:41:40.447+0000, 2022-10-23T01:41:40.447+0000, null, null, {"friday": false, "monday": true, "sunday": false, "tuesday": true, "saturday": false, "thursday": true, "wednesday": true}, {"2020-01-31 20:00:00+00","2020-01-31 21:00:00+00","2020-01-31 22:00:00+00","2020-01-31 23:00:00+00"}, a105e5c4-6b89-4d85-968a-954e35eb2a91, null, Regular Checkup & Cleaning, 7, I got a new job with different benefits let me know if what I entered for that is wrong I have the card on hand for changes necessary. 

, widget, null, ac84e1c4-54cb-488c-80b7-78410251cf5b, null, 12:00 PM,1:00 PM,2:00 PM,3:00 PM]:
Stack Trace: java.lang.NullPointerException: Cannot invoke "org.postgresql.jdbc.PgArray.getArray()" because "x" is null
	at io.airbyte.integrations.debezium.internals.PostgresConverter.convertArray(PostgresConverter.java:145)
	at io.airbyte.integrations.debezium.internals.PostgresConverter.lambda$registerArray$7(PostgresConverter.java:87)
	at io.debezium.relational.CustomConverterRegistry.lambda$getValueConverter$0(CustomConverterRegistry.java:150)
	at io.debezium.relational.TableSchemaBuilder.lambda$createValueGenerator$5(TableSchemaBuilder.java:297)
	at io.debezium.relational.TableSchema.valueFromColumnData(TableSchema.java:141)
	at io.debezium.relational.RelationalChangeRecordEmitter.emitReadRecord(RelationalChangeRecordEmitter.java:87)
	at io.debezium.relational.RelationalChangeRecordEmitter.emitChangeRecords(RelationalChangeRecordEmitter.java:50)
	at io.debezium.pipeline.EventDispatcher.dispatchSnapshotEvent(EventDispatcher.java:155)
	at io.debezium.relational.RelationalSnapshotChangeEventSource.createDataEventsForTable(RelationalSnapshotChangeEventSource.java:407)
	at io.debezium.relational.RelationalSnapshotChangeEventSource.createDataEvents(RelationalSnapshotChangeEventSource.java:316)
	at io.debezium.relational.RelationalSnapshotChangeEventSource.doExecute(RelationalSnapshotChangeEventSource.java:132)
	at io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.execute(AbstractSnapshotChangeEventSource.java:76)
	at io.debezium.pipeline.ChangeEventSourceCoordinator.doSnapshot(ChangeEventSourceCoordinator.java:155)
	at io.debezium.pipeline.ChangeEventSourceCoordinator.executeChangeEventSources(ChangeEventSourceCoordinator.java:137)
	at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:109)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)

Table row parsed as:
2022-12-17 13:54:06 �[44msource�[0m > Table WaitSpots column unavailableDays (type _date[13], nullable false) -> JsonSchemaType({type=array, items={type=string, format=date}})
Note it's non-nullable.

Expected Behavior

Tell us what should happen.

Logs

See connection sync on 12/17/22

@rodireich
Copy link
Contributor Author

I couldn't recreate this error even when syncing date array with values such as
{}
{NULL, NULL}
{"0099-01-08 BC"}

@rodireich
Copy link
Contributor Author

@VitaliiMaltsev , @subodh1810
if you have an idea on what values might lead to the error.

@VitaliiMaltsev
Copy link
Contributor

@rodireich i believe here are original user values of date[] column {"2020-01-31 20:00:00+00","2020-01-31 21:00:00+00","2020-01-31 22:00:00+00","2020-01-31 23:00:00+00"} which lead to the error

INSERT INTO public.date_arr (id, test_column) VALUES (1, '{"2020-01-31 20:00:00+00","2020-01-31 21:00:00+00","2020-01-31 22:00:00+00","2020-01-31 23:00:00+00"}'; is a valid query

@rodireich
Copy link
Contributor Author

Thanks @VitaliiMaltsev
I tried with the value you suggested above. Both incremental and refresh sync pass without a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants