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

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 591 views
  • 0 likes
  • 4 in conversation