"describe select * from category limit 10" does not work for me.
Perhaps this is due to the version of Hive being used. I am using Hive 0.8.1.4
After doing some research, I found a similar solution for one Matthew Rathbone:
Hive provides an EXPLAIN command that displays a query execution plan. The syntax for this statement is as follows:
Request EXPLAIN [EXTENDED]
So, for everyone who also uses rbhive:
RBHive.connect(host, port) do |c| c.execute("explain select * from categories limit 10") end
Note that you need to substitute c.fetch with c.execute, as the explanation will not return any results if it is successful. => rbhive will throw an exception regardless of the correctness of your syntax.
execute will throw an exception if you have a syntax error or if the requested table / column does not exist. If everything is in order, an exception is not excluded, but you also will not get any results, which is not an evil thing.
source share