Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Need to replace Oracle syntax with Impala Syntax ???

Need to replace Oracle syntax with Impala Syntax ???

New Contributor

Dear All,

 

I am trying to create universe(SAP BO) on top of Hadoop, I have succesfully connected the Hadoop Hive and play with the impala tables. To create a derived table i need impala syntax to run from BO to Hadoop. I need to find out the equivalent syntax for Decode in sql.

 

Oracle Syntax:

SUM(DECODE(CD.YEAR_TYPE, 'LY', CAR.LOCAL_ALLOCATIONS * CAR.LOCAL_NOMINAL_OCCUPANCY, 0)) AS LY_BED_NIGHTS,

 

Impala Syntax:

?????????

 

Please help on this!!!

 

Regards,

SumanT

1 REPLY 1

Re: Need to replace Oracle syntax with Impala Syntax ???

Master Collaborator

DECODE() is supported since Impala 2.0.

 

Please refer to:

 

http://www.cloudera.com/content/cloudera/en/documentation/cloudera-impala/latest/topics/impala_condi...

 

Also DECODE() can often be rewritten as a CASE expression. Please refer to the docs for the particular version of Im[pala you are using.