这个Hive查询创建外部表有什么问题?

时间:2015-07-17 18:45:58

标签: hadoop hive hdinsight

表由以下HQL创建,但在后续查询时返回零行。

CREATE EXTERNAL TABLE default.salesorderdetailx(SalesOrderID int,
       ProductID int,
       OrderQty int,
       LineTotal decimal)
ROW FORMAT DELIMITED
        FIELDS TERMINATED BY ','
        COLLECTION ITEMS TERMINATED BY '\002'
        MAP KEYS TERMINATED BY '\003'
STORED AS TEXTFILE
LOCATION 'wasb://mycn-1@my.blob.core.windows.net/mycn-1/hive/warehouse/salesorderdetailx'

我的blob的URL如下:

https://my.blob.core.windows.net/mycn-1/hive/warehouse/salesorderdetailx/salesorderdetail.txt

我的数据如下:

43659,776,1,2024.994000
43659,777,3,6074.982000
43659,778,1,2024.994000
43659,771,1,2039.994000

1 个答案:

答案 0 :(得分:0)

The problem was in my wasb syntax. Although the various GUI's (Visual Studio, Manage.WindowsAzure.com) indicate the container name as being part of the path--you can see this in the body of my question where I indicated the URL to my blob--it apparently is NOT. So, the correct wasb URI in this example should have been 'wasb://mycn-1@my.blob.core.windows.net/hive/warehouse/salesorderdetailx'. Thanks for everybody who looked at my question. I guess the problem was too obvious for expert eyes to notice. :-/

相关问题