Hi,
I am able to load the data into new redshift table from textDelimited file. Which worked fine, I guess it worked in below way.
TextDelimited file I created has DateType column. This DateType column is converted to long value by cascading, and while loading it, it coverts back to Date value by method tupleEntry.getCoercedTuple() . This method is called in JDBCScheme. While calling this method it checks whether fields has type specified.
Below is the code from JDBCScheme.
if ( fields.hasTypes() )
result = tupleEntry.getCoercedTuple( fields.getTypes() );
Now, I tried updating the Redhsift table which I created earlier. It failed with the error "Error converting data, invalid type for parameter: 1".
I am using below RedshiftScheme while updating. In this scheme we do not have fields argument.
RedshiftScheme redshiftScheme =new RedshiftScheme( columnNames, null, updateByColumns );
I guess in this case, TextDelimited converted DateType column to long value. This long value is not coerced into Date while writing into table. Earlier mentioned
getCoercedTuple() method is called only when fields has type. The RedshiftScheme available for update has no Fields argument in it. Due to this Long value is sent to Redshift. Which intern is throwing error.
Not sure if I have explained it clearly. So I have attached both code for creating new redshift table and updating existing redshift table, and also have attached the error log. Please check.