i’m passing in data from a ComplexDataReader, my metadata has a field “lot_date” of type date, to a postgres table with a matching column. but i’m receiving a warning:
Invalid SQL query. Incompatible types - field lot_date, clover type: date, sql type: DATE
it’s the same error message whether i map it via DB Table/Field mapping
I came across exactly the same thing a while back, wondering what is wrong. The answer is actually in PostgreSQL documentation - PostgreSQL’s DATE is a plain date information without any notion about the time. CloverETL’s date is on the other hand essentially timestamp. The warning basically means, you’re losing precision when you try to insert into a database.
So how to fix it? Easily, either set your database field to TIMESTAMP, or…
Open your metadata and select the field which is causing problems. On the right hand side of the dialog (when you scroll down a tiny bit) is a “Format” option. There is a heuristic which determines what kind of information given field is suppose to carry.
If you leave it blank (i.e. set to default), it is basically exactly the same as you’d set format to DATE & TIME - engine will check against TIMESTAMP data type in your database
If you set DATE only format, your database is going to be checked against DATE data type
If you set TIME only format, your database is going to be checked against TIME data type
thanks for the tip. the designer ui shows “yyyy-MM-dd” as the default setting in the metadata for the date’s format so i assumed that was what it was going to do. as you say, when i actually changed it to “yyyy-MM-dd” the warning went away.