Ver código fonte

[metastore] Display a preview of the table partitions

Romain Rigaux 10 anos atrás
pai
commit
cb656510f0

+ 0 - 5
apps/beeswax/src/beeswax/server/hive_server2_lib.py

@@ -178,11 +178,6 @@ class HiveServerTable(Table):
         } 
       }
 
-#       self.details['properties']['format'] = {
-#           'compressed': self.details['properties'].get('Compressed:', 'No') != 'No',
-#           'type': 'parquet' if 'ParquetHiveSerDe' in serde else ('text' if 'LazySimpleSerDe' in serde else serde.rsplit('.', 1)[-1])
-#       } 
-
     return self._details
 
 

+ 13 - 3
apps/metastore/src/metastore/templates/describe_table.mako

@@ -192,9 +192,19 @@ ${ components.menubar() }
 
                 <div class="sample-preview card card-home card-tab card-tab-bordertop card-listcontent">
                   <h3>${ _('Sample') }</h3>
-                  ${ sample_table(3) }
-                  ${_('View more...')}
+                  % if sample:
+                    ${ sample_table(limit=3) }                  
+                    ${_('View more...')}
+                  % endif
+                </div>
+
+                % if table.partition_keys:
+                <div class="partitions-preview card card-home card-tab card-tab-bordertop card-listcontent">
+                  <h3>${ _('Partitions') }</h3>
+                    ${ column_table(table.partition_keys, "partitionTable", limit=3) }                  
+                    ${_('View more...')}
                 </div>
+                % endif                
               </div>
 
               <div class="tab-pane" id="columns">
@@ -212,7 +222,7 @@ ${ components.menubar() }
               % if error_message:
                 <div class="alert alert-error">
                   <h3>${_('Error!')}</h3>
-                  <pre>${ error_message | h }</pre>
+                  <pre>${ error_message }</pre>
                 </div>
               % else:
                 ${ sample_table() }