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 <abhatna...@gmail.com> 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