BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
woo
Lapis Lazuli | Level 10 woo
Lapis Lazuli | Level 10

i have sas 9.4 linux with clouderaimpala drivers installed.

 

i am trying to list all tables (table name) from one of haddop database but not sure about how query exactly look like, can someone please help...

 

below query is not much help,

 

libname try "/home/userid";
proc sql;
connect to impala as xyzk (datasrc=xxx user=xxx pw=xxx database=xxx);
execute (create table 'try.test' (show tables;))  by xyzk;
quit;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
LinusH
Tourmaline | Level 20

Anything that is set inside an EXECUTE block will be target DBMS dependent. So you should go to an Impala forum for such details.

Further more, using EXECUTE will not return anything to the client SAS session, so I assume a SELECT * FROM CONNECTION TO... construct fits your need better.

 

Another option is to issue a libname instead, and then you can use SAS to list the available tables.

Search support.sas.com for "PROC SQL DICTIONARY TABLES", or query the generic SASHELP.VTABLE system view.

Data never sleeps

View solution in original post

4 REPLIES 4
LinusH
Tourmaline | Level 20

Anything that is set inside an EXECUTE block will be target DBMS dependent. So you should go to an Impala forum for such details.

Further more, using EXECUTE will not return anything to the client SAS session, so I assume a SELECT * FROM CONNECTION TO... construct fits your need better.

 

Another option is to issue a libname instead, and then you can use SAS to list the available tables.

Search support.sas.com for "PROC SQL DICTIONARY TABLES", or query the generic SASHELP.VTABLE system view.

Data never sleeps
woo
Lapis Lazuli | Level 10 woo
Lapis Lazuli | Level 10

Thank you LinusH.

 

little confuse if i still need to use 2 libname statement - 1 to reference to get output in my home dir and 2nd which reference connection like this,

 

libname xyz '/home/userid';
libname hdp impala datasrc=xxxk user=xxx pw=xxx database=xyk-db;
proc sql;
create table xyz.test as select * from DICTIONARY.TABLES;
quit;
run;

 

 

 

 

LinusH
Tourmaline | Level 20
It's up to you where you want to store the result. What is your next step?
You could store it in work if you it's intermediate use and you avoid assigning another library.
Data never sleeps
woo
Lapis Lazuli | Level 10 woo
Lapis Lazuli | Level 10

thank you LinusH.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 935 views
  • 0 likes
  • 2 in conversation