我有一些xml要放在一个配置单元表中
<Locations>
<Location elevation="4.0" id="3062" latitude="57.819" longitude="-3.966" name="Tain Range" region="he" unitaryAuthArea="Highland"/>
</Locations>
所以我把它放在外置的table里
CREATE EXTERNAL TABLE xpath_table (locationxml string)
STORED AS TEXTFILE
LOCATION '/hdfs/path/to/flat/processed/file’;
然后将其Map到视图
CREATE VIEW xpath_view(location_name)
AS SELECT
xpath_string(locationxml, 'Locations/Location/@name')
FROM xpath_table;
我的xpath不工作。有人能指出我做错了什么吗?干杯。
暂无答案!
目前还没有任何答案,快来回答吧!