Does a view not work for you?

You create your external table as you described and a view which looks like
the 2nd table.

Abe

On Tue, Jun 9, 2015 at 9:44 AM, Gary Clark <gcl...@neces.com> wrote:

>  Hello,
>
>
>
> 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.
>
>
>
> I.e:
>
>
>
> create EXTERNAL TABLE initialtable (deployment_id tinyint,
>
>                                              A  bigint,
>
>                                              sample_date string,
>
>                                              charge smallint,
>
>                                              discharge smallint)
>
>              ROW FORMAT DELIMITED
>
>                                              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?
>
>
>
>
>
> Thanks,
>
> Gary C
>

Reply via email to