Hi,

Expand Elliot's answer for a partitioned table, e.g.:

CREATE EXTERNAL TABLE orc_table (
  <schema>
)
PARTITIONED BY (col1 type, col2 type)
STORED AS ORC
LOCATION '/hdfs/folder/containing/orc/files';

ALTER TABLE orc_table ADD PARTITION (col1 = 'val1', col2 = 'val2') LOCATION
'/hdfs/folder/containing/orc/files/col1=val1/col2=val2';

Thanks - Dave


On Fri, 13 Nov 2015 at 11:59 patcharee <patcharee.thong...@uni.no> wrote:

> Hi,
>
> It work with non-partition ORC, but does not work with (2-column)
> partitioned ORC.
>
> Thanks,
> Patcharee
>
>
>
> On 09. nov. 2015 10:55, Elliot West wrote:
>
> Hi,
>
> You can create a table and point the location property to the folder
> containing your ORC file:
>
> CREATE EXTERNAL TABLE orc_table (
>   <schema>
> )
> STORED AS ORC
> LOCATION '/hdfs/folder/containing/orc/file'
> ;
>
>
>
> https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-CreateTable
>
> Thanks - Elliot.
>
> On 9 November 2015 at 09:44, patcharee <patcharee.thong...@uni.no> wrote:
>
>> Hi,
>>
>> How can I query an orc file (*.orc) by Hive? This orc file is created by
>> other apps, like spark, mr.
>>
>> Thanks,
>> Patcharee
>>
>
>
>

Reply via email to