Fix Spark kernel connections and switch from Kusto to Spark kernels (#12436)

* Fix connection dialog for Spark and issue when switching from Kusto to Spark

* Address comments
This commit is contained in:
Vasu Bhog
2020-09-17 22:16:42 -05:00
committed by GitHub
parent a9f78694ee
commit eea35d4920
2 changed files with 14 additions and 4 deletions

View File

@@ -457,8 +457,15 @@ export class AttachToDropdown extends SelectBox {
try {
// Get all providers to show all available connections in connection dialog
let providers = this.model.getApplicableConnectionProviderIds(this.model.clientSession.kernel.name);
for (let alias of this.model.kernelAliases) {
providers = providers.concat(this.model.getApplicableConnectionProviderIds(alias));
// Spark kernels are unable to get providers from above, therefore ensure that we get the
// correct providers for the selected kernel and load the proper connections for the connection dialog
// Example Scenario: Spark Kernels should only have MSSQL connections in connection dialog
if (!this.model.kernelAliases.includes(this.model.selectedKernelDisplayName) && this.model.clientSession.kernel.name !== 'SQL') {
providers = providers.concat(this.model.getApplicableConnectionProviderIds(this.model.selectedKernelDisplayName));
} else {
for (let alias of this.model.kernelAliases) {
providers = providers.concat(this.model.getApplicableConnectionProviderIds(alias));
}
}
let connection = await this._connectionDialogService.openDialogAndWait(this._connectionManagementService,
{