Skip to content
Advertisement

Convert from lateral view to case statements in hive

I need to place below code in case statement:

I have tried:

But getting error.

Advertisement

Answer

For the provided SQL on table tab1, the actual logic is like:

  1. Explode field secondary.tertiary, alias it as lv, which results in a temporary result set (table) tab2;
  2. A join-like operation to concatenate tab2‘s fields back to rows in tab1, resulting in another intermediate table tab3;
  3. Select from tab3, upon which where conditions are applied.
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement