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.

Case like statement in HBASE

Highlighted

Case like statement in HBASE

New Contributor

Hi guys,

In sql I have a case statement like below:

select col1, (case when col2=28 then true else false) from employer

which returns as follows

col1 value, True

col2 Value,False


Do we have the same in hbase

for example if the value is found then it should return true.If the value is not found it should return false.

Can we achieve this HBASE query?

Regards


1 REPLY 1

Re: Case like statement in HBASE

Super Guru

@prasad raju

It is not possible with Hbase query but you can Hive/Phoenix table on top of Hbase table using Hbase storage handler/phoenix storage handler.

This feature allows Hive QL/SQL statements to access Hbase tables for both read (SELECT) and write (INSERT). It is even possible to combine access to HBase tables with native Hive/Phoenix tables.

For more details regarding Hbase Shell commands go through this and this links

Refer this to create Hive-Hbase tables.

Refer this and this links to create Phoenix-Hbase tables.

-

If the Answer addressed your question, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of issues.