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 (

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

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

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

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