Sfoglia il codice sorgente

[metastore] Add extra table fields to the json table call

Romain Rigaux 10 anni fa
parent
commit
e66d18d

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

@@ -348,14 +348,16 @@ ${ assist.assistPanel() }
                 <table data-bind="visible: !loadingQueries()" class="table table-condensed">
                   <thead>
                     <tr>
-                      <th width="30%">${ _('Name') }</th>
+                      <th width="20%">${ _('Name') }</th>
                       <th>${ _('Query') }</th>
+                      <th width="20%">${ _('Owner') }</th>
                     </tr>
                   </thead>
                   <tbody data-bind="foreach: queries">
                     <tr class="pointer" data-bind="click: function(){ location.href=doc.absoluteUrl; }">
                       <td data-bind="text: doc.name"></td>
                       <td><code data-bind="text: data.snippets[0].statement_raw"></code></td>
+                      <td><code data-bind="text: doc.owner"></code></td>
                     </tr>
                   </tbody>
                 </table>

+ 3 - 0
apps/metastore/src/metastore/views.py

@@ -237,10 +237,13 @@ def describe_table(request, database, table):
   if request.REQUEST.get("format", "html") == "json" and request.REQUEST.get("sample", "false") == "false":
     return JsonResponse({
         'status': 0,
+        'name': table.name,
         'partition_keys': [{'name': part.name, 'type': part.type} for part in table.partition_keys],
         'cols': [{'name': col.name, 'type': col.type, 'comment': col.comment} for col in table.cols],
         'path_location': table.path_location,
+        'hdfs_link': table.hdfs_link,
         'comment': table.comment,
+        'is_view': table.is_view,
         'properties': table.properties, 
         'details': table.details,
         'stats': table.stats