transporter icon indicating copy to clipboard operation
transporter copied to clipboard

Tailing from postgres to ES : Date type conversion bug

Open aviaryan opened this issue 8 years ago • 3 comments

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 avatar Jun 08 '17 18:06 aviaryan

@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.

jipperinbham avatar Jun 16 '17 14:06 jipperinbham

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 avatar Jul 02 '17 04:07 aviaryan

@aviaryan would you be and to submit a PR with the changes you made so we can review and get a fix in?

jipperinbham avatar Aug 10 '17 13:08 jipperinbham