Avoiding Multiple Joins On Similar Columns
Let us assume that a Hive table contains various similar columns:
In order to join on all image_names from this table, the naive approach would be to perform 15 different joins.
Various SQL dialects have non-standard ways of dealing with this - SQL server, for instance, has the
unpivot operator. HiveQL does not support such operators, but it is possible to accomplish something similar by constructing a
map with all image_name columns, and using the built-in UDTF
This returns a table that allows a single join on all image_names to be performed: