BookmarkSubscribeRSS Feed
Steelers_In_DC
Barite | Level 11

I found the below solution in our community but would like to adapt it to include columns:

 

this is passing through to hadoop:
 
select * from connection to hadoop (show tables);
 
Is there a modification that can show tables and columns?
3 REPLIES 3
Tom
Super User Tom
Super User

How are you connecting to HADOOP?

Are you using ODBC?  Do these the ODBC specific queries help?

https://support.sas.com/kb/15/721.html

 

Steelers_In_DC
Barite | Level 11

this is not ODBC:

proc sql;
connect to hadoop
(READ_METHOD=HDFS               /* this attemps HDFS read which is faster than JDBC */
server=''        /* the hiveserver we talk to */
LOGIN_TIMEOUT=300
schema=&schema.                 /* this is the schema where you want to read or write data to */
uri=
Tom
Super User Tom
Super User

I have never worked with HADOOP (or HIVE) but a couple of points.

 

1) You original query is using pass thru to run HADOOP code.  So if you want to do the same thing then find out what HADOOP code lists the variables in a dataet.

 

2) Why not just see if you can't use normal SAS code to get the contents of the datasets?  Make a LIBREF using the HADOOP engine and run normal SAS code. So something like:

libname mylib hadoop .....;
proc contents data=mylib.my_dataset;
run;

Where MY_DATASET is one of the "table" names you got from the SHOW TABLES command.

SAS Innovate 2025: Call for Content

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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 3 replies
  • 724 views
  • 1 like
  • 2 in conversation