diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py index 379c0cf724f..00643c0d36c 100644 --- a/superset/db_engine_specs.py +++ b/superset/db_engine_specs.py @@ -1067,11 +1067,15 @@ class HiveEngineSpec(PrestoEngineSpec): @classmethod def fetch_data(cls, cursor, limit): + import pyhive from TCLIService import ttypes state = cursor.poll() if state.operationState == ttypes.TOperationState.ERROR_STATE: raise Exception('Query error', state.errorMessage) - return super(HiveEngineSpec, cls).fetch_data(cursor, limit) + try: + return super(HiveEngineSpec, cls).fetch_data(cursor, limit) + except pyhive.exc.ProgrammingError: + return [] @staticmethod def create_table_from_csv(form, table):