Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hive Select Into

Tags:

hive

hiveql

I have a database people in hive. It's schema is as follows:

name string,
dob_date int,
dob_month int,
dob_year int.

I have successfully loaded data from a file into the database.
Now I want to have people having dob_year=1990 into a new table.
The following code doesn't work :

Select * into people1990 from people where dob_year=1990;
like image 846
Nemil A Timbadia Avatar asked Aug 05 '13 01:08

Nemil A Timbadia


People also ask

How do I SELECT specific rows in Hive?

hive SELECT Statement Select Specific Rows You can use the keyword RLIKE to use Java regular expressions. The following query will return rows which column name contains the words "smith" or "son". You can apply functions to the returned data. The following sentence will return all name in upper case.


1 Answers

You can use create table tablename as in Hive.

example:

create table people1990 as select * from people where dob_year=1990 
like image 164
Balaswamy Vaddeman Avatar answered Oct 18 '22 22:10

Balaswamy Vaddeman