You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/04/14 15:59:46 UTC
[GitHub] [druid] suneet-s opened a new issue #9699: EXPLAIN SQL query with
no limit generates invalid query
suneet-s opened a new issue #9699: EXPLAIN SQL query with no limit generates invalid query
URL: https://github.com/apache/druid/issues/9699
Please provide a detailed title (e.g. "Broker crashes when using TopN query with Bound filter" instead of just "Broker crashes").
### Affected Version
Tested in 0.18, haven't verified in older versions
### Description
If you use the web console's explain feature for a query with smart limits disabled it generates an invalid SQL query
```
SELECT * from wikipedia
```
generates
```
{
"queryType": "scan",
"dataSource": {
"type": "table",
"name": "wikipedia"
},
"intervals": {
"type": "intervals",
"intervals": [
"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"
]
},
"virtualColumns": [],
"resultFormat": "compactedList",
"batchSize": 20480,
"limit": 9223372036854776000,
"order": "none",
"filter": null,
"columns": [
"__time",
"channel",
"cityName",
"comment",
"count",
"countryIsoCode",
"countryName",
"diffUrl",
"flags",
"isAnonymous",
"isMinor",
"isNew",
"isRobot",
"isUnpatrolled",
"namespace",
"page",
"regionIsoCode",
"regionName",
"sum_added",
"sum_blah",
"sum_blah2",
"sum_blah3",
"sum_commentLength",
"sum_deleted",
"sum_delta",
"sum_deltaBucket",
"user"
],
"legacy": false,
"context": {
"sqlQueryId": "cc783735-4d86-4c29-aab3-77df8b93334f"
},
"descending": false,
"granularity": {
"type": "all"
}
}
```
which fails with
```
Numeric value (9223372036854776000) out of range of long (-9223372036854775808 - 9223372036854775807) at [Source: (org.eclipse.jetty.server.HttpInputOverHTTP); line: 1, column: 257] (through reference chain: org.apache.druid.query.scan.ScanQuery["limit"])
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] suneet-s commented on issue #9699: EXPLAIN SQL query with
no limit generates invalid query
Posted by GitBox <gi...@apache.org>.
suneet-s commented on issue #9699: EXPLAIN SQL query with no limit generates invalid query
URL: https://github.com/apache/druid/issues/9699#issuecomment-613544842
It's also worth noting that running a native query through the web console changes the limit somehow
```
{"queryType":"scan","dataSource":{"type":"table","name":"wikipedia"},"intervals":{"type":"intervals","intervals":["-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"]},"virtualColumns":[],"resultFormat":"compactedList","batchSize":20480,"limit":9223372036854775296,"order":"none","filter":null,"columns":["__time","channel","cityName","comment","count","countryIsoCode","countryName","diffUrl","flags","isAnonymous","isMinor","isNew","isRobot","isUnpatrolled","namespace","page","regionIsoCode","regionName","sum_added","sum_blah","sum_blah2","sum_blah3","sum_commentLength","sum_deleted","sum_delta","sum_deltaBucket","user"],"legacy":false,"descending":false,"granularity":{"type":"all"}}
```
In this query you can see that the limit is set to 9....5296
However, when I execute the query, I get an error saying
```
Numeric value (9223372036854776000) out of range of long (-9223372036854775808 - 9223372036854775807) at [Source: (org.eclipse.jetty.server.HttpInputOverHTTP); line: 1, column: 257] (through reference chain: org.apache.druid.query.scan.ScanQuery["limit"])
```
The limit works up to `9223372036854775295`
When I used inspect element to look at the request being made, the native query for that large limit is `9223372036854775000` So it looks like the web console is changing the limit under the covers somehow. This does not appear to be an issue for small limits - up to ~ 1 000 trillion (quadrillion?) in my tests. at 1 000 000 trillion (quintillion?) the limit starts to change
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] jihoonson commented on issue #9699: EXPLAIN SQL query with
no limit generates invalid query
Posted by GitBox <gi...@apache.org>.
jihoonson commented on issue #9699: EXPLAIN SQL query with no limit generates invalid query
URL: https://github.com/apache/druid/issues/9699#issuecomment-613536834
Seems like `EXPLAIN PLAN FOR` query returns a valid query plan.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org