Skip to content

Commit

Permalink
Allow empty results in Hive (from SET, eg) (apache#6695)
Browse files Browse the repository at this point in the history
* Allow empty results in Hive (from SET, eg)

* Remove patch

* Merge heads

* Delete merge heads

(cherry picked from commit 0038881)
(cherry picked from commit e535817)
  • Loading branch information
betodealmeida committed Jan 30, 2019
1 parent 4266b8c commit 28dbf07
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion superset/db_engine_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1004,11 +1004,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:
return []

@staticmethod
def create_table_from_csv(form, table):
Expand Down

0 comments on commit 28dbf07

Please sign in to comment.