hive xml serDe : table is empty

前端 未结 5 535
我在风中等你
我在风中等你 2021-01-21 12:38

I want to store xml data into hive table, XML data :


   1266 
     

        
5条回答
  •  终归单人心
    2021-01-21 13:02

    LOCATION give directory only instead of file

     create table xml_AIR(id STRING, status_text STRING,display_name STRING ,host_name STRING)
    row format serde 'com.ibm.spss.hive.serde2.xml.XmlSerDe'
    with serdeproperties(
    "column.xpath.id"="/servicestatus/@id",
    "column.xpath.status_text"="/servicestatus/status_text/text()",
    "column.xpath.display_name"="/servicestatus/display_name/text()",
    "column.xpath.host_name"="/servicestatus/host_name/text()"
    )
    stored as
    inputformat 'com.ibm.spss.hive.serde2.xml.XmlInputFormat'
    outputformat 'org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat'
    LOCATION  '/user/cloudera/input'
    tblproperties(
    "xmlinput.start"="

提交回复
热议问题