This is an automated email from the ASF dual-hosted git repository.
beto 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 0038881 Allow empty results in Hive (from SET, eg) (#6695)
0038881 is described below
commit 00388811b6e5ea56c8e3c92428d6cd805a98c8d1
Author: Beto Dealmeida <[email protected]>
AuthorDate: Fri Jan 18 10:11:59 2019 -0800
Allow empty results in Hive (from SET, eg) (#6695)
* Allow empty results in Hive (from SET, eg)
* Remove patch
* Merge heads
* Delete merge heads
---
superset/db_engine_specs.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py
index 379c0cf..00643c0 100644
--- a/superset/db_engine_specs.py
+++ b/superset/db_engine_specs.py
@@ -1067,11 +1067,15 @@ class HiveEngineSpec(PrestoEngineSpec):
@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):