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.

Dynamic columns used in phoenix join query

Highlighted

Dynamic columns used in phoenix join query

Hi,

I have been trying to implement Dynamic Columns of Phoenix view in a join query... Something like below without success...

SELECT X.COL_1 as COL1 , Y.COL_N as COL2 from LARGE_TABLE X

LEFT OUTER JOIN LOOKUP_DATA Y(COL_N VARCHAR) ON X.KEY = Y.KEY;

In the 'LOOKUP_DATA' view will be growing dynamically with new columns added frequently to underneath HBase table & dont want to deal with ever changing DDL for that.

Appreciate any of your suggestions.

-Datta

1 REPLY 1

Re: Dynamic columns used in phoenix join query

Hi @Datta Chandrashekar, I don't have an environment to test in, but can you perhaps try joining to the result of the dynamic select within a subquery? Something like:

SELECT X.COL_1 as COL1 , Y.COL_N as COL2 from LARGE_TABLE X

LEFT OUTER JOIN (

select a, b, LOOKUP_DATA Y(COL_N VARCHAR) from LOOKUP_TABLE

) Z ON X.KEY = Z.KEY;

Let us know if this works, please!

Don't have an account?
Coming from Hortonworks? Activate your account here