FAQ
Hi all,

I am loading data from xml file to hive schema.

add jar build/contrib/hadoop-mapred-0.22.0-SNAPSHOT.jar

CREATE TABLE IF NOT EXISTS PARSE_XML(
column1 String, column2 String
)
STORED AS
INPUTFORMAT 'org.apache.hadoop.mapreduce.lib.input.XmlInputFormat'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat';



LOAD DATA LOCAL INPATH './hive-svn/build/dist/examples/files/upload.xml'
OVERWRITE INTO TABLE PARSE_XML;

I was able to create the table however I got the following error-


FAILED: Error in semantic analysis: line 1:14 Input Format must implement
InputFormat parse_xml


when I do the select on the table


Ankit

Search Discussions

  • Zheng Shao at Jan 22, 2010 at 7:05 pm
    Hi Ankit,

    org.apache.hadoop.mapreduce.lib.input.XmlInputFormat is implementing
    the new mapreduce InputFormat API. while Hive need an InputFormat that
    implements org.apache.hadoop.mapred.InputFormat (the old API).

    This might work:
    http://www.umiacs.umd.edu/~jimmylin/cloud9/docs/api/edu/umd/cloud9/collection/XMLInputFormat.html

    Or you might want to adapt the XMLInputFormat to the old API so Hive
    can read from it.

    Zheng
    On Fri, Jan 22, 2010 at 10:58 AM, ankit bhatnagar wrote:
    Hi all,

    I am loading data from xml file to hive schema.

    add jar build/contrib/hadoop-mapred-0.22.0-SNAPSHOT.jar

    CREATE TABLE IF NOT EXISTS PARSE_XML(
    column1 String, column2 String
    )
    STORED AS
    INPUTFORMAT 'org.apache.hadoop.mapreduce.lib.input.XmlInputFormat'
    OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat';



    LOAD DATA LOCAL INPATH './hive-svn/build/dist/examples/files/upload.xml'
    OVERWRITE INTO TABLE PARSE_XML;

    I was able to create the table however I got the following error-


    FAILED: Error in semantic analysis: line 1:14 Input Format must implement
    InputFormat parse_xml


    when I do the select on the table


    Ankit


    --
    Yours,
    Zheng

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categorieshive, hadoop
postedJan 22, '10 at 6:58p
activeJan 22, '10 at 7:05p
posts2
users2
websitehive.apache.org

2 users in discussion

Zheng Shao: 1 post Ankit bhatnagar: 1 post

People

Translate

site design / logo © 2021 Grokbase