clintropolis opened a new pull request, #13711:
URL: https://github.com/apache/druid/pull/13711
### Description
This PR improves the response from `/druid/indexer/v1/sampler` to now
include `dimensions` and `segmentSchema` which are a list of dimension schemas
and a `RowSignature` for the set of rows sampled.
Building on top of #13653, when the sampler spec included with
```
...
"dimensionsSpec": {
"dimensions": [],
"useNestedColumnIndexerForSchemaDiscovery": true
...
},
...
```
it allows an application (such as the web-console data loader) to get typing
information about the sampled data in schemaless mode.
For example, given a kafka stream
<img width="1252" alt="Screenshot 2023-01-25 at 6 16 18 PM"
src="https://user-images.githubusercontent.com/1577461/214757543-7fd95264-8a28-4b04-898f-17d2e54ab124.png">
the new sampler response contains something like:
```json
{
"numRowsRead":4,
"numRowsIndexed":4,
"dimensions":[
{"type":"string","name":"time","multiValueHandling":"SORTED_ARRAY","createBitmapIndex":true},
{"type":"long","name":"some_long","multiValueHandling":"SORTED_ARRAY","createBitmapIndex":false},
{"type":"double","name":"some_double","multiValueHandling":"SORTED_ARRAY","createBitmapIndex":false},
{"type":"string","name":"some_string","multiValueHandling":"SORTED_ARRAY","createBitmapIndex":true},
{"type":"json","name":"some_variant","multiValueHandling":"SORTED_ARRAY","createBitmapIndex":true},
{"type":"json","name":"some_nested","multiValueHandling":"SORTED_ARRAY","createBitmapIndex":true}
],
"segmentSchema":[
{"name":"__time","type":"LONG"},
{"name":"time","type":"STRING"},
{"name":"some_long","type":"LONG"},
{"name":"some_double","type":"DOUBLE"},
{"name":"some_string","type":"STRING"},
{"name":"some_variant","type":"COMPLEX<json>"},
{"name":"some_nested","type":"COMPLEX<json>"}
],
"data":[...]
}
```
which evolves as we proceed through data loader steps:
<img width="1249" alt="Screenshot 2023-01-25 at 6 17 57 PM"
src="https://user-images.githubusercontent.com/1577461/214757605-5461cc29-ce7f-4ee3-9bbd-965e696b29d5.png">
```json
{
"numRowsRead":4,
"numRowsIndexed":4,
"dimensions":[
{"type":"long","name":"some_long","multiValueHandling":"SORTED_ARRAY","createBitmapIndex":false},
{"type":"double","name":"some_double","multiValueHandling":"SORTED_ARRAY","createBitmapIndex":false},
{"type":"string","name":"some_string","multiValueHandling":"SORTED_ARRAY","createBitmapIndex":true},
{"type":"json","name":"some_variant","multiValueHandling":"SORTED_ARRAY","createBitmapIndex":true},
{"type":"json","name":"some_nested","multiValueHandling":"SORTED_ARRAY","createBitmapIndex":true}
],
"segmentSchema":[
{"name":"__time","type":"LONG"},
{"name":"some_long","type":"LONG"},
{"name":"some_double","type":"DOUBLE"},
{"name":"some_string","type":"STRING"},
{"name":"some_variant","type":"COMPLEX<json>"},
{"name":"some_nested","type":"COMPLEX<json>"}
],
"data":[...]
}
```
After this PR we can update the web-console to take advantage of this new
information, which would help simplify some things.
#### Release note
`/druid/indexer/v1/sampler` has been improved to now include `dimensions`
and `segmentSchema` which are a list of dimension schemas and full segment
schema for the set of rows sampled.
<hr>
<!-- Check the items by putting "x" in the brackets for the done things. Not
all of these items apply to every PR. Remove the items which are not done or
not relevant to the PR. None of the items from the checklist below are strictly
necessary, but it would be very helpful if you at least self-review the PR. -->
This PR has:
- [ ] been self-reviewed.
- [ ] using the [concurrency
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md)
(Remove this item if the PR doesn't have any relation to concurrency.)
- [ ] added documentation for new or modified features or behaviors.
- [ ] a release note entry in the PR description.
- [ ] added Javadocs for most classes and all non-trivial methods. Linked
related entities via Javadoc links.
- [ ] added or updated version, license, or notice information in
[licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
- [ ] added comments explaining the "why" and the intent of the code
wherever would not be obvious for an unfamiliar reader.
- [ ] added unit tests or modified existing tests to cover new code paths,
ensuring the threshold for [code
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
is met.
- [ ] added integration tests.
- [ ] been tested in a test Druid cluster.
--
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]