0

I have an Elasticsearch SQL sink in a Flink (PyFlink) job, where the sink table looks like:

CREATE TABLE mysink (
  foo TIMESTAMP_LTZ(3)
)
WITH (
   ... my elasticsearch connection details
)

In my Elasticsearch index, field foo has type date.

When I have a streaming insert into that table, I get an error:

failed to parse date field [2023-01-02 00:00:00Z] with format [strict_date_optional_time||epoch_millis]

Flink appears to be writing the field as a SQL format, which Elasticsearch does not accept.

What is the way of having Flink either output to Elasticsearch using ISO-8601 or an epoch millisecond timestamp?

(I know I could change the accepted date time format in my Elasticsearch index, but I'd rather keep the formatting loginc inside Flink, not have to change my storage schema).

John
  • 10,837
  • 17
  • 78
  • 141

0 Answers0