我可以解析出类似9531的值,因为它们包含在标记StatusValue
中。但是我如何对DateTime
,FromAppId
和MessageId
做同样的事情?
<PhoneCallEvent DateTime="2018-09-10T12:51:33.743-04:00"
FromAppId="200002"
MessageId="3407802">
<LoanNumber>307375</LoanNumber>
<StatusValue>9531</StatusValue>
<StatusUserCommonID>2561550</StatusUserCommonID>
<CallDirection>Inbound</CallDirection>
<CallStartTime>2018-09-10T12:49:37.000-04:00</CallStartTime>
<CallEndTime>2018-09-10T12:51:28.000-04:00</CallEndTime>
<VectorDirectoryNumber/>
</PhoneCallEvent>
答案 0 :(得分:0)
Hive具有XPath功能:
SELECT xpath (
xml_string ,
xpath ) FROM src LIMIT 1
>
SELECT xpath_string (
xml_string ,
xpath ) FROM src LIMIT 1
>
SELECT xpath_
类型 (
xml_string ,
xpath ) FROM src LIMIT 1
例如,您可以将xpath_string
与XPath一起使用
/PhoneCallEvent/@DateTime
选择DateTime
属性值。