mardi 22 avril 2014

c# - impossible à distance d'exécuter une requête sur une table de ruche dans un conteneur par défaut dans HDInsight - Stack Overflow


I'm trying to launch a Hive query from .NET using Linq to Hive.


The challenge is that the query is supposed to run on an external table which is not in the default HDInsight container, so I've added the container's credentials to core-site.xml and restarted Hive's deamons.


However, I'm getting the following error:



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



Here is my code:


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();

The connection succeeds and a Hive job is created (I can even see an HQL file with the query), but the Hive job writes the above-mentioned error to stderr.


I've been trying to solve this for hours, changing this and that, I've even tried WebHCatHttpClient instead of Linq, but to no avail... Any ideas?




Are you sure the Hive table has been created? I don't know the reasons, but Hive restricts creating an external table only in 'local' mode.


You can use the invoke-hive PowerShell cmdlet to run a hive query like "select count(*) from " to verify.


For more PowerShell or HDInsight .NET SDK samples, see http://www.windowsazure.com/en-us/manage/services/hdinsight/submit-hadoop-jobs-programmatically/#hive-sdk.



I'm trying to launch a Hive query from .NET using Linq to Hive.


The challenge is that the query is supposed to run on an external table which is not in the default HDInsight container, so I've added the container's credentials to core-site.xml and restarted Hive's deamons.


However, I'm getting the following error:



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



Here is my code:


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();

The connection succeeds and a Hive job is created (I can even see an HQL file with the query), but the Hive job writes the above-mentioned error to stderr.


I've been trying to solve this for hours, changing this and that, I've even tried WebHCatHttpClient instead of Linq, but to no avail... Any ideas?



Are you sure the Hive table has been created? I don't know the reasons, but Hive restricts creating an external table only in 'local' mode.


You can use the invoke-hive PowerShell cmdlet to run a hive query like "select count(*) from " to verify.


For more PowerShell or HDInsight .NET SDK samples, see http://www.windowsazure.com/en-us/manage/services/hdinsight/submit-hadoop-jobs-programmatically/#hive-sdk.


0 commentaires:

Enregistrer un commentaire