Is it possible to have incremental load by Sqoop for teradata on the basic of load time whose datatype is timestamp(6)? How it handles the format while loading in hdfs:
sql exxeption:- expecting something '(' and ').
Is it possible to have incremental load by Sqoop for teradata on the basic of load time whose datatype is timestamp(6)? How it handles the format while loading in hdfs:
sql exxeption:- expecting something '(' and ').
Copyright © 2021 Jogjafile Inc.
So you have one column which is loadtime [type timestamp(6)].
While pulling the data to HDFS you have to create a 3 step process. Also have to create partition in hdfs end.
I prefer this way because you don’t to mess with older data.
But you could use
--incrementaloption in sqoop.0000-00-00 00:00:00.000000WHERE loadtime > ${max_of_loadtime_in_hdfs}. You will be passingmax_of_loadtime_in_hdfsas an argument.Now timestamp format would be different for teradata and hive.
It's better to cast to string while saving it to hive.
So while checking the loadtime with your hive loadtime(string type) you have to cast back to timestamp(6).
So in your condition in sqoop end will be (which ever works for you):
WHERE loadtime > CAST(${max_of_loadtime_in_hdfs} AS TIMESTAMP(6))WHERE loadtime > TO_TIMESTAMP(${max_of_loadtime_in_hdfs}, 'yyyy-mm-dd hh24:mi:ss.ff6')max_of_loadtime_in_hdfs will be something like this
2020-12-31 23:59:59.999999So in your final sqoop query:
hive table definition: