confluentinc / ksql

The database purpose-built for stream processing applications.
https://ksqldb.io
Other
80 stars 1.04k forks source link

Can't parse RFC3339 / ISO_INSTANT timestamps with variable # of fractional seconds #2876

Open samv opened 5 years ago

samv commented 5 years ago

Some date formatters use as many digits when rendering an instant as needed, effectively trimming trailing zeros. Example: go

This looks like it may be supported by Java's ISO_INSTANT format, which claims to write either 3, 6 or 9 fractional digits out but be able to read from 0 to 9 digits in. However, this cannot be specified as a TIMESTAMP_FORMAT.

Using the format 'yyyy-MM-dd''T''HH:mm:ss.SX' fails even on timestamps which are one of these lengths:

Caused by: Text '2019-05-14T10:25:39.367011Z' could not be parsed at index 21

antonio-lorenzon-ifood commented 4 years ago

try this format yyyy-MM-dd''T''HH:mm:ss.[SSSSSS][SSS]X, works fine for me.