I need the count of columns in hive ,So below is the example.
Table_name:emp
columns: empno, ename, manager, dept_id
Expected output: 4
Hive (now) supports the information_schema tables, so you could do:
select count(*)
from information_schema.columns
where table_name = 'emp'