Explorar o código

HUE-4908 [metastore] Remove notion of HDFS for Kudu tables

Romain Rigaux %!s(int64=9) %!d(string=hai) anos
pai
achega
bd5712a

+ 6 - 3
apps/beeswax/src/beeswax/server/hive_server2_lib.py

@@ -71,6 +71,7 @@ class HiveServerTable(Table):
     self.table_schema = table_schema
     self.desc_results = desc_results
     self.desc_schema = desc_schema
+    self.is_impala_only = False # Aka Kudu
 
     self.describe = HiveServerTTableSchema(self.desc_results, self.desc_schema).cols()
     self._details = None
@@ -93,6 +94,9 @@ class HiveServerTable(Table):
 
   @property
   def path_location(self):
+    if self.is_impala_only:
+      return None
+
     try:
       rows = self.describe
       rows = [row for row in rows if row['col_name'].startswith('Location:')]
@@ -182,8 +186,8 @@ class HiveServerTable(Table):
           'properties': {
             'owner': props.get('Owner:'),
             'create_time': props.get('CreateTime:'),
-            'compressed': props.get('Compressed:', 'No') != 'No',
-            'format': 'parquet' if 'ParquetHiveSerDe' in serde else ('text' if 'LazySimpleSerDe' in serde else serde.rsplit('.', 1)[-1]),
+            'compressed': props.get('Compressed:', 'No') != 'No' or self.is_impala_only,
+            'format': 'parquet' if 'ParquetHiveSerDe' in serde else ('text' if 'LazySimpleSerDe' in serde else ('kudu' if self.is_impala_only else serde.rsplit('.', 1)[-1])),
         }
       }
 
@@ -1028,7 +1032,6 @@ class HiveServerTableCompatible(HiveServerTable):
 
     self.describe = HiveServerTTableSchema(self.desc_results, self.desc_schema).cols()
     self._details = None
-    self.is_impala_only = False
 
   @property
   def cols(self):

+ 7 - 1
apps/metastore/src/metastore/templates/metastore.mako

@@ -274,7 +274,13 @@ ${ components.menubar() }
     </h4>
     <div class="row-fluid">
       <div>
-        <i class="fa fa-fw fa-hdd-o muted"></i> <a data-bind="attr: {'href': hdfs_link, 'rel': path_location}">${_('Location')}</a>
+        <i class="fa fa-fw fa-hdd-o muted"></i>
+        <!-- ko if: details.properties.format == 'kudu' -->
+          ${_('Stored in')} Kudu
+        <!-- /ko -->
+        <!-- ko if: details.properties.format != 'kudu' -->
+          <a data-bind="attr: {'href': hdfs_link, 'rel': path_location}">${_('Location')}</a>
+        <!-- /ko -->
       </div>
       <!-- ko with: $parent.tableStats -->
         <!-- ko if: typeof last_modified_by !== 'undefined' -->