Re: query orc file by hive

2015-11-13 Thread patcharee

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






Re: query orc file by hive

2015-11-13 Thread Dave Maughan
Hi,

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

CREATE EXTERNAL TABLE orc_table (
  
)
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  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 (
>   
> )
> 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  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
>>
>
>
>


Re: query orc file by hive

2015-11-13 Thread patcharee

Hi,

It works after I altered add partition. Thanks!

My partitioned orc file (directory) is created by Spark, therefore hive 
is not aware of the partitions automatically.


Best,
Patcharee

On 13. nov. 2015 13:08, Elliot West wrote:

Have you added the partitions to the meta store?

ALTER TABLE ... ADD PARTITION ...

If using Spark, I believe it has good support to do this automatically 
with the HiveContext, although I have not used it myself.


Elliot.

On Friday, 13 November 2015, patcharee > 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 (

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








Re: query orc file by hive

2015-11-09 Thread Elliot West
Hi,

You can create a table and point the location property to the folder
containing your ORC file:

CREATE EXTERNAL TABLE orc_table (
  
)
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  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
>


query orc file by hive

2015-11-09 Thread patcharee

Hi,

How can I query an orc file (*.orc) by Hive? This orc file is created by 
other apps, like spark, mr.


Thanks,
Patcharee