Reply
New Contributor
Posts: 1
Registered: ‎12-19-2014

Need to replace Oracle syntax with Impala Syntax ???

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

Cloudera Employee
Posts: 307
Registered: ‎10-16-2013

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

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.