gpt4 book ai didi

c# - 无法在HDInsight的非默认容器中的Hive表上远程运行查询

转载 作者:行者123 更新时间:2023-12-02 21:51:33 24 4
gpt4 key购买 nike

我正在尝试使用Linq to Hive从.NET启动Hive查询。

挑战在于查询应该在外部表上运行,该外部表不在默认的HDInsight容器中,因此我已将容器的凭据添加到core-site.xml中,并重新启动了Hive的守护进程。

但是,出现以下错误:

Container ... in account ... not found, and we can't create it using anoynomous credentials.



这是我的代码:
var db = new MyHiveDatabase(
new Uri("https://myclustername.azurehdinsight.net"),
username,
password,
nonDefaultStorageAccount, nonDefaultStorageAcountKey);
// I've also tried: defaultStorageAccount, defaultStorageAcountKey


var q = from x in db.ExternalTableName
group x by x.Name
into g
select new {Name = g.Key, Count = g.Count()};

q.ExecuteQuery().Wait();

连接成功,并且创建了一个Hive作业(我什至可以在查询中看到一个HQL文件),但是Hive作业将上述错误写入stderr。

我已经尝试解决这个问题了好几个小时,更改了该内容,甚至尝试了 WebHCatHttpClient而不是Linq,但无济于事...有什么想法吗?

最佳答案

您确定Hive表已创建吗?我不知道原因,但是Hive限制仅在“本地”模式下创建外部表。

您可以使用invoke-hive PowerShell cmdlet来运行诸如“select count(*)from”之类的配置单元查询以进行验证。

有关更多PowerShell或HDInsight .NET SDK示例,请参见http://www.windowsazure.com/en-us/manage/services/hdinsight/submit-hadoop-jobs-programmatically/#hive-sdk

关于c# - 无法在HDInsight的非默认容器中的Hive表上远程运行查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20313372/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com