mirror of
https://github.com/apache/druid.git
synced 2025-02-26 21:37:29 +00:00
63 lines
2.0 KiB
Markdown
63 lines
2.0 KiB
Markdown
---
|
|
layout: doc_page
|
|
---
|
|
# DumpSegment tool
|
|
|
|
The DumpSegment tool can be used to dump the metadata or contents of a segment for debugging purposes. Note that the
|
|
dump is not necessarily a full-fidelity translation of the segment. In particular, not all metadata is included, indexes
|
|
are not included, and complex metric values may not be complete.
|
|
|
|
To run the tool, point it at a segment directory and provide a file for writing output:
|
|
|
|
```
|
|
java io.druid.cli.Main tools dump-segment \
|
|
--directory /home/druid/path/to/segment/ \
|
|
--out /home/druid/output.txt
|
|
```
|
|
|
|
### Output format
|
|
|
|
Data dumps generated by this tool are newline-separate JSON objects, with one object per line. For example, one line
|
|
might look like this when pretty-printed:
|
|
|
|
```
|
|
{
|
|
"__time": 1442018818771,
|
|
"added": 36,
|
|
"channel": "#en.wikipedia",
|
|
"cityName": null,
|
|
"comment": "added project",
|
|
"count": 1,
|
|
"countryIsoCode": null,
|
|
"countryName": null,
|
|
"deleted": 0,
|
|
"delta": 36,
|
|
"isAnonymous": "false",
|
|
"isMinor": "false",
|
|
"isNew": "false",
|
|
"isRobot": "false",
|
|
"isUnpatrolled": "false",
|
|
"iuser": "00001553",
|
|
"metroCode": null,
|
|
"namespace": "Talk",
|
|
"page": "Talk:Oswald Tilghman",
|
|
"regionIsoCode": null,
|
|
"regionName": null,
|
|
"user": "GELongstreet"
|
|
}
|
|
```
|
|
|
|
Metadata dumps generated by this tool are in the same format as returned by the
|
|
[SegmentMetadata query](../querying/segmentmetadataquery.html).
|
|
|
|
### Command line arguments
|
|
|
|
|argument|description|required?|
|
|
|--------|-----------|---------|
|
|
|--directory file|Directory containing segment data. This could be generated by unzipping an "index.zip" from deep storage.|yes|
|
|
|--output file|File where output will be written.|yes|
|
|
|--filter json|JSON-encoded [query filter](../querying/filters.html). Omit to include all rows.|no|
|
|
|--column columnName|Column to include. Specify multiple times for multiple columns, or omit to include all columns.|no|
|
|
|--time-iso8601|Dump __time column in ISO8601 format rather than long.|no|
|
|
|--metadata|Dump metadata instead of actual rows, will ignore --filter and --column selections.|no|
|