You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/01/16 04:48:27 UTC

[GitHub] betodealmeida commented on a change in pull request #6695: Allow empty results in Hive (from SET, eg)

betodealmeida commented on a change in pull request #6695: Allow empty results in Hive (from SET, eg)
URL: https://github.com/apache/incubator-superset/pull/6695#discussion_r248150550
 
 

 ##########
 File path: superset/db_engine_specs.py
 ##########
 @@ -1003,11 +1003,15 @@ def fetch_result_sets(cls, db, datasource_type):
 
     @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:
 
 Review comment:
   @mistercrunch, if there's something wrong with the query it would raise the exception when calling `.execute()`, no? It seems to me that catching exceptions in `.fetchall()` should be fine, since the query has already ran.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org