kafka-connect-bigquery icon indicating copy to clipboard operation
kafka-connect-bigquery copied to clipboard

Timestamp conversion issue for big query connector

Open manojgdhv opened this issue 4 years ago • 2 comments

I am using schema-less json with big query connector. I am storing number of milliseconds as a timestamp.

{
	"metadata": {
		"eventTime": 1587677792225,
                  ...
	}
}

I am getting following error while putting data in sync.

[row index 9]: invalid: Timestamp field value is out of range:1587677792225999872

To solve this I tried to add following configuration

 "transforms": "Cast",
 "transforms.Cast.type": "org.apache.kafka.connect.transforms.Cast$Value",
 "transforms.Cast.spec": "metadata.eventTime:int64"

Also , tried to use Timestamp converter

  "transforms": "TimestampConverter",
  "transforms.TimestampConverter.field": "metadata.eventTime",
  "transforms.TimestampConverter.type": "org.apache.kafka.connect.transforms.TimestampConverter$Value",
  "transforms.TimestampConverter.target.type": "Timestamp"

But it seems connect is just ignoring the nested fields.

Does it expected behaviour and is there any other alternative?

manojgdhv avatar Apr 24 '20 11:04 manojgdhv

This seems like more of an issue you are having with the kafka connect framework, rather than KCBQ specifically. Maybe you should bring this question to the confluent folks?

mtagle avatar May 04 '20 22:05 mtagle

I'm having the same issue right now with managed Kafka on Confluent Cloud.

@manojgdhv - have you ever resolved this?

CHarnel avatar Aug 01 '23 12:08 CHarnel