Skip to content

Commit 09c1d0d

Browse files
committed
Merge pull request Azure#2160 from begoldsm/dev
Latest SDK updates and ADL bug fixes
2 parents 5fd161f + 6b9bb4c commit 09c1d0d

29 files changed

+5135
-4340
lines changed

src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics.Test/Commands.DataLakeAnalytics.Test.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@
6262
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
6363
<Private>True</Private>
6464
</Reference>
65-
<Reference Include="Microsoft.Azure.Management.DataLake.Analytics, Version=0.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
65+
<Reference Include="Microsoft.Azure.Management.DataLake.Analytics, Version=0.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6666
<SpecificVersion>False</SpecificVersion>
67-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.DataLake.Analytics.0.10.2-preview\lib\net45\Microsoft.Azure.Management.DataLake.Analytics.dll</HintPath>
67+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.DataLake.Analytics.0.11.0-preview\lib\net45\Microsoft.Azure.Management.DataLake.Analytics.dll</HintPath>
6868
<Private>True</Private>
6969
</Reference>
70-
<Reference Include="Microsoft.Azure.Management.DataLake.Store, Version=0.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
70+
<Reference Include="Microsoft.Azure.Management.DataLake.Store, Version=0.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7171
<SpecificVersion>False</SpecificVersion>
72-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.DataLake.Store.0.10.1-preview\lib\net45\Microsoft.Azure.Management.DataLake.Store.dll</HintPath>
72+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.DataLake.Store.0.11.0-preview\lib\net45\Microsoft.Azure.Management.DataLake.Store.dll</HintPath>
7373
<Private>True</Private>
7474
</Reference>
7575
<Reference Include="Microsoft.Azure.Management.Storage">

src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics.Test/ScenarioTests/AdlaTests.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ function Test-DataLakeAnalyticsAccount
1919
{
2020
# Creating Account and initial setup
2121
New-AzureRmResourceGroup -Name $resourceGroupName -Location $location
22+
23+
# Test to make sure the account doesn't exist
24+
Assert-False {Test-AzureRMDataLakeAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName}
25+
# Test it without specifying a resource group
26+
Assert-False {Test-AzureRMDataLakeAnalyticsAccount -Name $accountName}
27+
2228
New-AzureRmDataLakeStoreAccount -ResourceGroupName $resourceGroupName -Name $dataLakeAccountName -Location $location
2329
New-AzureRmDataLakeStoreAccount -ResourceGroupName $resourceGroupName -Name $secondDataLakeAccountName -Location $location
2430
$accountCreated = New-AzureRmDataLakeAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName -Location $location -DefaultDataLakeStore $dataLakeAccountName
@@ -46,6 +52,11 @@ function Test-DataLakeAnalyticsAccount
4652
Assert-False {$i -eq 60} "dataLakeAnalytics account is not in succeeded state even after 30 min."
4753
}
4854

55+
# Test to make sure the account does exist now
56+
Assert-True {Test-AzureRMDataLakeAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName}
57+
# Test it without specifying a resource group
58+
Assert-True {Test-AzureRMDataLakeAnalyticsAccount -Name $accountName}
59+
4960
# Updating Account
5061
$tagsToUpdate = @{"Name" = "TestTag"; "Value" = "TestUpdate"}
5162
$accountUpdated = Set-AzureRmDataLakeAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName -Tags $tagsToUpdate

src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics.Test/SessionRecords/Microsoft.Azure.Commands.DataLakeAnalytics.Test.ScenarioTests.AdlaTests/TestAdlaAccount.json

Lines changed: 1584 additions & 927 deletions
Large diffs are not rendered by default.

src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics.Test/SessionRecords/Microsoft.Azure.Commands.DataLakeAnalytics.Test.ScenarioTests.AdlaTests/TestAdlaCatalog.json

Lines changed: 678 additions & 1080 deletions
Large diffs are not rendered by default.

src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics.Test/SessionRecords/Microsoft.Azure.Commands.DataLakeAnalytics.Test.ScenarioTests.AdlaTests/TestAdlaJob.json

Lines changed: 378 additions & 291 deletions
Large diffs are not rendered by default.

