Skip to main content

java udx getuser()

  • January 12, 2018
  • 1 reply
  • 9 views

mbw
  • New Participant

I am writing a java udx and was wondering if it is possible to determine userid running the udx. If so can you please provide an example?

Was looking at srvInterface but did not see any methods.

public void processBlock(ServerInterface srvInterface, BlockReader arg_reader, BlockWriter res_writer)
throws UdfException, DestroyInvocation {

        do {
            srvInterface.log("processBlock begin");
                     } while (arg_reader.next());       

Thanks

1 reply

Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • January 21, 2018

Hi,

What kind of UDx are you creating? If it's a scalar function maybe you can use Vertica's CURRENT_USER() function to pass the user name as a parameter to your function?

SELECT your_java_udx (CURRENT_USER(), colA, colB, etc.)
FROM some_table;