Selaa lähdekoodia

HUE-1637 [metastore] Provide URLs for databases

Meta-1 solution
Also display no comment instead of None on the table page
Romain Rigaux 12 vuotta sitten
vanhempi
commit
73572baf4b

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

@@ -202,7 +202,7 @@ class HiveServerTTableSchema:
     except:
       # Impala API is different
       cols = HiveServerTRowSet(self.columns, self.schema).cols(('name', 'type', 'comment'))
-      for col in cols: 
+      for col in cols:
         col['col_name'] = col.pop('name')
         col['col_type'] = col.pop('type')
       return cols
@@ -562,7 +562,7 @@ class HiveServerTableCompatible(HiveServerTable):
   def cols(self):
     return [type('Col', (object,), {'name': col.get('col_name', '').strip(),
                                     'type': col.get('data_type', ''),
-                                    'comment': col.get('comment', ''), }) for col in HiveServerTable.cols.fget(self)]
+                                    'comment': col.get('comment', '').strip(), }) for col in HiveServerTable.cols.fget(self)]
 
 
 class ResultCompatible:

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

@@ -45,9 +45,11 @@
     </li>
     % for crumb in breadcrumbs:
     <li>
-      <a href="${ crumb['url'] }">${ crumb['name'] }</a>
       % if not loop.last:
+        <a href="${ crumb['url'] }">${ crumb['name'] }</a>
         <span class="divider">&gt;</span>
+      % else:
+        <span style="padding-left:12px">${ crumb['name'] }</span>
       % endif
     </li>
     % endfor

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

@@ -44,7 +44,7 @@ ${ components.menubar() }
         <tr>
           <td>${ column.name }</td>
           <td>${ column.type }</td>
-          <td>${ column.comment or "" }</td>
+          <td>${ column.comment != 'None' and column.comment or "" }</td>
         </tr>
       % endfor
     </tbody>