Reading hive table using Pig script
NickName:Chhaya Vishwakarma Ask DateTime:2014-02-12T18:47:55

Reading hive table using Pig script

I am trying to read hive table using PIG script but when I run a pig code to read a table in hive its giving me following error:

2014-02-12 15:48:36,143 [main] WARN org.apache.hadoop.hive.conf.HiveConf  
    -hive-site.xml not found on CLASSPATH 2014-02-12 15:49:10,781 [main] ERROR
    org.apache.pig.tools.grunt.Grunt - ERROR 2997:  Unable to recreate
    exception from backed error: Error: Found class 
    org.apache.hadoop.mapreduce.TaskAttemptContext, but interface was expected

(Ignore newlines and whitespace added for readability)

Hadoop version 1.1.1

Hive version 0.9.0

Pig version 0.10.0

    Pig code
    a = LOAD '/user/hive/warehouse/test' USING 
    org.apache.pig.piggybank.storage.HiveColumnarLoader('name string');

Is it due to some version mismatch ?

Copyright Notice:Content Author:「Chhaya Vishwakarma」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/21725696/reading-hive-table-using-pig-script

More about “Reading hive table using Pig script” related questions

Reading hive table using Pig script

I am trying to read hive table using PIG script but when I run a pig code to read a table in hive its giving me following error: 2014-02-12 15:48:36,143 [main] WARN org.apache.hadoop.hive.conf.Hiv...

Show Detail

Pig - reading Hive table stored as Avro

I have created a hive table stored with Avro file format. I am trying to load same hive table using below Pig commands pig -useHCatalog; hive_avro = LOAD 'hive_avro_table' using org.apache.hive.hc...

Show Detail

Using hive table over parquet in Pig

I am trying to create a Hive table with schema string,string,double on a folder containing two Parquet files. The first parquet file schema is string,string,double and the schema of the second file...

Show Detail

ACID transactions in HIVE table from pig script

Is it possible to perform ACID transactions in a Hive table from a Pig script? As per the below link we can execute DDL statements on a hive table from a pig script: https://issues.apache.org/jira/

Show Detail

drop hive table partition through pig script

Currently we are dropping the table daily and running the script which loads the data to the tables. Script takes 3-4 hrs during which data will not be available. So now our aim is to make the old ...

Show Detail

How to store pig output to the hive table?

I have HDInsight cluster on Azure and .csv files in hdfs (Azure storage). Using apache-pig I want to process these files and store the output in a hive table. To achieve this I have written follo...

Show Detail

Using Hive with Pig

My hive query has multiple outer joins and takes very long to execute. I was wondering if it would make sense to break it into multiple smaller queries and use pig to work the transformations. Is...

Show Detail

HCatalog Date in PIG with Hive table

I'm trying to load a date field from PIG into a hive table, the PIG script has the field as: testdate:chararray The Hive table description is: col_name data_type testdate date Pig '

Show Detail

Writing data using PIG to HIVE external table

I wanted to create an external table and load data into it through pig script. I followed the below approach: Ok. Create a external hive table with a schema layout somewhere in HDFS directory. Let...

Show Detail

Pig overwrite data in hive using LOAD

I am new to Pig and hive ,I need to load the data from csv file stored on hdfs to the hive table using pig load-store. for which I am using load_resource_csv = LOAD '/user/hadoop/emp.csv' USING

Show Detail