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/15 23:48:43 UTC

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

mistercrunch 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_r248106587
 
 

 ##########
 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:
   This seems dangerous as in theory it's the dbapi error that should be returned if there's anything wrong with the SQL... https://www.python.org/dev/peps/pep-0249/#programmingerror
   
   "Table not found" should not succeed with an empty result set...

----------------------------------------------------------------
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