Created on 05-22-2017 09:45 AM - edited 09-16-2022 04:38 AM
Hi everyone,
I´m new using Hive and I may make some stupid cuestions.
I was trying to add some column names to a dataset (.txt) creating a new table in Hive and specifying wich data goes with wich column name.
The creation of the table is correct but when I use H2O to visualizate that data, the column names disappear.
How can call to the data stored with the column names?
thank you
Created 05-22-2017 05:03 PM
Did you verify the data by viewing this data using beeline on the cluster? Does it show up correctly lining up under the expected columns when you do a select * from <tablename>. You can run desc [extended|formatted] <tablename> to view the metadata for the table.
Created 05-24-2017 08:36 AM
Hi, sorry for the delay and thank you for the answer. When I do select * from <tablename> it doesn´t appear any column name but when I run desc extended <tablename> the appear. which one shows me if the column names are or not in the metadata?
thank you
Created 05-24-2017 03:27 PM
desc <tablename> shows the table definition (including column names with the datatype) while select * from <tablename> shows the data in the table.
Created 05-24-2017 03:55 PM
The hive table column names are stored in the metastore. Assuming you are using an external hive table on the txt file(s) you will need to either update the DDL for the table, or drop and re-create the table with the correct columns. Dropping an external table does not delete the underlying data.
Created 10-05-2017 07:06 AM
Yes, metadata does store the columns name in its database.
hive > show columns in table_name:
hive> set hive.cli.print.header=true;
To view the column names of your table.