Pārlūkot izejas kodu

HUE-8610 [tb] Include compute when fetching samples from the table browser

Johan Ahlen 7 gadi atpakaļ
vecāks
revīzija
3e5ac80a78

+ 2 - 1
desktop/core/src/desktop/static/desktop/js/apiHelper.js

@@ -1658,7 +1658,8 @@ var ApiHelper = (function () {
     self.simplePost(SAMPLE_API_PREFIX + options.path.join('/'), {
       notebook: {},
       snippet: JSON.stringify({
-        type: options.sourceType
+        type: options.sourceType,
+        compute: options.compute
       }),
       async: true,
       operation: '"' + (options.operation || 'default') + '"'

+ 4 - 0
desktop/libs/notebook/src/notebook/models.py

@@ -66,6 +66,10 @@ def make_notebook(name='Browse', description='', editor_type='hive', statement='
   '''
   from notebook.connectors.hiveserver2 import HS2Api
 
+  # impala can have compute name appended to the editor_type (impala/dbms.py - get_query_server_config)
+  if editor_type.startswith('impala'):
+    editor_type = 'impala'
+
   editor = Notebook()
   if snippet_properties is None:
     snippet_properties = {}