Please evaluate using unix file operations to simply select what you want
from the csv and use that extract in your external table.
A simple grep command should do the trick I suppose, but you will need to
test it out to suit your needs.

Hope it helps.
regards
Devopam


On Tue, Jun 9, 2015 at 9:50 PM, Abe Weinograd <a...@flonet.com> wrote:

> 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
>>
>
>


-- 
Devopam Mittra
Life and Relations are not binary

Reply via email to