Does Hive have a dynamic pivot function Does Hive have a dynamic pivot function hadoop hadoop

Does Hive have a dynamic pivot function


HiveQL doesn't support dynamic pivot like you describe. If you want to do something like this you need to use straight dynamic SQL and construct the query in whatever orchestration tool you're using.

I haven't used it, but this is apparently supported in HPL/SQL through use of the EXEC keyword. This will allow execution of strings of dynamic SQL and provides a more transactional layer on top of traditional Hive. HPL/SQL is included in Hive 2.0. If you use Hive 2.0 it should be available for you.

Personally I have always done this type of query construction in Python, which I use to drive all my operations.