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.

Data is not being loaded properly into the users, products and omniturelogs tables

Data is not being loaded properly into the users, products and omniturelogs tables

Guru

I followed the directions in the tutorial to create the three tables and then load the corresponding tsv files into them. However the data from the tsv file is not being loaded into the proper table columns/there are null values. Here is an example from the "users" table:

4288-users-incorrect.png

4 REPLIES 4

Re: Data is not being loaded properly into the users, products and omniturelogs tables

Guru

I posted this question because I noticed there is an error in the create table statements in the tutorial. For example, the statement to create the "users" table is shown as:

create table users (swid STRING, birth_dt STRING, gender_cd CHAR(1)) ROW FORMAT DELIMITED
FIELDS TERMINATED by't' stored as textfile
tblproperties ("skip.header.line.count"="1");

Instead of 't', the statement should have '\t', as such:

create table users (swid STRING, birth_dt STRING, gender_cd CHAR(1)) ROW FORMAT DELIMITED
FIELDS TERMINATED by'\t' stored as textfile
tblproperties ("skip.header.line.count"="1");

*Note: The images of the statements shown in the tutorial are correct.*

Using the proper create table statements will now give you the proper table results:

4289-users-correct.png

Re: Data is not being loaded properly into the users, products and omniturelogs tables

Issue might be with the creation of table with appropriate column types. Either run below command from Hive CLI or Beeline and provide an output, even provide sample data that you're trying to load.

describe formatted users;

Re: Data is not being loaded properly into the users, products and omniturelogs tables

Guru

Thanks for the comments Sridhar. As noted above in my reply to the question, there is an error in the create table statement which causes the issue ('t' should be '\t').

Highlighted

Re: Data is not being loaded properly into the users, products and omniturelogs tables

Good, thanks for sharing Alim.