AnsweredAssumed Answered

Error in SELECT Hive query

Question asked by apaachee on Jun 11, 2013
Latest reply on Jun 12, 2013 by apaachee
Hi all ! I've a strange problem with my Hive installation and I'd really like to resolve it...

I've installed **Hadoop 0.20.2** in local with **Cygwin** and I can execute a wordcount mapreduce.
I've installed **Hive 0.10.0** too.

I've created a table in Hive with the following command :

    CREATE TABLE tweet_table(
        tweet STRING ) ROW FORMAT
        DELIMITED
            FIELDS TERMINATED BY '\n'

    
I insert some data with :

    LOAD DATA LOCAL INPATH 'data.txt' INTO TABLE tweet_table

*data.txt :*

    data1
    data2
    data3data4
    data5




The command `select * from tweet_table returns` :

    data1
    data2
    data3data4
    data5

But `select tweet from tweet_table` gives me :

    java.lang.RuntimeException: java.lang.ArrayIndexOutOfBoundsException: 0
        at org.apache.hadoop.hive.ql.exec.Utilities.getMapRedWork(Utilities.java:230)
        at org.apache.hadoop.hive.ql.io.HiveInputFormat.init(HiveInputFormat.java:255)
        at org.apache.hadoop.hive.ql.io.HiveInputFormat.pushProjectionsAndFilters(HiveInputFormat.java:381)
        at org.apache.hadoop.hive.ql.io.HiveInputFormat.pushProjectionsAndFilters(HiveInputFormat.java:374)
        at org.apache.hadoop.hive.ql.io.CombineHiveInputFormat.getRecordReader(CombineHiveInputFormat.java:540)
        at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:338)
        at org.apache.hadoop.mapred.MapTask.run(MapTask.java:307)
        at org.apache.hadoop.mapred.Child.main(Child.java:170)
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
        at java.beans.XMLDecoder.readObject(XMLDecoder.java:250)
        at org.apache.hadoop.hive.ql.exec.Utilities.deserializeMapRedWork(Utilities.java:542)
        at org.apache.hadoop.hive.ql.exec.Utilities.getMapRedWork(Utilities.java:222)
        ... 7 more
    
    
    FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.MapRedTask
    MapReduce Jobs Launched:
    Job 0: Map: 1   HDFS Read: 0 HDFS Write: 0 FAIL
    Total MapReduce CPU Time Spent: 0 msec


I tried to execute thoses queries in Ubuntu an there is no problem...

Outcomes