Эх сурвалжийг харах

HUE-8768 [editor] Include sessions when executing in notebook 2

Johan Ahlen 6 жил өмнө
parent
commit
f38759be48

+ 1 - 1
desktop/core/src/desktop/js/api/apiHelper.js

@@ -1578,7 +1578,7 @@ class ApiHelper {
     if (options.path.length === 1) {
       url = '/metastore/databases/' + options.path[0] + '/metadata';
     } else {
-      url = '/notebook/api/describe/' + options.path[0]
+      url = '/notebook/api/describe/' + options.path[0];
 
       if (options.path.length > 1) {
         url += '/' + options.path[1] + '/';

+ 2 - 1
desktop/core/src/desktop/js/apps/notebook2/execution/executableStatement.js

@@ -46,6 +46,7 @@ class ExecutableStatement {
    * @param {string} [options.statement] - Either supply a statement or a parsedStatement
    * @param {SqlStatementsParserResult} [options.parsedStatement] - Either supply a statement or a parsedStatement
    * @param {string} [options.database]
+   * @param {Session[]} [options.sessions]
    */
   constructor(options) {
     this.compute = options.compute;
@@ -54,11 +55,11 @@ class ExecutableStatement {
     this.sourceType = options.sourceType;
     this.parsedStatement = options.parsedStatement;
     this.statement = options.statement;
+    this.sessions = options.sessions;
     this.handle = {
       statement_id: 0 // TODO: Get rid of need for initial handle in the backend
     };
 
-    this.executionResult = undefined;
     this.lastCancellable = undefined;
     this.status = EXECUTION_STATUS.ready;
     this.progress = 0;

+ 2 - 1
desktop/core/src/desktop/js/apps/notebook2/execution/executor.js

@@ -34,7 +34,7 @@ class Executor {
    * @param {ContextCompute} options.compute
    * @param {ContextNamespace} options.namespace
    * @param {EXECUTION_FLOW} [options.executionFlow] (default EXECUTION_FLOW.batch)
-   * @param {Session} [options.session]
+   * @param {Session[]} [options.sessions]
    * @param {string} options.statement
    * @param {string} [options.database]
    */
@@ -73,6 +73,7 @@ class Executor {
                 compute: options.compute,
                 namespace: options.namespace,
                 database: database,
+                sessions: options.sessions,
                 parsedStatement: parsedStatement
               })
             );

+ 2 - 1
desktop/core/src/desktop/js/apps/notebook2/snippet.js

@@ -1356,7 +1356,8 @@ class Snippet {
       sourceType: this.type(),
       namespace: this.namespace(),
       statement: this.statement(),
-      isSqlEngine: this.isSqlDialect()
+      isSqlEngine: this.isSqlDialect(),
+      sessions: komapping.toJS(this.parentNotebook.sessions)
     });
 
     this.executor.executeNext().then(executionResult => {