Browse Source

HUE-8216 [metadata] Workaround Impala not always specifying a table is actually a view

Romain Rigaux 7 years ago
parent
commit
b5ddd9cd6a
1 changed files with 4 additions and 1 deletions
  1. 4 1
      desktop/libs/metadata/src/metadata/navigator_client.py

+ 4 - 1
desktop/libs/metadata/src/metadata/navigator_client.py

@@ -350,7 +350,6 @@ class NavigatorApi(object):
 
       query_filters = {
         'sourceType': source_type,
-        'type': type,
         'originalName': name,
         'deleted': 'false'
       }
@@ -359,6 +358,10 @@ class NavigatorApi(object):
         query_filters[key] = value
 
       filter_query = 'AND'.join('(%s:%s)' % (key, value) for key, value in query_filters.items())
+      filter_query = '%(type)s AND %(filter_query)s' % {
+        'type': '(type:%s)' % 'TABLE OR type:VIEW' if type == 'TABLE' else type, # Impala does not always say that a table is actually a view
+        'filter_query': filter_query
+      }
 
       source_ids = get_cluster_source_ids(self)
       if source_ids: