|
@@ -27,6 +27,7 @@ from desktop.lib.exceptions import StructuredThriftTransportException
|
|
|
|
|
|
|
|
from impala.settings import NICE_NAME
|
|
from impala.settings import NICE_NAME
|
|
|
|
|
|
|
|
|
|
+
|
|
|
LOG = logging.getLogger(__name__)
|
|
LOG = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
|
|
|
|
@@ -174,6 +175,7 @@ AUTH_PASSWORD_SCRIPT = Config(
|
|
|
def config_validator(user):
|
|
def config_validator(user):
|
|
|
# dbms is dependent on beeswax.conf (this file)
|
|
# dbms is dependent on beeswax.conf (this file)
|
|
|
# import in method to avoid circular dependency
|
|
# import in method to avoid circular dependency
|
|
|
|
|
+ from beeswax.design import hql_query
|
|
|
from beeswax.server import dbms
|
|
from beeswax.server import dbms
|
|
|
from beeswax.server.dbms import get_query_server_config
|
|
from beeswax.server.dbms import get_query_server_config
|
|
|
|
|
|
|
@@ -183,7 +185,12 @@ def config_validator(user):
|
|
|
if not 'test' in sys.argv: # Avoid tests hanging
|
|
if not 'test' in sys.argv: # Avoid tests hanging
|
|
|
query_server = get_query_server_config(name='impala')
|
|
query_server = get_query_server_config(name='impala')
|
|
|
server = dbms.get(user, query_server)
|
|
server = dbms.get(user, query_server)
|
|
|
- server.execute_statement("SELECT 'Hello World!';")
|
|
|
|
|
|
|
+ query = hql_query("SELECT 'Hello World!';")
|
|
|
|
|
+ handle = server.execute_and_wait(query, timeout_sec=10.0)
|
|
|
|
|
+
|
|
|
|
|
+ if handle:
|
|
|
|
|
+ server.fetch(handle, rows=100)
|
|
|
|
|
+ server.close(handle)
|
|
|
except StructuredThriftTransportException, ex:
|
|
except StructuredThriftTransportException, ex:
|
|
|
if 'TSocket read 0 bytes' in str(ex): # this message appears when authentication fails
|
|
if 'TSocket read 0 bytes' in str(ex): # this message appears when authentication fails
|
|
|
msg = "Failed to authenticate to Impalad, check authentication configurations."
|
|
msg = "Failed to authenticate to Impalad, check authentication configurations."
|