CURRENT_LOAD_SOURCE in UDL

Moderator: NorbertKrupa

Post Reply
falcon
Newbie
Newbie
Posts: 4
Joined: Thu Dec 11, 2014 11:19 am

CURRENT_LOAD_SOURCE in UDL

Post by falcon » Thu Dec 11, 2014 11:51 am

Hello all,

I'm trying to create Java UDL with possibility to load multiple files and track a file name during the load.
Documentation says I can use CURRENT_LOAD_SOURCE() function to track file name, but I need to setup some source in my UDL.

I have found only getUri() function in SDK and tried to override it, but there is no effect.

Does anyone know how to setup this source to get CURRENT_LOAD_SOURCE() work.
Any other solution also will be great.

Thanks

id10t
GURU
GURU
Posts: 732
Joined: Mon Apr 16, 2012 2:44 pm

Re: CURRENT_LOAD_SOURCE in UDL

Post by id10t » Thu Dec 11, 2014 2:13 pm

Hi!

[DELETED]
Last edited by id10t on Mon May 04, 2015 9:18 pm, edited 3 times in total.

falcon
Newbie
Newbie
Posts: 4
Joined: Thu Dec 11, 2014 11:19 am

Re: CURRENT_LOAD_SOURCE in UDL

Post by falcon » Thu Dec 11, 2014 2:23 pm

Here https://my.vertica.com/docs/7.0.x/HTML/ ... SOURCE.htm

I don't see this topic in 7.1 docs, but the function exists in Vertica 7.1

falcon
Newbie
Newbie
Posts: 4
Joined: Thu Dec 11, 2014 11:19 am

Re: CURRENT_LOAD_SOURCE in UDL

Post by falcon » Thu Dec 11, 2014 2:26 pm

This function returns "<unknown>" value, I need this function to return file name

id10t
GURU
GURU
Posts: 732
Joined: Mon Apr 16, 2012 2:44 pm

Re: CURRENT_LOAD_SOURCE in UDL

Post by id10t » Thu Dec 11, 2014 2:39 pm

Hi!

[DELETED]
Last edited by id10t on Mon May 04, 2015 9:19 pm, edited 2 times in total.

falcon
Newbie
Newbie
Posts: 4
Joined: Thu Dec 11, 2014 11:19 am

Re: CURRENT_LOAD_SOURCE in UDL

Post by falcon » Thu Dec 11, 2014 2:55 pm

Hi,
If the function is called by a UDL that does not set the source, it returns the string <unknown>.
So you have to define a source for your UDL.
This is actually what I asked initially, how to do that.

As I understand "source" is some property in SDK which used by CURRENT_LOAD_SOURCE function

Unfortunately, example above doesn't cover my needs.

So, what I need:
1. Load more than 1k files from HDFS to Vertica.
2. I do not want to generate 1k of COPY commands.
3. I want to track file name, in other words, fill FileName column for each row in the destination table.

Post Reply

Return to “Vertica User Defined Functions (UDFs)”