Browse Source

HUE-6884 [core] Allow to blacklist the Hive

Romain Rigaux 8 years ago
parent
commit
ab6b4c6

+ 1 - 1
apps/beeswax/src/beeswax/server/hive_server2_lib.py

@@ -359,7 +359,7 @@ class HiveServerTTableSchema:
     return filter(lambda (i, col): col.columnName == column_name, enumerate(self.schema.columns))[0][0]
     return filter(lambda (i, col): col.columnName == column_name, enumerate(self.schema.columns))[0][0]
 
 
 
 
-if beeswax_conf.THRIFT_VERSION.get() >= 7:
+if hasattr(beeswax_conf.THRIFT_VERSION, 'get') and beeswax_conf.THRIFT_VERSION.get() >= 7:
   HiveServerTRow = HiveServerTRow2
   HiveServerTRow = HiveServerTRow2
   HiveServerTRowSet = HiveServerTRowSet2
   HiveServerTRowSet = HiveServerTRowSet2
 else:
 else:

+ 1 - 1
desktop/core/src/desktop/templates/common_header_footer_components.mako

@@ -162,7 +162,7 @@ from metadata.conf import has_optimizer, OPTIMIZER
     };
     };
 
 
     MetastoreGlobals = {
     MetastoreGlobals = {
-      partitionsLimit: ${ LIST_PARTITIONS_LIMIT.get() },
+      partitionsLimit: ${ hasattr(LIST_PARTITIONS_LIMIT, 'get') and LIST_PARTITIONS_LIMIT.get() or 1000 },
       i18n: {
       i18n: {
         errorRefreshingTableStats: '${_('An error occurred refreshing the table stats. Please try again.')}',
         errorRefreshingTableStats: '${_('An error occurred refreshing the table stats. Please try again.')}',
         errorLoadingDatabases: '${ _('There was a problem loading the databases. Please try again.') }',
         errorLoadingDatabases: '${ _('There was a problem loading the databases. Please try again.') }',

+ 3 - 3
desktop/core/src/desktop/templates/common_notebook_ko_components.mako

@@ -184,12 +184,12 @@ except ImportError, e:
       </a>
       </a>
       <ul class="dropdown-menu less-padding">
       <ul class="dropdown-menu less-padding">
         <li>
         <li>
-          <a class="download" href="javascript:void(0)" data-bind="click: downloadCsv, event: { mouseover: function(){ window.onbeforeunload = null; }, mouseout: function() { window.onbeforeunload = $(window).data('beforeunload'); } }" title="${ _('Download first %s rows as CSV') % DOWNLOAD_ROW_LIMIT.get() }">
+          <a class="download" href="javascript:void(0)" data-bind="click: downloadCsv, event: { mouseover: function(){ window.onbeforeunload = null; }, mouseout: function() { window.onbeforeunload = $(window).data('beforeunload'); } }" title="${ _('Download first %s rows as CSV') % (hasattr(DOWNLOAD_ROW_LIMIT, 'get') and DOWNLOAD_ROW_LIMIT.get()) }">
             <i class="fa fa-fw fa-file-o"></i> ${ _('CSV') }
             <i class="fa fa-fw fa-file-o"></i> ${ _('CSV') }
           </a>
           </a>
         </li>
         </li>
         <li>
         <li>
-          <a class="download" href="javascript:void(0)" data-bind="click: downloadXls, event: { mouseover: function(){ window.onbeforeunload = null; }, mouseout: function() { window.onbeforeunload = $(window).data('beforeunload'); } }" title="${ _('Download first %s rows as XLS') % DOWNLOAD_ROW_LIMIT.get() }">
+          <a class="download" href="javascript:void(0)" data-bind="click: downloadXls, event: { mouseover: function(){ window.onbeforeunload = null; }, mouseout: function() { window.onbeforeunload = $(window).data('beforeunload'); } }" title="${ _('Download first %s rows as XLS') % (hasattr(DOWNLOAD_ROW_LIMIT, 'get') and DOWNLOAD_ROW_LIMIT.get()) }">
             <i class="fa fa-fw fa-file-excel-o"></i> ${ _('Excel') }
             <i class="fa fa-fw fa-file-excel-o"></i> ${ _('Excel') }
           </a>
           </a>
         </li>
         </li>
@@ -231,7 +231,7 @@ except ImportError, e:
               <div class="controls">
               <div class="controls">
                  <label class="radio">
                  <label class="radio">
                   <input data-bind="checked: saveTarget" type="radio" name="save-results-type" value="hdfs-file">
                   <input data-bind="checked: saveTarget" type="radio" name="save-results-type" value="hdfs-file">
-                  &nbsp;${ _('File (first %s rows)') % DOWNLOAD_ROW_LIMIT.get() }
+                  &nbsp;${ _('File (first %s rows)') % (hasattr(DOWNLOAD_ROW_LIMIT, 'get') and DOWNLOAD_ROW_LIMIT.get()) }
                 </label>
                 </label>
                 <div data-bind="visible: saveTarget() == 'hdfs-file'" class="inline">
                 <div data-bind="visible: saveTarget() == 'hdfs-file'" class="inline">
                   <input data-bind="value: savePath, valueUpdate:'afterkeydown', filechooser: { value: savePath, isNestedModal: true }, filechooserOptions: { uploadFile: false, skipInitialPathIfEmpty: true, linkMarkup: true }, hdfsAutocomplete: savePath" type="text" name="target_file" placeholder="${_('Path to CSV file')}" class="pathChooser margin-left-10">
                   <input data-bind="value: savePath, valueUpdate:'afterkeydown', filechooser: { value: savePath, isNestedModal: true }, filechooserOptions: { uploadFile: false, skipInitialPathIfEmpty: true, linkMarkup: true }, hdfsAutocomplete: savePath" type="text" name="target_file" placeholder="${_('Path to CSV file')}" class="pathChooser margin-left-10">