src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics.Test/SessionRecords/Microsoft.Azure.Commands.DataLakeAnalytics.Test.ScenarioTests.AdlaTests/TestNegativeAdlaAccount.json

Lines changed: 409 additions & 304 deletions
Large diffs are not rendered by default.

src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics.Test/SessionRecords/Microsoft.Azure.Commands.DataLakeAnalytics.Test.ScenarioTests.AdlaTests/TestNegativeAdlaJob.json

Lines changed: 338 additions & 293 deletions
Large diffs are not rendered by default.

src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics.Test/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
66
<package id="Microsoft.Azure.Gallery" version="2.6.2-preview" targetFramework="net45" />
77
<package id="Microsoft.Azure.Management.Authorization" version="2.0.0" targetFramework="net45" />
8-
<package id="Microsoft.Azure.Management.DataLake.Analytics" version="0.10.2-preview" targetFramework="net45" />
9-
<package id="Microsoft.Azure.Management.DataLake.Store" version="0.10.1-preview" targetFramework="net45" />
8+
<package id="Microsoft.Azure.Management.DataLake.Analytics" version="0.11.0-preview" targetFramework="net45" />
9+
<package id="Microsoft.Azure.Management.DataLake.Store" version="0.11.0-preview" targetFramework="net45" />
1010
<package id="Microsoft.Azure.Management.Resources" version="2.20.0-preview" targetFramework="net45" />
1111
<package id="Microsoft.Azure.Management.Storage" version="3.0.0" targetFramework="net45" />
1212
<package id="Microsoft.Azure.Test.Framework" version="1.0.5896.19355-prerelease" targetFramework="net45" />

src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics/Commands.DataLakeAnalytics.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
<Reference Include="Microsoft.Azure.Common.NetFramework">
4646
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
4747
</Reference>
48-
<Reference Include="Microsoft.Azure.Management.DataLake.Analytics, Version=0.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
48+
<Reference Include="Microsoft.Azure.Management.DataLake.Analytics, Version=0.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
4949
<SpecificVersion>False</SpecificVersion>
50-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.DataLake.Analytics.0.10.2-preview\lib\net45\Microsoft.Azure.Management.DataLake.Analytics.dll</HintPath>
50+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.DataLake.Analytics.0.11.0-preview\lib\net45\Microsoft.Azure.Management.DataLake.Analytics.dll</HintPath>
5151
<Private>True</Private>
5252
</Reference>
5353
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics/Commands/SubmitAzureRmDataLakeAnalyticsJob.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,11 @@ public override void ExecuteCmdlet()
184184

185185
if (!string.IsNullOrEmpty(CompileMode))
186186
{
187-
sqlIpProperties.CompileMode = CompileMode;
187+
CompileMode toUse;
188+
if(Enum.TryParse(CompileMode, out toUse))
189+
{
190+
sqlIpProperties.CompileMode = toUse;
191+
}
188192
}
189193

190194
if (!string.IsNullOrEmpty(Runtime))

src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics/Models/DataLakeAnalyticsClient.cs

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ public bool TestAccount(string resourceGroupName, string accountName)
149149
}
150150
catch (CloudException ex)
151151
{
152-
if (ex.Response != null && ex.Response.StatusCode == HttpStatusCode.NotFound)
152+
if ((ex.Response != null && ex.Response.StatusCode == HttpStatusCode.NotFound) || ex.Message.Contains(string.Format(Properties.Resources.FailedToDiscoverResourceGroup, accountName,
153+
_subscriptionId)))
153154
{
154155
return false;
155156
}
@@ -362,33 +363,33 @@ private IPage<DataLakeAnalyticsAccount> ListAccountsWithNextLink(string nextLink
362363
public USqlSecret CreateSecret(string accountName, string databaseName,
363364
string secretName, string password, string hostUri)
364365
{
365-
return _catalogClient.Catalog.CreateSecret(databaseName, secretName,
366+
return _catalogClient.Catalog.CreateSecret(accountName, databaseName, secretName,
366367
new DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters
367368
{
368369
Password = password,
369370
Uri = hostUri
370-
}, accountName);
371+
});
371372
}
372373

373374
public USqlSecret UpdateSecret(string accountName, string databaseName,
374375
string secretName, string password, string hostUri)
375376
{
376-
return _catalogClient.Catalog.UpdateSecret(databaseName, secretName,
377+
return _catalogClient.Catalog.UpdateSecret(accountName, databaseName, secretName,
377378
new DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters
378379
{
379380
Password = password,
380381
Uri = hostUri
381-
}, accountName);
382+
});
382383
}
383384

