BookmarkSubscribeRSS Feed
Adnan2
Fluorite | Level 6

Hi All,

 

just wondering if you can put a keep and where statement with a from statement within a hadoop pass through. See example below - thank you in advance Adnan

 

proc sql; 
connect to hadoop ( &connect. );
    create table work.test as
    select * from connection to hadoop
    (
select
acct_id, billing_date, balance  FROM datab.acc_history (keep = acct_id, billing_date, balance where acct_id= "123456")
);
disconnect from hadoop;

 

3 REPLIES 3
sbxkoenk
SAS Super FREQ

Hello,

 

Did the LOG say anything strange when you tried this out?

 

Maybe @FrederikV can help you out?

 

BR,

Koen

Tom
Super User Tom
Super User

The code being passed to Hadoop has to be Hadoop code.  Not SAS code.

(
select acct_id, billing_date, balance
FROM datab.acc_history 
where acct_id= '123456'
)

So no dataset options.  Also most other SQL implementations require single quotes for string constants.  Double quotes are used around object (variables or datasets or schemas) names.

LinusH
Tourmaline | Level 20

To be correct, you have used data set options, not statements (KEEP and WHERE).

I see no reason to use them at all, KEEP= does exactly the same as the SELECT statement.

WHERE works equally good as a data set options and as a SQL statement.

In fact, you should be able to write implicit pass through with this logic with the same performance, reducing the complexity of our code, and make it less RDBMS dependent (requires a hadoop libname):

proc sql; 
  create table work.test as
   select acct_id, billing_date, balance  
    FROM datab.acc_history 
    where acct_id= "123456";
quit;
Data never sleeps

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 403 views
  • 0 likes
  • 4 in conversation