I'm trying to retrieve which user ID was used to allocate a Hadoop library.
I couldn't find a way so thought this could be stored in the comment field at allocation time.
See table SASHELP.VLIBNAM
Any idea on either retrieving the userid used in the libname statement, or on populating the value for comment ?
Perhaps. What does the documentation say about that COMMENT option?
But why not just remember what userid you used when you defined the libref to begin with?
Or ask HIVE to tell you. Most SQL implementations support the keyword USER.
SAS does.
proc sql;
select user into :userid from sashelp.class(obs=1);
quit;
So try something similar in a pass thru query to HIVE.
Perhaps. What does the documentation say about that COMMENT option?
But why not just remember what userid you used when you defined the libref to begin with?
Or ask HIVE to tell you. Most SQL implementations support the keyword USER.
SAS does.
proc sql;
select user into :userid from sashelp.class(obs=1);
quit;
So try something similar in a pass thru query to HIVE.
The documentation does not say anything about this field as far as I could see.
Good point about using native commands. This works:
select * from connection to HIVE (select current_user() );
or
select * from connection to HIVE (select logged_in_user() );
Thank you Tom.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: