Kafka connect failed sink data to cratedb while the data doesn't exist in record

We’re using CrateDB 5.10.11, and using kafka connect sink data to it, after running for a while the connect encounter below error.

But the record don’t contain the value 08:11:26.000Z, so I confused, how to locate the root cause, thanks in advance. For details about the error, please see the attachment.

aborted: ERROR: Cannot cast value 08:11:26.000Z to type timestamp without time zoneWhere: io.crate.exceptions.SQLExceptions.esToCrateException(SQLExceptions.java:211)io.crate.exceptions.SQLExceptions.prepareForClientTransmission(SQLExceptions.java:200)io.crate.protocols.postgres.Messages.sendErrorResponse(Messages.java:195)io.crate.protocols.postgres.Messages.sendErrorResponse(Messages.java:188)io.crate.protocols.postgres.PostgresWireProtocol.handleSync(PostgresWireProtocol.java:763)io.crate.protocols.postgres.PostgresWireProtocol$MessageHandler.dispatchMessage(PostgresWireProtocol.java:360)io.crate.protocols.postgres.PostgresWireProtocol$MessageHandler.dispatchState(PostgresWireProtocol.java:329)io.crate.protocols.postgres.PostgresWireProtocol$MessageHandler.channelRead0(PostgresWireProtocol.java:297)io.crate.protocols.postgres.PostgresWireProtocol$MessageHandler.channelRead0(PostgresWireProtocol.java:281)

kafka_connect_crate.txt (11.1 KB)

table_definition.txt (21.1 KB)

1 Like

Hi, in the kafka_connect_crate.txt I can see the value: 08:11:26.000Z, it’s missing the date part of the timestamp.

With a ddl:

create table t ("somecol" TIMESTAMP WITH TIME ZONE)

This will fail:

insert into t values ('08:11:26.000Z') -- <- WRONG

But this will succeed

insert into t values ('1990-01-01T08:11:26.000Z')
1 Like

Hi @surister , I couldn’t find the value 08:11:26.000Z in the INSERT SQL statement. I’m confused about where this value comes from.

Sorry for taking up your time, I should have caught such an obvious mistake. Thanks for pointing it out.

1 Like

Don’t worry about it! Sometimes we just need a fresh pair of eyes. Happy to be of assistance!!

1 Like