Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Does Hive metadata store column names of a table?

Highlighted

Does Hive metadata store column names of a table?

New Contributor

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

5 REPLIES 5

Re: Does Hive metadata store column names of a table?

Master Collaborator

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.

Re: Does Hive metadata store column names of a table?

New Contributor

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

Re: Does Hive metadata store column names of a table?

Master Collaborator

desc <tablename> shows the table definition (including column names with the datatype) while select * from <tablename> shows the data in the table.

Re: Does Hive metadata store column names of a table?

Rising Star

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.

Re: Does Hive metadata store column names of a table?

Contributor

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.

Don't have an account?
Coming from Hortonworks? Activate your account here