384385
public void DeleteSecret(string accountName, string databaseName, string secretName)
385386
{
386-
_catalogClient.Catalog.DeleteSecret(databaseName, secretName, accountName);
387+
_catalogClient.Catalog.DeleteSecret(accountName, databaseName, secretName);
387388
}
388389

389390
public USqlSecret GetSecret(string accountName, string databaseName, string secretName)
390391
{
391-
return _catalogClient.Catalog.GetSecret(databaseName, secretName, accountName);
392+
return _catalogClient.Catalog.GetSecret(accountName, databaseName, secretName);
392393
}
393394

394395
public bool TestCatalogItem(string accountName, CatalogPathInstance path,
@@ -576,7 +577,7 @@ public IList<CatalogItem> GetCatalogItem(string accountName, CatalogPathInstance
576577

577578
private USqlDatabase GetDatabase(string accountName, string databaseName)
578579
{
579-
return _catalogClient.Catalog.GetDatabase(databaseName, accountName);
580+
return _catalogClient.Catalog.GetDatabase(accountName, databaseName);
580581
}
581582

582583
private IList<USqlDatabase> GetDatabases(string accountName)
@@ -597,13 +598,13 @@ private USqlAssembly GetAssembly(string accountName, string databaseName,
597598
string assemblyName)
598599
{
599600
return
600-
_catalogClient.Catalog.GetAssembly(databaseName, assemblyName, accountName);
601+
_catalogClient.Catalog.GetAssembly(accountName, databaseName, assemblyName);
601602
}
602603

603604
private IList<USqlAssemblyClr> GetAssemblies(string accountName, string databaseName)
604605
{
605606
List<USqlAssemblyClr> toReturn = new List<USqlAssemblyClr>();
606-
var response = _catalogClient.Catalog.ListAssemblies(databaseName, accountName);
607+
var response = _catalogClient.Catalog.ListAssemblies(accountName, databaseName);
607608
toReturn.AddRange(response);
608609
while (!string.IsNullOrEmpty(response.NextPageLink))
609610
{
@@ -618,15 +619,15 @@ private USqlExternalDataSource GetExternalDataSource(string accountName,
618619
string databaseName, string dataSourceName)
619620
{
620621
return
621-
_catalogClient.Catalog.GetExternalDataSource(databaseName,
622-
dataSourceName, accountName);
622+
_catalogClient.Catalog.GetExternalDataSource(accountName, databaseName,
623+
dataSourceName);
623624
}
624625

625626
private IList<USqlExternalDataSource> GetExternalDataSources(string accountName,
626627
string databaseName)
627628
{
628629
List<USqlExternalDataSource> toReturn = new List<USqlExternalDataSource>();
629-
var response = _catalogClient.Catalog.ListExternalDataSources(databaseName, accountName);
630+
var response = _catalogClient.Catalog.ListExternalDataSources(accountName, databaseName);
630631
toReturn.AddRange(response);
631632
while (!string.IsNullOrEmpty(response.NextPageLink))
632633
{
@@ -641,15 +642,15 @@ private USqlCredential GetCredential(string accountName,
641642
string databaseName, string credName)
642643
{
643644
return
644-
_catalogClient.Catalog.GetCredential(databaseName,
645-
credName, accountName);
645+
_catalogClient.Catalog.GetCredential(accountName, databaseName,
646+
credName);
646647
}
647648

648649
private IList<USqlCredential> GetCredentials(string accountName,
649650
string databaseName)
650651
{
651652
List<USqlCredential> toReturn = new List<USqlCredential>();
652-
var response = _catalogClient.Catalog.ListCredentials(databaseName, accountName);
653+
var response = _catalogClient.Catalog.ListCredentials(accountName, databaseName);
653654
toReturn.AddRange(response);
654655
while (!string.IsNullOrEmpty(response.NextPageLink))
655656
{
@@ -663,13 +664,13 @@ private IList<USqlCredential> GetCredentials(string accountName,
663664
private USqlSchema GetSchema(string accountName, string databaseName,
664665
string schemaName)
665666
{
666-
return _catalogClient.Catalog.GetSchema(databaseName, schemaName, accountName);
667+
return _catalogClient.Catalog.GetSchema(accountName, databaseName, schemaName);
667668
}
668669

669670
private IList<USqlSchema> GetSchemas(string accountName, string databaseName)
670671
{
671672
List<USqlSchema> toReturn = new List<USqlSchema>();
672-
var response = _catalogClient.Catalog.ListSchemas(databaseName, accountName);
673+
var response = _catalogClient.Catalog.ListSchemas(accountName, databaseName);
673674
toReturn.AddRange(response);
674675
while (!string.IsNullOrEmpty(response.NextPageLink))
675676
{
@@ -684,14 +685,14 @@ private USqlTable GetTable(string accountName, string databaseName, string schem
684685
string tableName)
685686
{
686687
return
687-
_catalogClient.Catalog.GetTable(databaseName, schemaName, tableName, accountName);
688+
_catalogClient.Catalog.GetTable(accountName, databaseName, schemaName, tableName);
688689
}
689690

690691
private IList<USqlTable> GetTables(string accountName, string databaseName,
691692
string schemaName)
692693
{
693694
List<USqlTable> toReturn = new List<USqlTable>();
694-
var response = _catalogClient.Catalog.ListTables(databaseName, schemaName, accountName);
695+
var response = _catalogClient.Catalog.ListTables(accountName, databaseName, schemaName);
695696
toReturn.AddRange(response);
696697
while (!string.IsNullOrEmpty(response.NextPageLink))
697698
{
@@ -706,15 +707,15 @@ private USqlTableValuedFunction GetTableValuedFunction(string accountName,
706707
string databaseName, string schemaName, string tableValuedFunctionName)
707708
{
708709
return
709-
_catalogClient.Catalog.GetTableValuedFunction(databaseName, schemaName,
710-
tableValuedFunctionName, accountName);
710+
_catalogClient.Catalog.GetTableValuedFunction(accountName, databaseName, schemaName,
711+
tableValuedFunctionName);
711712
}
712713

713714
private IList<USqlTableValuedFunction> GetTableValuedFunctions(string accountName,
714715
string databaseName, string schemaName)
715716
{
716717
List<USqlTableValuedFunction> toReturn = new List<USqlTableValuedFunction>();
717-
var response = _catalogClient.Catalog.ListTableValuedFunctions(databaseName, schemaName, accountName);
718+
var response = _catalogClient.Catalog.ListTableValuedFunctions(accountName, databaseName, schemaName);
718719
toReturn.AddRange(response);
719720
while (!string.IsNullOrEmpty(response.NextPageLink))
720721
{
@@ -729,15 +730,15 @@ private USqlTableStatistics GetTableStatistic(string accountName, string databas
729730
string schemaName, string tableName, string statisticsName)
730731
{
731732
return
732-
_catalogClient.Catalog.GetTableStatistic(databaseName, schemaName,
733-
tableName, statisticsName, accountName);
733+
_catalogClient.Catalog.GetTableStatistic(accountName, databaseName, schemaName,
734+
tableName, statisticsName);
734735
}
735736

736737
private IList<USqlTableStatistics> GetTableStatistics(string accountName,
737738
string databaseName, string schemaName, string tableName)
738739
{
739740
List<USqlTableStatistics> toReturn = new List<USqlTableStatistics>();
740-
var response = _catalogClient.Catalog.ListTableStatistics(databaseName, schemaName, tableName, accountName);
741+
var response = _catalogClient.Catalog.ListTableStatistics(accountName, databaseName, schemaName, tableName);
741742
toReturn.AddRange(response);
742743
while (!string.IsNullOrEmpty(response.NextPageLink))
743744
{
@@ -752,14 +753,14 @@ private USqlView GetView(string accountName, string databaseName, string schemaN
752753
string viewName)
753754
{
754755
return
755-
_catalogClient.Catalog.GetView(databaseName, schemaName, viewName, accountName);
756+
_catalogClient.Catalog.GetView(accountName, databaseName, schemaName, viewName);
756757
}
757758

758759
private IList<USqlView> GetViews(string accountName, string databaseName,
759760
string schemaName)
760761
{
761762
List<USqlView> toReturn = new List<USqlView>();
762-
var response = _catalogClient.Catalog.ListViews(databaseName, schemaName, accountName);
763+
var response = _catalogClient.Catalog.ListViews(accountName, databaseName, schemaName);
763764
toReturn.AddRange(response);
764765
while (!string.IsNullOrEmpty(response.NextPageLink))
765766
{
@@ -774,14 +775,14 @@ private USqlProcedure GetProcedure(string accountName, string databaseName, stri
774775
string procName)
775776
{
776777
return
777-
_catalogClient.Catalog.GetProcedure(databaseName, schemaName, procName, accountName);
778+
_catalogClient.Catalog.GetProcedure(accountName, databaseName, schemaName, procName);
778779
}
779780

780781
private IList<USqlProcedure> GetProcedures(string accountName, string databaseName,
781782
string schemaName)
782783
{
783784
List<USqlProcedure> toReturn = new List<USqlProcedure>();
784-
var response = _catalogClient.Catalog.ListProcedures(databaseName, schemaName, accountName);
785+
var response = _catalogClient.Catalog.ListProcedures(accountName, databaseName, schemaName);
785786
toReturn.AddRange(response);
786787
while (!string.IsNullOrEmpty(response.NextPageLink))
787788
{
@@ -796,7 +797,7 @@ private IList<USqlType> GetTypes(string accountName, string databaseName,
796797
string schemaName)
797798
{
798799
List<USqlType> toReturn = new List<USqlType>();
799-
var response = _catalogClient.Catalog.ListTypes(databaseName, schemaName, accountName);
800+
var response = _catalogClient.Catalog.ListTypes(accountName, databaseName, schemaName);
800801
toReturn.AddRange(response);
801802
while (!string.IsNullOrEmpty(response.NextPageLink))
802803
{
@@ -813,35 +814,35 @@ private IList<USqlType> GetTypes(string accountName, string databaseName,
813814

814815
public JobInformation GetJob(string accountName, Guid jobId)
815816
{
816-
return _jobClient.Job.Get(jobId, accountName);
817+
return _jobClient.Job.Get(accountName, jobId);
817818
}
818819

819820
public JobInformation SubmitJob(string accountName, JobInformation jobToSubmit)
820821
{
821822
return
822-
_jobClient.Job.Create(jobToSubmit.JobId.GetValueOrDefault(),
823-
jobToSubmit, accountName);
823+
_jobClient.Job.Create(accountName, jobToSubmit.JobId.GetValueOrDefault(),
824+
jobToSubmit);
824825
}
825826

826827
public JobInformation BuildJob(string accountName, JobInformation jobToBuild)
827828
{
828829
return
829-
_jobClient.Job.Build(jobToBuild, accountName);
830+
_jobClient.Job.Build(accountName, jobToBuild);
830831
}
831832

832833
public void CancelJob(string accountName, Guid jobId)
833834
{
834-
_jobClient.Job.Cancel(jobId, accountName);
835+
_jobClient.Job.Cancel(accountName, jobId);
835836
}
836837

837838
public JobDataPath GetDebugDataPaths(string accountName, Guid jobId)
838839
{
839-
return _jobClient.Job.GetDebugDataPath(jobId, accountName);
840+
return _jobClient.Job.GetDebugDataPath(accountName, jobId);
840841
}
841842

842843
public JobStatistics GetJobStatistics(string accountName, Guid jobId)
843844
{
844-
return _jobClient.Job.GetStatistics(jobId, accountName);
845+
return _jobClient.Job.GetStatistics(accountName, jobId);
845846
}
846847

847848
public List<JobInformation> ListJobs(string accountName, string filter, int? top,

0 commit comments

Comments
 (0)