From 58bfcb4273570f15230fb973fa4b7261155465f6 Mon Sep 17 00:00:00 2001 From: Yurong He <43652751+YurongHe@users.noreply.github.com> Date: Tue, 4 Dec 2018 10:36:34 -0800 Subject: [PATCH] Fixed can't read indexof exception when no big data cluster connection and switch to PySpark3 (#3413) --- src/sql/parts/notebook/models/notebookModel.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/sql/parts/notebook/models/notebookModel.ts b/src/sql/parts/notebook/models/notebookModel.ts index 863b8789be..506437e3c0 100644 --- a/src/sql/parts/notebook/models/notebookModel.ts +++ b/src/sql/parts/notebook/models/notebookModel.ts @@ -281,9 +281,14 @@ export class NotebookModel extends Disposable implements INotebookModel { notebookManager: this.notebookManager, notificationService: this.notebookOptions.notificationService }); - let id: string = this.connectionProfile ? this.connectionProfile.id : undefined; + let profile = this.connectionProfile as IConnectionProfile; + + if (this.isValidKnoxConnection(profile)) { + this._hadoopConnection = new NotebookConnection(this.connectionProfile); + } else { + this._hadoopConnection = undefined; + } - this._hadoopConnection = this.connectionProfile ? new NotebookConnection(this.connectionProfile) : undefined; this._clientSession.initialize(this._hadoopConnection); this._sessionLoadFinished = this._clientSession.ready.then(async () => { if (this._clientSession.isInErrorState) {