JohnOmernik / sqlalchemy-drill

Apache Drill Dialect for SQL Alchemy
Other
53 stars 35 forks source link

Can't connect #70

Closed p-falco closed 3 years ago

p-falco commented 3 years ago

After upgrades to apache/drill image 1.2.0 container from docker hub and sqlalchemi-drill 1.1, I canot connect to a remote, stanadlone instance of drill anymore.

Prior to this, I used to add a database in superset as such

    name: drill
    uri:  drill+sadrill://drill:8047/dfs/root?use_ssl=False

and it would conenct 100% (so much I have these in production)

Now this fails with

in the GUI:

ERROR: (builtins.NoneType) None
(Background on this error at: http://sqlalche.me/e/13/dbapi)

on the superset log:

/usr/local/lib/python3.7/site-packages/flask_caching/__init__.py:192: UserWarning: Flask-Caching: CACHE_TYPE is set to null, caching is effectively disabled.
dataviz              |   "Flask-Caching: CACHE_TYPE is set to null, "
dataviz              | 2021-07-13 14:47:13,394:DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): drill:8047
dataviz              | 2021-07-13 14:47:15,113:DEBUG:urllib3.connectionpool:http://drill:8047 "POST /query.json HTTP/1.1" 200 716
dataviz              | 2021-07-13 14:47:15,161:DEBUG:urllib3.connectionpool:http://drill:8047 "POST /query.json HTTP/1.1" 200 282
dataviz              | 2021-07-13 14:47:15,163:DEBUG:drilldbapi:sends an HTTP POST with payload
dataviz              | 2021-07-13 14:47:15,163:DEBUG:drilldbapi:{'queryType': 'SQL', 'query': 'SELECT 1 FROM (values(1))'}
dataviz              | 2021-07-13 14:47:15,422:DEBUG:urllib3.connectionpool:http://drill:8047 "POST /query.json HTTP/1.1" 200 209
dataviz              | 2021-07-13 14:47:15,425:DEBUG:drilldbapi:ijson parsed , start_map, None
dataviz              | 2021-07-13 14:47:15,426:DEBUG:drilldbapi:ijson parsed , map_key, queryId
dataviz              | 2021-07-13 14:47:15,426:DEBUG:drilldbapi:found and will now parse an occurrence of queryId
dataviz              | 2021-07-13 14:47:15,426:DEBUG:drilldbapi:ijson parsed , map_key, columns
dataviz              | 2021-07-13 14:47:15,426:DEBUG:drilldbapi:found and will now parse an occurrence of columns
dataviz              | 2021-07-13 14:47:15,426:DEBUG:drilldbapi:ijson parsed , map_key, rows
dataviz              | 2021-07-13 14:47:15,426:INFO:drilldbapi:received Drill query ID 1f12588b-c1e3-ac40-678b-7876ffe3c789.
dataviz              | 2021-07-13 14:47:15,426:DEBUG:drilldbapi:closed row data stream.
dataviz              | [SupersetError(message='(builtins.NoneType) None\n(Background on this error at: http://sqlalche.me/e/13/dbapi)', error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, extra={'engine_name': 'Apache Drill', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})]
dataviz              | 2021-07-13 14:47:15,437:WARNING:superset.views.base:[SupersetError(message='(builtins.NoneType) None\n(Background on this error at: http://sqlalche.me/e/13/dbapi)', error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, extra={'engine_name': 'Apache Drill', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})]

in drill this seems to have triggered a series of three queries, all of which seem to have returned OK

07/13/2021 14:47:15 | anonymous | SELECT 1 FROM (values(1)) | Succeeded | 0.245 sec | e344bffb6bf9
07/13/2021 14:47:15 | anonymous | USE dfs.root | Succeeded | 0.032 sec | e344bffb6bf9
07/13/2021 14:47:13 | anonymous | show schemas | Succeeded | 1.488 sec | e344bffb6bf9

Using apache drill 1.18.0

Anyone that can help? We're getting a bit desperate!

TIA, emp

cgivre commented 3 years ago

Please use Apache Drill 1.19. There are significant changes and improvements to the REST API in 1.19 and I think that will solve your issues.

p-falco commented 3 years ago

I confirm the error is not present anymore with 1.19.0 - I'm a bit worried about the unplanned upgrade, but will let you know.

In the meantime THANKS A LOT!

jnturton commented 3 years ago

Sorry about this, not a great experience. I'm pretty sure it's because of the change in datetime representation in the REST API which came with 1.19. I guess we need to either

jnturton commented 3 years ago

The situation is improved in #71