hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bejoy KS" <bejoy...@yahoo.com>
Subject Re: Loading data into data_dim table
Date Wed, 25 Jul 2012 10:45:32 GMT
Hi Prabhu

Can you cat the file in hdfs and ensure that the fields are delimited by '|' character.

hadoop fs -text user/hive/warehouse/dim_date/time.csv
 
Regards
Bejoy KS

Sent from handheld, please excuse typos.

-----Original Message-----
From: prabhu k <prabhu.hive@gmail.com>
Date: Wed, 25 Jul 2012 16:05:42 
To: <user@hive.apache.org>
Reply-To: user@hive.apache.org
Subject: Loading data into data_dim table

Hi Users,


I have created dim_date table like below. table created successfully and i
then load the data into the dim_date table

while i am selecting the table, getting null values.my input file is
time.csv file

hive> create table dim_date(DateId int,ddate string,Year int,Quarter
int,Month_Number_Year int,Month_Number_Of_Quarter int,Week_Number_Of_Year
int,Week_Number_Of_Quarter int,Week_Number_Of_Month int,Day_Number_Of_Year
int,Day_Number_Of_Quarter int,Day_Number_Of_Month int,Day_Number_Of_Week
int,Month_Name string,Month_Name_Abbreviation string,Day_Name
string,Day_Name_Abbreviation string)row format delimited fields terminated
by '|' stored as textfile;
OK
Time taken: 0.123 seconds

hive> load data local inpath '/usr/local/time.csv' overwrite into table
dim_date;
Copying data from file:/usr/local/time.csv
Copying file: file:/usr/local/time.csv
Loading data to table default.dim_date
Deleted hdfs://md-aaa1:54310/user/hive/warehouse/dim_date
OK
Time taken: 0.234 seconds

hive> select * from dim_date;
NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL
NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL
NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL
NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL
NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL
NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL
NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL
NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL
NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL
NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL
NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL
NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL
NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL
NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL
Please help me on this issue, I have missed anything wrong?

Thanks,
Prabhu.

Mime
View raw message