From ae50845843513eaf536a4a9ffef012fdf8a708b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Bry=C5=84ski?= Date: Tue, 29 May 2018 21:42:45 +0200 Subject: [PATCH] Proper error handling in Hive Queries (#4428) * Proper error handling in Hive Queries * Change quotes * Trigger checks * Adding call to parent class * Small fix * Fix in method call --- superset/db_engine_specs.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py index 0e189b125..03cf2bd25 100644 --- a/superset/db_engine_specs.py +++ b/superset/db_engine_specs.py @@ -931,6 +931,14 @@ class HiveEngineSpec(PrestoEngineSpec): return BaseEngineSpec.fetch_result_sets( db, datasource_type, force=force) + @classmethod + def fetch_data(cls, cursor, limit): + 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) + @staticmethod def create_table_from_csv(form, table): """Uploads a csv file and creates a superset datasource in Hive."""