Răsfoiți Sursa

HUE-5957 [metadata] Clicking on table name should add DB prefix too in autocomplete

Romain Rigaux 8 ani în urmă
părinte
comite
4b3e7d7

+ 2 - 0
desktop/libs/metadata/src/metadata/navigator_api.py

@@ -258,6 +258,8 @@ def _augment_highlighting(query_s, records):
     if record['hue_name'] and record.get('sourceType', '') != 'S3':
       record['hue_name'] = (record['hue_name'].replace('/', '.') + '.').lstrip('.')
 
+    record['originalName'] = record['hue_name'] + name # Used in autocomplete
+
     for term in ts:
       name = _highlight(term, name)
       if record.get('tags'):

+ 3 - 0
desktop/libs/metadata/src/metadata/navigator_client.py

@@ -138,6 +138,9 @@ class NavigatorApi(object):
 
       for term in search_terms:
         if ':' not in term:
+          if ('sql' in sources or 'hive' in sources or 'impala' in sources) and '.' in term:
+            parent, term = term.rsplit('.', 2)
+            user_filters.append('parentPath:"/%s"' % parent.replace('.', '/'))
           query_clauses.append('OR'.join(['(%s:*%s*)' % (field, term) for field in search_fields]))
         else:
           name, val = term.split(':')