transporter
transporter copied to clipboard
Tailing from postgres to ES : Date type conversion bug
My postgres table contains a datetime column. Naturally this is being converted to ES format when data is written to ES.
transporter works correctly (& converts 2017-01-13 00:31:24.832645+05:30 to 2017-01-13T00:31:24.832645+05:30 correctly) when it copies the data from postgres to ES for the first time.
But when a change occurs in postgres database while it is being tailed, transporter fails to convert the field correctly and so I get this error.
mapper_parsing_exception failed to parse [request_time] false
map[type:illegal_argument_exception reason:Invalid format:
"2017-06-08 23:48:56.447188+05:30" is malformed at " 23:48:56.447188+05:30"]
@aviaryan thanks for the bug report! would you be able to provide some sample data, Pg schema, and ES mapping for the index?
The section of transporter that serializes data in Pg when doing the initial copy is the same as when it's performing the tail so I have been unsuccessful in pinpointing the specific location where this could be happening.
I found that adding a "timestamp with time zone" parser to tailer.go/castifyValue fixed the issue.
Not sure though why it worked on the initial read though.
@aviaryan would you be and to submit a PR with the changes you made so we can review and get a fix in?