All Forums Tools
aaibinder 9 posts Joined 08/16
25 Aug 2016
TPT Script - Import from TD into HDFS.

I've been searching for this in documentation all day, maybe someone knows this already.
I have read that since version 15.0, it's possible to go from a TPT script directly into HDFS. Right now my script creates the file in local, then uploads it, then deletes it. Anyway to to this more efficiently? Maybe a code sample I can reverse engineer?

feinholz 1234 posts Joined 05/08
25 Aug 2016

As with any other TD-to-flat-file TPT scenario, you can use the Export-operator-to-DC-operator scenario.
This will export data from Teradata and write to HDFS.
Just provide the information for the proper DC operator attributes to talk to HDFS.
It is all documented.

--SteveF

aaibinder 9 posts Joined 08/16
01 Sep 2016

Is it possible to ask for an example of this code? I am not finding it in the documentation anywhere and I've been looking. Please and thank you!

feinholz 1234 posts Joined 05/08
01 Sep 2016

TPT provides samples in a "samples" directory where TPT is installed.
Look in the directory called "userguide" inside "samples". 
PTS00029 shows an example of reading from HDFS and loading into Teradata.
Going the other way around is pretty simple and inuititive.
The documentation does provide the information for the needed attributes.
Reading from HDFS and writing to HDFS is exactly the same as reading/writing from/to flat files on a local filesystem except with HDFS you provide us with the HadoopHost hostname or IP address.
It is that simple.
 

--SteveF

aaibinder 9 posts Joined 08/16
01 Sep 2016

Thanks, I got it. Just gotta put HadoopHost = 'default' in the target attributes and use the HDFS:://server in the FileName!

You must sign in to leave a comment.