From 4f992746d82ad2d531a6384b582710e2870dd3d2 Mon Sep 17 00:00:00 2001 From: chgagnon Date: Fri, 2 Oct 2020 10:01:52 -0700 Subject: [PATCH] Fix HDFS node to only show up for BDC connections --- .../objectExplorerNodeProvider.ts | 3 +++ extensions/mssql/src/utils.ts | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/extensions/mssql/src/objectExplorerNodeProvider/objectExplorerNodeProvider.ts b/extensions/mssql/src/objectExplorerNodeProvider/objectExplorerNodeProvider.ts index cde5c97ba32b..15c9b19fc2cb 100644 --- a/extensions/mssql/src/objectExplorerNodeProvider/objectExplorerNodeProvider.ts +++ b/extensions/mssql/src/objectExplorerNodeProvider/objectExplorerNodeProvider.ts @@ -48,6 +48,9 @@ export class MssqlObjectExplorerNodeProvider extends ProviderBase implements azd let sqlConnProfile = await azdata.objectexplorer.getSessionConnectionProfile(session.sessionId); if (!sqlConnProfile) { return false; } + const isBigDataCluster = await utils.isBigDataCluster(sqlConnProfile.id); + if (!isBigDataCluster) { return false; } + let clusterSession = new SqlClusterSession(session, sqlConnProfile, this.appContext, this); this.clusterSessionMap.set(session.sessionId, clusterSession); return true; diff --git a/extensions/mssql/src/utils.ts b/extensions/mssql/src/utils.ts index 67748506c007..9eee2dfc2786 100644 --- a/extensions/mssql/src/utils.ts +++ b/extensions/mssql/src/utils.ts @@ -240,6 +240,12 @@ export function getClusterEndpoints(serverInfo: azdata.ServerInfo): bdc.IEndpoin }); } +export async function isBigDataCluster(connectionId: string): Promise { + const serverInfo = await azdata.connection.getServerInfo(connectionId); + + return !!serverInfo?.options?.[constants.isBigDataClusterProperty]; +} + export type HostAndIp = { host: string, port: string }; export function getHostAndPortFromEndpoint(endpoint: string): HostAndIp {