Support Questions
Find answers, ask questions, and share your expertise

Dynamic columns used in phoenix join query

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
Highlighted

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?