hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chinna <chinna...@huawei.com>
Subject RE: how to insert data to specified columns
Date Wed, 03 Aug 2011 04:09:56 GMT

I think we cannot do this directly by specify the particular target columns
in the insert query because it is dealing with the files.

And the syntax is

syntax:
INSERT OVERWRITE TABLE tablename1 [PARTITION (partcol1=val1, partcol2=val2
...)] select_statement1 FROM from_statement;
INSERT INTO TABLE tablename1 [PARTITION (partcol1=val1, partcol2=val2 ...)]
select_statement1 FROM from_statement;

-Chinna Rao Lalam

-----Original Message-----
From: 曹坤 [mailto:caofangkun@gmail.com] 
Sent: Wednesday, August 03, 2011 8:30 AM
To: dev@hive.apache.org
Subject: how to insert data to specified columns

Hello :
Any idea about how to insert data to specified columns?
In a way like follow :

INSERT OVERWRITE TABLE target_table
                                 PARTITION (day='20110803' , hour='11')
                                 (target_table_column1,target_table_column2)
SELECT source_table_column1,  source_table_column2
FROM source_table;

-- 
Best wishs!


Mime
View raw message