Hi Hive Gurus,
I have a table with a bunch of columns and another table with a list of columns 
names coming from the first table. What I want to do is to generate a 2-column 
table that contains column-value pairs from the 1st table but only for columns 
defined in the second table.
In other words, I have the following tables.
Table 1:id as string,col1 as string,col2 as string,...colN as string,
Table 2:colname as string
I'd like to generate a table with the following schema.
Table 3:id as string,colname as string,colvalue as string
It is relatively straightforward to do this in two steps. We can run a select 
query on the 2nd table (column names) to get the column list, and generate 
another Hive query based on this list, but this approach needs to run two 
separate queries. Are there more efficient ways of achieving the same?
Thanks,Sha Liu                                    

Reply via email to