瀏覽代碼

HUE-7 [metastore] Automatically prompt for partition when using Kudu format

Romain Rigaux 9 年之前
父節點
當前提交
46ed47a6a4
共有 1 個文件被更改,包括 9 次插入4 次删除
  1. 9 4
      desktop/libs/indexer/src/indexer/templates/importer.mako

+ 9 - 4
desktop/libs/indexer/src/indexer/templates/importer.mako

@@ -438,6 +438,10 @@ ${ assist.assistPanel() }
               <input type="checkbox" data-bind="checked: importData, disable: ! useDefaultLocation() && $parent.createWizard.source.path() == nonDefaultLocation();"> ${_('Import data')}
             </label>
 
+            <label class="checkbox">
+              <input type="checkbox" data-bind="checked: hasHeader"> ${_('Use first row has header')}
+            </label>
+
             <label class="checkbox">
               <input type="checkbox" data-bind="checked: useCustomDelimiters"> ${_('Custom char delimiters')}
             </label>
@@ -471,10 +475,6 @@ ${ assist.assistPanel() }
               </label>
             </div>
 
-            <label class="checkbox">
-              <input type="checkbox" data-bind="checked: hasHeader"> ${_('Use first row has header')}
-            </label>
-
             <label class="control-label"><div>${ _('Partitions') }</div>
 
               <!-- ko if: tableFormat() != 'kudu' -->
@@ -1217,6 +1217,11 @@ ${ assist.assistPanel() }
         return self.outputFormat() == 'table' && self.name().indexOf('.') > 0 ? self.name().split('.', 2)[0] : 'default';
       });
       self.tableFormat = ko.observable('text');
+      self.tableFormat.subscribe(function(newVal) {
+        if (newVal == 'kudu' && self.kuduPartitionColumns().length == 0) {
+          self.kuduPartitionColumns.push(ko.mapping.fromJS({columns: [], range_partitions: [], name: 'HASH', int_val: 16}));
+        }
+      });
       self.tableFormats = ko.observableArray([
           {'value': 'text', 'name': 'Text'},
           {'value': 'parquet', 'name': 'Parquet'},