sqlhiveexport-to-excelheading

HIVE - Remove database name from heading when exporting to excel


I have a table = Table_name,has 3 columns,

Select * from Table_name

Results appear exactly as below (column headings)

Table_name.Col1 | Table_name.Col2 | Table_name.Col3

However, When I export to Excel. Column names are

Table_name.Col1 | Table_name.Col2 | Table_name.Col3

Is there away to keep the headings as Col1 Col2 Col3

New to Hive hope someone can help. Thanks


Solution

  • Add the below property before your select statement!

    set hive.resultset.use.unique.column.names=false
    

    Then hive doesn't printout the tablename as part of column names.