Hello Team,
I have an xml, I am inserting the value in hive using xmlserde. In the below xml I have an attribute
in AccountSetup and Accounts tags
<AccountSetup xmlns:xsi="test">
<Accounts xmlns="http://acct.com/institutional">
<Account>
<Id>12346</Id>
<AcctNbr>AAAAAAAAAA</AcctNbr>
<RegTypeCd>XXXX</RegTypeCd>
<ClassCd>35</ClassCd>
</Account>
</Accounts>
</AccountSetup>
and my create table query
CREATE TABLE suitability(Id STRING, AcctNbr STRING, RegTypeCd STRING)
row format serde 'com.ibm.spss.hive.serde2.xml.XmlSerDe'
WITH SERDEPROPERTIES
("column.xpath.Id"="AccountSetup/Accounts/Account/Id/text()",
"column.xpath.AcctNbr"="AccountSetup/Accounts/Account/AcctNbr/text()",
"column.xpath.RegTypeCd"="AccountSetup/Accounts/Account/RegTypeCd/text()"
)stored as
inputformat 'com.ibm.spss.hive.serde2.xml.XmlInputFormat'
outputformat 'org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat'
tblproperties
("xmlinput.start"="<AccountSetup ", "xmlinput.end"="</AccountSetup>");
It is showing null values in hive
hive> select * from suitability;
OK
NULL NULL NULL
Please advise on this.