hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ping Zhu <p...@sharethis.com>
Subject Re: Loading files into tables
Date Tue, 01 Feb 2011 16:53:11 GMT
create table test_table ( test string);
load data local inpath '/root/1.csv' into table test_table;
describe extended test_table; # "find the hdfs dir of table test_table, for
my case the data of table test_table is saved under
hdfs /root/hive/warehouse/test_table
dfs -ls /root/hive/warehouse/test_table
-rw-r--r--   3 root supergroup    1445813 2011-02-01 11:50
/root/hive/warehouse/test1/1.csv



On Tue, Feb 1, 2011 at 8:41 AM, Amlan Mandal <amlan@fourint.com> wrote:

> Thanks Ajo.
> Please confirm if my understanding is correct.
> That means when I do "LOAD DATA *LOCAL* INPATH 'filepath' [OVERWRITE] INTO
> TABLE tablename" data in is local file system. If I need to run HIVE queries
> (which in turn would be converted to Map Reduce jobs) I need to pull the
> data some other table for which data is in HDFS by means of
>
> INSERT OVERWRITE TABLE tablename_new SELECT *  FROM tablename ... (kind of)
>
> So those LOCAL tables are kind of temporary.
>
> Amlan
>
>
> On Tue, Feb 1, 2011 at 6:51 PM, Ajo Fod <ajo.fod@gmail.com> wrote:
> >
> > Look up for local :
> > http://wiki.apache.org/hadoop/Hive/GettingStarted
> >
> > -Ajo.
> >
> > On Tue, Feb 1, 2011 at 3:15 AM, Amlan Mandal <amlan@fourint.com> wrote:
> >>
> >> Hi All,
> >> I am a hive newbie.
> >>
> >> LOAD DATA *LOCAL* INPATH 'filepath' [OVERWRITE] INTO TABLE tablename
> >>
> >> When I use LOCAL keyword does hive create a hdfs file for it?
> >>
> >> I used above statement to put data into a hive table.
> >> But I could not see any hdfs file in my hive.metastore.warehouse.dir
> (which comes from hive-default.xml /user/hive/warehouse/ ).
> >>
> >> Although when I did
> >>
> >> FROM  a INSERT OVERWRITE TABLE
> >> b PARTITION(dt='2011-01-06') SELECT *
> >>
> >> I see hdfs file is created.
> >>
> >> Am I missing something?
> >>
> >> Can somebody please explain?
> >
>
>

Mime
View raw message