gianm commented on issue #16222:
URL: https://github.com/apache/druid/issues/16222#issuecomment-2148024791
Hi @ColeAtCharter. The `/druid/v2/candidates` API does not currently take
into account segment pruning, although `/druid/v2/` and `/druid/v2/sql/` (the
actual query APIs) do. I tried to repro the issue on `/druid/v2/` and was not
able to. A single segment was queried, as expected.
Could you provide some more details that could be used to repro this issue?
Here's what I tried:
I loaded data with the following SQL and `rowsPerSegment: 1500` (to ensure
we get multiple segments):
```
REPLACE INTO "wikipedia" OVERWRITE ALL
WITH "ext" AS (
SELECT *
FROM TABLE(
EXTERN(
'{"type":"http","uris":["https://druid.apache.org/data/wikipedia.json.gz"]}',
'{"type":"json"}'
)
) EXTEND ("isRobot" VARCHAR, "channel" VARCHAR, "timestamp" VARCHAR,
"flags" VARCHAR, "isUnpatrolled" VARCHAR, "page" VARCHAR, "diffUrl" VARCHAR,
"added" BIGINT, "comment" VARCHAR, "commentLength" BIGINT, "isNew" VARCHAR,
"isMinor" VARCHAR, "delta" BIGINT, "isAnonymous" VARCHAR, "user" VARCHAR,
"deltaBucket" BIGINT, "deleted" BIGINT, "namespace" VARCHAR, "cityName"
VARCHAR, "countryName" VARCHAR, "regionIsoCode" VARCHAR, "metroCode" BIGINT,
"countryIsoCode" VARCHAR, "regionName" VARCHAR)
)
SELECT
TIME_PARSE("timestamp") AS "__time",
"isRobot",
"channel",
"flags",
"isUnpatrolled",
"page",
"diffUrl",
"added",
"comment",
"commentLength",
"isNew",
"isMinor",
"delta",
"isAnonymous",
"user",
"deltaBucket",
"deleted",
"namespace",
"cityName",
"countryName",
"regionIsoCode",
"metroCode",
"countryIsoCode",
"regionName"
FROM "ext"
PARTITIONED BY DAY
CLUSTERED BY "page", "user"
```
Then ran this query:
```
{
"queryType": "timeseries",
"dataSource": {
"type": "table",
"name": "wikipedia"
},
"intervals": {
"type": "intervals",
"intervals": [
"-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"
]
},
"filter": {
"type": "selector",
"dimension": "page",
"value": "Bailando 2015"
},
"granularity": {
"type": "all"
},
"aggregations": [
{
"type": "count",
"name": "a0"
}
],
"context": {
"bySegment": true
}
}
```
A single segment came back in the reply:
```
[
{
"timestamp": "2016-06-27T00:00:00.000Z",
"result": {
"results": [
{
"timestamp": "2016-06-27T00:00:34.959Z",
"result": {
"a0": 9
}
}
],
"segment":
"wikipedia_2016-06-27T00:00:00.000Z_2016-06-28T00:00:00.000Z_2024-06-04T17:02:47.206Z_1",
"interval": "2016-06-27T00:00:00.000Z/2016-06-28T00:00:00.000Z"
}
}
]
```
I also confirmed using the metric `query/segment/time` that only a single
segment was queried.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]