Is it possible to read a file inside JUDF? The file is embedded inside the jar and read as a stream using the below code.
InputStream in = this.getClass().getClassLoader().getResourceAsStream("<FILE_LOC>");
The code works fine when executed outside but the input stream object "in" is coming as null in UDF.
I was not able to execute the line of code which you shared because of missing ClassLoader function in "this" object. Tried all the suggestions that from the link but facing the same.
If no one else replies soon, I'd recommend opening an incident with Teradata - that should result in a definite answer from an expert.
From the "be careful what you ask for" department...
If there are 100 AMPs on your system and 1M rows in the table on which you run the select that invokes the JUDF, the result will be 1M file opens, 100 concurrently. A UDF is invoked for each row of the query set and is invoked independently on each AMP.
For that reason, UDFs don't generally do external operations.