Question

I'm using Pentaho Data Integration (Table Input step) to pull in data from a MySQL server. A couple of fields are of the type 'Timestamp', and Pentaho keeps spewing out errors because of the timestamp being NULL (0000-00-00 00:00:00.000000).

I added a zeroDateTimeBehavior=convertToNull to the parameters which should take care of the bad timestamps, but it's converting all of my Timestamp data to NULL.

One reason why I think it may be happening is because some of my 'good' data is represented as, for example, 2013-03-14 04:55:09.000000. While most of the date is 'good data', the fractional seconds (.000000) might be being interpreted as 'bad' data by the zeroDateTimeBehavior parameter, and is thus being converted to NULL.

I'm not sure if this is why it's happening, but could someone give me some insight as to other probable causes and how in the world I can stop this? Perhaps converting to a string might be a good idea, but I have no idea how to go about doing this.

Suggestions?

Was it helpful?

Solution

Based on this answer, I'd probably change the data type of the field to datetime rather than timestamp. If you don't you'll have to do the conversion in the SQL that reads the data. The previous answer gives examples of how to do that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top