I have tried almost every solution from SO but still same issue. I have a CSV file in S3 and a table in Redshift.
Table structure is as below:
like_id => inetger
p_id => integer
c_id => integer
date_added => timestamp (without time zone)
CSV file contains data as:
1|1234|9876|2012-08-12 03:30:00
...
...
1500|4545|87545|2019-01-15 08:10:00
When i run the COPY commnad in RedShift, it gives an error of Invalid timestamp format or value [YYYY-MM-DD HH:MI:SS]
, i have tried almost all time date format from RedShift but still stuck. COPY command is below:
copy likes from 's3://<myBucketPath>/like.csv'
credentials 'aws_iam_role=<IAM-Role-Here>'
delimiter '|' region 'us-west-2'
timeformat 'YYYY-MM-DD HH:MI:SS';
//timeformat 'MM/DD/YYYY HH:MI:SS'
//dateformat as 'auto'
//timeformat as 'auto'
NOTE: I exported my table from MySQL in CSV format and date_added
column's data type is datetime
COPY
command? - John Rotensteindate_added
column asString
and in target table i choose thetimestamp
datatype . in result , job skip the date_added column and add NULL to date_added column in database table. - Muhammad Hashir Anwaar