niemipt commented on issue #2851:
URL: https://github.com/apache/drill/issues/2851#issuecomment-2434619914
I think that I have exactly the same problem. It seems that after you change
schema to http storage schema you cannot run any SQL.
> ➜ tmp cat bootstrap-storage-plugins.json
> {
> "storage": {
> "http": {
> "type": "http",
> "cacheResults": false,
> "enabled": true,
> "timeout": 5,
> "connections": {
> "sunrise": {
> "url": "https://api.sunrise-sunset.org/json",
> "requireTail": false,
> "method": "GET",
> "dataPath": "results",
> "headers": null,
> "params": [
> "lat",
> "lng",
> "date"
> ],
> "authType": "none",
> "userName": null,
> "password": null,
> "postBody": null
> }
> }
> }
> }
> }
> ➜ tmp docker run -it --rm --name drill -v
"${HOME}"/tmp/bootstrap-storage-plugins.json:/opt/drill/conf/bootstrap-storage-plugins.json
apache/drill
> WARNING: The requested image's platform (linux/amd64) does not match the
detected host platform (linux/arm64/v8) and no specific platform was requested
> Apache Drill 1.21.1
> "Drill must go on."
> apache drill> !schemas
> +--------------------+---------------+
> | TABLE_SCHEM | TABLE_CATALOG |
> +--------------------+---------------+
> | cp.default | DRILL |
> | dfs.default | DRILL |
> | dfs.root | DRILL |
> | dfs.tmp | DRILL |
> | http | DRILL |
> | information_schema | DRILL |
> | sys | DRILL |
> +--------------------+---------------+
> apache drill> SELECT version FROM sys.version;
> +---------+
> | version |
> +---------+
> | 1.21.1 |
> +---------+
> 1 row selected (2.638 seconds)
> apache drill> SELECT sunrise, sunset FROM http.sunrise WHERE `lat` =
36.7201600 AND `lng` = -4.4203400 AND `date` = 'today';
> +------------+------------+
> | sunrise | sunset |
> +------------+------------+
> | 6:32:42 AM | 5:30:55 PM |
> +------------+------------+
> 1 row selected (2.506 seconds)
> apache drill> use http;
> +------+----------------------------------+
> | ok | summary |
> +------+----------------------------------+
> | true | Default schema changed to [http] |
> +------+----------------------------------+
> 1 row selected (0.219 seconds)
> apache drill (http)> SELECT sunrise, sunset FROM sunrise WHERE `lat` =
36.7201600 AND `lng` = -4.4203400 AND `date` = 'today';
> Error: CONNECTION ERROR: API 'http' does not exist in HTTP storage plugin
'http'
>
>
> [Error Id: 574dff2e-53ac-47c8-a4dc-f4368f5d60ea ] (state=,code=0)
> apache drill (http)> SELECT sunrise, sunset FROM http.sunrise WHERE `lat`
= 36.7201600 AND `lng` = -4.4203400 AND `date` = 'today';
> Error: CONNECTION ERROR: API 'http' does not exist in HTTP storage plugin
'http'
>
>
> [Error Id: ff623dec-3ecc-4eed-9caa-bad804694ea9 ] (state=,code=0)
> apache drill (http)> SELECT version FROM sys.version;
> Error: CONNECTION ERROR: API 'sys' does not exist in HTTP storage plugin
'http'
>
>
> [Error Id: fd4309e5-8883-4219-b0b7-3beec7147b96 ] (state=,code=0)
> apache drill (http)> use sys;
> Error: CONNECTION ERROR: API 'sys' does not exist in HTTP storage plugin
'http'
>
>
> [Error Id: 08a3b91a-a216-4088-8fc2-e0bc0d79bfc1 ] (state=,code=0)
> apache drill (http)> !schemas
> +--------------------+---------------+
> | TABLE_SCHEM | TABLE_CATALOG |
> +--------------------+---------------+
> | cp.default | DRILL |
> | dfs.default | DRILL |
> | dfs.root | DRILL |
> | dfs.tmp | DRILL |
> | http | DRILL |
> | information_schema | DRILL |
> | sys | DRILL |
> +--------------------+---------------+
> apache drill (http)> !reconnect
> Reconnecting to "jdbc:drill:zk=local"...
> apache drill> SELECT version FROM sys.version;
> +---------+
> | version |
> +---------+
> | 1.21.1 |
> +---------+
> 1 row selected (0.24 seconds)
> apache drill> !quit
> ➜ tmp
Only exception is that if you name HTTP storage and connection with same
name (eg. schema sunrise and connection sunrise) you can query data using both
schema.connection and connection but you still can't query any other schema
using anotherschema.connection.
> ➜ tmp cat bootstrap-storage-plugins.json
> {
> "storage": {
> "sunrise": {
> "type": "http",
> "cacheResults": false,
> "enabled": true,
> "timeout": 5,
> "connections": {
> "sunrise": {
> "url": "https://api.sunrise-sunset.org/json",
> "requireTail": false,
> "method": "GET",
> "dataPath": "results",
> "headers": null,
> "params": [
> "lat",
> "lng",
> "date"
> ],
> "authType": "none",
> "userName": null,
> "password": null,
> "postBody": null
> }
> }
> }
> }
> }
> ➜ tmp docker run -it --rm --name drill -v
"${HOME}"/tmp/bootstrap-storage-plugins.json:/opt/drill/conf/bootstrap-storage-plugins.json
apache/drill
> WARNING: The requested image's platform (linux/amd64) does not match the
detected host platform (linux/arm64/v8) and no specific platform was requested
> Apache Drill 1.21.1
> "Say hello to my little Drill."
> apache drill> !schemas
> +--------------------+---------------+
> | TABLE_SCHEM | TABLE_CATALOG |
> +--------------------+---------------+
> | cp.default | DRILL |
> | dfs.default | DRILL |
> | dfs.root | DRILL |
> | dfs.tmp | DRILL |
> | information_schema | DRILL |
> | sunrise | DRILL |
> | sys | DRILL |
> +--------------------+---------------+
> apache drill> SELECT version FROM sys.version;
> +---------+
> | version |
> +---------+
> | 1.21.1 |
> +---------+
> 1 row selected (2.235 seconds)
> apache drill> SELECT sunrise, sunset FROM sunrise.sunrise WHERE `lat` =
36.7201600 AND `lng` = -4.4203400 AND `date` = 'today';
> +------------+------------+
> | sunrise | sunset |
> +------------+------------+
> | 6:32:42 AM | 5:30:55 PM |
> +------------+------------+
> 1 row selected (2.545 seconds)
> apache drill> use sunrise;
> +------+-------------------------------------+
> | ok | summary |
> +------+-------------------------------------+
> | true | Default schema changed to [sunrise] |
> +------+-------------------------------------+
> 1 row selected (0.188 seconds)
> apache drill (sunrise)> SELECT sunrise, sunset FROM sunrise.sunrise WHERE
`lat` = 36.7201600 AND `lng` = -4.4203400 AND `date` = 'today';
> +------------+------------+
> | sunrise | sunset |
> +------------+------------+
> | 6:32:42 AM | 5:30:55 PM |
> +------------+------------+
> 1 row selected (1.146 seconds)
> apache drill (sunrise)> SELECT sunrise, sunset FROM sunrise WHERE `lat` =
36.7201600 AND `lng` = -4.4203400 AND `date` = 'today';
> +------------+------------+
> | sunrise | sunset |
> +------------+------------+
> | 6:32:42 AM | 5:30:55 PM |
> +------------+------------+
> 1 row selected (1.143 seconds)
> apache drill (sunrise)> SELECT version FROM sys.version;
> Error: CONNECTION ERROR: API 'sys' does not exist in HTTP storage plugin
'sunrise'
>
>
> [Error Id: 8cb31758-252b-4949-a30e-100b469d2476 ] (state=,code=0)
> apache drill (sunrise)> use sys;
> Error: CONNECTION ERROR: API 'sys' does not exist in HTTP storage plugin
'sunrise'
>
>
> [Error Id: 3d1e62b3-f395-4509-9001-5a47376e6063 ] (state=,code=0)
> apache drill (sunrise)> !schemas
> +--------------------+---------------+
> | TABLE_SCHEM | TABLE_CATALOG |
> +--------------------+---------------+
> | cp.default | DRILL |
> | dfs.default | DRILL |
> | dfs.root | DRILL |
> | dfs.tmp | DRILL |
> | information_schema | DRILL |
> | sunrise | DRILL |
> | sys | DRILL |
> +--------------------+---------------+
> apache drill (sunrise)> !quit
> ➜ tmp
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]