hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Clark <>
Subject creating a table based on where column=x
Date Tue, 09 Jun 2015 13:44:55 GMT

I would like to create a table based on a selection in hive. Currently I am creating a table
based on a location which contains the source csv files and then deriving other tables from
that table.


create EXTERNAL TABLE initialtable (deployment_id tinyint,
                                             A  bigint,
                                             sample_date string,
                                             charge smallint,
                                             discharge smallint)
                                             FIELDS TERMINATED BY ',' LOCATION '/user/hue/data';

CREATE TABLE derivedtable AS SELECT * FROM initialtable WHERE deployment_id='22’;

I would just like to create a table where the deployment_id is 22 and not have to create the
initial table.

If someone can shed some light on how to do this I would appreciate it. The only example I
have seen seem to follow the above?

Gary C
View raw message