superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: Proper error handling in Hive Queries (#4428)
Date Tue, 29 May 2018 19:42:54 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new ae50845  Proper error handling in Hive Queries (#4428)
ae50845 is described below

commit ae50845843513eaf536a4a9ffef012fdf8a708b3
Author: Maciej BryƄski <maciek-github@brynski.pl>
AuthorDate: Tue May 29 21:42:45 2018 +0200

    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 0e189b1..03cf2bd 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."""

-- 
To stop receiving notification emails like this one, please contact
maximebeauchemin@apache.org.

Mime
View raw message