فهرست منبع

HUE-2470 [beeswax] DB Assist should load different Impala and Hive tables without hitting refresh

Prefixed totalStorage with the app name
Enrico Berti 11 سال پیش
والد
کامیت
d3f2a58
2فایلهای تغییر یافته به همراه8 افزوده شده و 3 حذف شده
  1. 1 0
      apps/beeswax/src/beeswax/templates/execute.mako
  2. 7 3
      apps/beeswax/static/js/autocomplete.utils.js

+ 1 - 0
apps/beeswax/src/beeswax/templates/execute.mako

@@ -978,6 +978,7 @@ var codeMirror, renderNavigator, resetNavigator, resizeNavigator, dataTable, ren
 var HIVE_AUTOCOMPLETE_BASE_URL = "${ autocomplete_base_url | n,unicode }";
 var HIVE_AUTOCOMPLETE_FAILS_QUIETLY_ON = [500]; // error codes from beeswax/views.py - autocomplete
 var HIVE_AUTOCOMPLETE_USER = "${ user }";
+var HIVE_AUTOCOMPLETE_APP = "${app_name}";
 
 var HIVE_AUTOCOMPLETE_GLOBAL_CALLBACK = function (data) {
   if (data != null && data.error && typeof resetNavigator != "undefined") {

+ 7 - 3
apps/beeswax/static/js/autocomplete.utils.js

@@ -58,11 +58,15 @@ function hac_getTableAliases(textScanned) {
   return _aliases;
 }
 
-function hac_getTotalStorageUserPrefix(){
+function hac_getTotalStorageUserPrefix() {
+  var _app = "";
+  if (typeof HIVE_AUTOCOMPLETE_APP != "undefined") {
+    _app = HIVE_AUTOCOMPLETE_APP;
+  }
   if (typeof HIVE_AUTOCOMPLETE_USER != "undefined") {
-    return HIVE_AUTOCOMPLETE_USER + "_";
+    return _app + "_" + HIVE_AUTOCOMPLETE_USER + "_";
   }
-  return "";
+  return (_app != "" ? _app + "_" : "");
 }
 
 function hac_getTableColumns(databaseName, tableName, textScanned, callback) {