blob: eb134cfc7766ba120f05c1206dde9fb342206000 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Apache Druid">
<meta name="keywords" content="druid,kafka,database,analytics,streaming,real-time,real time,apache,open source">
<meta name="author" content="Apache Software Foundation">
<title>Druid | Native Index Tasks</title>
<link rel="alternate" type="application/atom+xml" href="/feed">
<link rel="shortcut icon" href="/img/favicon.png">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
<link href='//fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700,300italic|Open+Sans:300italic,400italic,600italic,400,300,600,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="/css/bootstrap-pure.css?v=1.1">
<link rel="stylesheet" href="/css/base.css?v=1.1">
<link rel="stylesheet" href="/css/header.css?v=1.1">
<link rel="stylesheet" href="/css/footer.css?v=1.1">
<link rel="stylesheet" href="/css/syntax.css?v=1.1">
<link rel="stylesheet" href="/css/docs.css?v=1.1">
<script>
(function() {
var cx = '000162378814775985090:molvbm0vggm';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
</head>
<body>
<!-- Start page_header include -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<div class="top-navigator">
<div class="container">
<div class="left-cont">
<a class="logo" href="/"><span class="druid-logo"></span></a>
</div>
<div class="right-cont">
<ul class="links">
<li class=""><a href="/technology">Technology</a></li>
<li class=""><a href="/use-cases">Use Cases</a></li>
<li class=""><a href="/druid-powered">Powered By</a></li>
<li class=""><a href="/docs/latest/design/">Docs</a></li>
<li class=""><a href="/community/">Community</a></li>
<li class="header-dropdown">
<a>Apache</a>
<div class="header-dropdown-menu">
<a href="https://www.apache.org/" target="_blank">Foundation</a>
<a href="https://www.apache.org/events/current-event" target="_blank">Events</a>
<a href="https://www.apache.org/licenses/" target="_blank">License</a>
<a href="https://www.apache.org/foundation/thanks.html" target="_blank">Thanks</a>
<a href="https://www.apache.org/security/" target="_blank">Security</a>
<a href="https://www.apache.org/foundation/sponsorship.html" target="_blank">Sponsorship</a>
</div>
</li>
<li class=" button-link"><a href="/downloads.html">Download</a></li>
</ul>
</div>
</div>
<div class="action-button menu-icon">
<span class="fa fa-bars"></span> MENU
</div>
<div class="action-button menu-icon-close">
<span class="fa fa-times"></span> MENU
</div>
</div>
<script type="text/javascript">
var $menu = $('.right-cont');
var $menuIcon = $('.menu-icon');
var $menuIconClose = $('.menu-icon-close');
function showMenu() {
$menu.fadeIn(100);
$menuIcon.fadeOut(100);
$menuIconClose.fadeIn(100);
}
$menuIcon.click(showMenu);
function hideMenu() {
$menu.fadeOut(100);
$menuIconClose.fadeOut(100);
$menuIcon.fadeIn(100);
}
$menuIconClose.click(hideMenu);
$(window).resize(function() {
if ($(window).width() >= 840) {
$menu.fadeIn(100);
$menuIcon.fadeOut(100);
$menuIconClose.fadeOut(100);
}
else {
$menu.fadeOut(100);
$menuIcon.fadeIn(100);
$menuIconClose.fadeOut(100);
}
});
</script>
<!-- Stop page_header include -->
<div class="container doc-container">
<p> Looking for the <a href="/docs/0.17.1/">latest stable documentation</a>?</p>
<div class="row">
<div class="col-md-9 doc-content">
<p>
<a class="btn btn-default btn-xs visible-xs-inline-block visible-sm-inline-block" href="#toc">Table of Contents</a>
</p>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<h1 id="native-index-tasks">Native Index Tasks</h1>
<p>Apache Druid (incubating) currently has two types of native batch indexing tasks, <code>index_parallel</code> which runs tasks
in parallel on multiple MiddleManager processes, and <code>index</code> which will run a single indexing task locally on a single
MiddleManager.</p>
<p>Please check <a href="./hadoop-vs-native-batch.html">Hadoop-based Batch Ingestion VS Native Batch Ingestion</a> for differences between native batch ingestion and Hadoop-based ingestion.</p>
<p>To run either kind of native batch indexing task, write an ingestion spec as specified below. Then POST it to the
<a href="../operations/api-reference.html#tasks"><code>/druid/indexer/v1/task</code> endpoint on the Overlord</a>, or use the <code>post-index-task</code> script included with Druid.</p>
<h2 id="parallel-index-task">Parallel Index Task</h2>
<p>The Parallel Index Task is a task for parallel batch indexing. This task only uses Druid&#39;s resource and
doesn&#39;t depend on other external systems like Hadoop. This task currently works in a single phase without shuffling intermediate
data. <code>index_parallel</code> task is a supervisor task which basically generates multiple worker tasks and submits
them to Overlords. Each worker task reads input data and makes segments. Once they successfully generate segments for all
input, they report the generated segment list to the supervisor task. The supervisor task periodically checks the worker
task statuses. If one of them fails, it retries the failed task until the retrying number reaches the configured limit.
If all worker tasks succeed, then it collects the reported list of generated segments and publishes those segments at once.</p>
<p>To use this task, the <code>firehose</code> in <code>ioConfig</code> should be <em>splittable</em>. If it&#39;s not, this task runs sequentially. The
current splittable fireshoses are <a href="./firehose.html#localfirehose"><code>LocalFirehose</code></a>, <a href="./firehose.html#httpfirehose"><code>HttpFirehose</code></a>
, <a href="../development/extensions-core/s3.html#statics3firehose"><code>StaticS3Firehose</code></a>, <a href="../development/extensions-contrib/azure.html#staticazureblobstorefirehose"><code>StaticAzureBlobStoreFirehose</code></a>
, <a href="../development/extensions-contrib/google.html#staticgoogleblobstorefirehose"><code>StaticGoogleBlobStoreFirehose</code></a>, and <a href="../development/extensions-contrib/cloudfiles.html#staticcloudfilesfirehose"><code>StaticCloudFilesFirehose</code></a>.</p>
<p>The splittable firehose is responsible for generating <em>splits</em>. The supervisor task generates <em>worker task specs</em> each of
which specifies a split and submits worker tasks using those specs. As a result, the number of worker tasks depends on
the implementation of splittable firehoses. Please note that multiple tasks can be created for the same worker task spec
if one of them fails.</p>
<p>You may want to consider the below points:
- Since this task doesn&#39;t shuffle intermediate data, it isn&#39;t available for <a href="../ingestion/index.html#roll-up-modes">perfect rollup</a>.
- The number of tasks for parallel ingestion is decided by <code>maxNumSubTasks</code> in the tuningConfig.
Since the supervisor task creates up to <code>maxNumSubTasks</code> worker tasks regardless of the available task slots,
it may affect to other ingestion performance. As a result, it&#39;s important to set <code>maxNumSubTasks</code> properly.
See the below <a href="#capacity-planning">Capacity Planning</a> section for more details.
- By default, batch ingestion replaces all data in any segment that it writes to. If you&#39;d like to add to the segment
instead, set the appendToExisting flag in ioConfig. Note that it only replaces data in segments where it actively adds
data: if there are segments in your granularitySpec&#39;s intervals that have no data written by this task, they will be
left alone.</p>
<p>An example ingestion spec is:</p>
<div class="highlight"><pre><code class="language-json" data-lang="json"><span></span><span class="p">{</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;index_parallel&quot;</span><span class="p">,</span>
<span class="nt">&quot;spec&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;dataSchema&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;dataSource&quot;</span><span class="p">:</span> <span class="s2">&quot;wikipedia_parallel_index_test&quot;</span><span class="p">,</span>
<span class="nt">&quot;metricsSpec&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;count&quot;</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;count&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;doubleSum&quot;</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;added&quot;</span><span class="p">,</span>
<span class="nt">&quot;fieldName&quot;</span><span class="p">:</span> <span class="s2">&quot;added&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;doubleSum&quot;</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;deleted&quot;</span><span class="p">,</span>
<span class="nt">&quot;fieldName&quot;</span><span class="p">:</span> <span class="s2">&quot;deleted&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;doubleSum&quot;</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;delta&quot;</span><span class="p">,</span>
<span class="nt">&quot;fieldName&quot;</span><span class="p">:</span> <span class="s2">&quot;delta&quot;</span>
<span class="p">}</span>
<span class="p">],</span>
<span class="nt">&quot;granularitySpec&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;segmentGranularity&quot;</span><span class="p">:</span> <span class="s2">&quot;DAY&quot;</span><span class="p">,</span>
<span class="nt">&quot;queryGranularity&quot;</span><span class="p">:</span> <span class="s2">&quot;second&quot;</span><span class="p">,</span>
<span class="nt">&quot;intervals&quot;</span> <span class="p">:</span> <span class="p">[</span> <span class="s2">&quot;2013-08-31/2013-09-02&quot;</span> <span class="p">]</span>
<span class="p">},</span>
<span class="nt">&quot;parser&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;parseSpec&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;format&quot;</span> <span class="p">:</span> <span class="s2">&quot;json&quot;</span><span class="p">,</span>
<span class="nt">&quot;timestampSpec&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;column&quot;</span><span class="p">:</span> <span class="s2">&quot;timestamp&quot;</span>
<span class="p">},</span>
<span class="nt">&quot;dimensionsSpec&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;dimensions&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="s2">&quot;page&quot;</span><span class="p">,</span>
<span class="s2">&quot;language&quot;</span><span class="p">,</span>
<span class="s2">&quot;user&quot;</span><span class="p">,</span>
<span class="s2">&quot;unpatrolled&quot;</span><span class="p">,</span>
<span class="s2">&quot;newPage&quot;</span><span class="p">,</span>
<span class="s2">&quot;robot&quot;</span><span class="p">,</span>
<span class="s2">&quot;anonymous&quot;</span><span class="p">,</span>
<span class="s2">&quot;namespace&quot;</span><span class="p">,</span>
<span class="s2">&quot;continent&quot;</span><span class="p">,</span>
<span class="s2">&quot;country&quot;</span><span class="p">,</span>
<span class="s2">&quot;region&quot;</span><span class="p">,</span>
<span class="s2">&quot;city&quot;</span>
<span class="p">]</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="nt">&quot;ioConfig&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;index_parallel&quot;</span><span class="p">,</span>
<span class="nt">&quot;firehose&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;local&quot;</span><span class="p">,</span>
<span class="nt">&quot;baseDir&quot;</span><span class="p">:</span> <span class="s2">&quot;examples/indexing/&quot;</span><span class="p">,</span>
<span class="nt">&quot;filter&quot;</span><span class="p">:</span> <span class="s2">&quot;wikipedia_index_data*&quot;</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="nt">&quot;tuningconfig&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;index_parallel&quot;</span><span class="p">,</span>
<span class="nt">&quot;maxNumSubTasks&quot;</span><span class="p">:</span> <span class="mi">2</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<h4 id="task-properties">Task Properties</h4>
<table><thead>
<tr>
<th>property</th>
<th>description</th>
<th>required?</th>
</tr>
</thead><tbody>
<tr>
<td>type</td>
<td>The task type, this should always be <code>index_parallel</code>.</td>
<td>yes</td>
</tr>
<tr>
<td>id</td>
<td>The task ID. If this is not explicitly specified, Druid generates the task ID using task type, data source name, interval, and date-time stamp.</td>
<td>no</td>
</tr>
<tr>
<td>spec</td>
<td>The ingestion spec including the data schema, IOConfig, and TuningConfig. See below for more details.</td>
<td>yes</td>
</tr>
<tr>
<td>context</td>
<td>Context containing various task configuration parameters. See below for more details.</td>
<td>no</td>
</tr>
</tbody></table>
<h4 id="dataschema">DataSchema</h4>
<p>This field is required.</p>
<p>See <a href="../ingestion/ingestion-spec.html#dataschema">Ingestion Spec DataSchema</a></p>
<p>If you specify <code>intervals</code> explicitly in your dataSchema&#39;s granularitySpec, batch ingestion will lock the full intervals
specified when it starts up, and you will learn quickly if the specified interval overlaps with locks held by other
tasks (eg, Kafka ingestion). Otherwise, batch ingestion will lock each interval as it is discovered, so you may only
learn that the task overlaps with a higher-priority task later in ingestion. If you specify <code>intervals</code> explicitly, any
rows outside the specified intervals will be thrown away. We recommend setting <code>intervals</code> explicitly if you know the
time range of the data so that locking failure happens faster, and so that you don&#39;t accidentally replace data outside
that range if there&#39;s some stray data with unexpected timestamps.</p>
<h4 id="ioconfig">IOConfig</h4>
<table><thead>
<tr>
<th>property</th>
<th>description</th>
<th>default</th>
<th>required?</th>
</tr>
</thead><tbody>
<tr>
<td>type</td>
<td>The task type, this should always be <code>index_parallel</code>.</td>
<td>none</td>
<td>yes</td>
</tr>
<tr>
<td>firehose</td>
<td>Specify a <a href="../ingestion/firehose.html">Firehose</a> here.</td>
<td>none</td>
<td>yes</td>
</tr>
<tr>
<td>appendToExisting</td>
<td>Creates segments as additional shards of the latest version, effectively appending to the segment set instead of replacing it. This will only work if the existing segment set has extendable-type shardSpecs (which can be forced by setting &#39;forceExtendableShardSpecs&#39; in the tuning config).</td>
<td>false</td>
<td>no</td>
</tr>
</tbody></table>
<h4 id="tuningconfig">TuningConfig</h4>
<p>The tuningConfig is optional and default parameters will be used if no tuningConfig is specified. See below for more details.</p>
<table><thead>
<tr>
<th>property</th>
<th>description</th>
<th>default</th>
<th>required?</th>
</tr>
</thead><tbody>
<tr>
<td>type</td>
<td>The task type, this should always be <code>index_parallel</code>.</td>
<td>none</td>
<td>yes</td>
</tr>
<tr>
<td>maxRowsPerSegment</td>
<td>Used in sharding. Determines how many rows are in each segment.</td>
<td>5000000</td>
<td>no</td>
</tr>
<tr>
<td>maxRowsInMemory</td>
<td>Used in determining when intermediate persists to disk should occur. Normally user does not need to set this, but depending on the nature of data, if rows are short in terms of bytes, user may not want to store a million rows in memory and this value should be set.</td>
<td>1000000</td>
<td>no</td>
</tr>
<tr>
<td>maxBytesInMemory</td>
<td>Used in determining when intermediate persists to disk should occur. Normally this is computed internally and user does not need to set it. This value represents number of bytes to aggregate in heap memory before persisting. This is based on a rough estimate of memory usage and not actual usage. The maximum heap memory usage for indexing is maxBytesInMemory * (2 + maxPendingPersists)</td>
<td>1/6 of max JVM memory</td>
<td>no</td>
</tr>
<tr>
<td>maxTotalRows</td>
<td>Total number of rows in segments waiting for being pushed. Used in determining when intermediate pushing should occur.</td>
<td>20000000</td>
<td>no</td>
</tr>
<tr>
<td>numShards</td>
<td>Directly specify the number of shards to create. If this is specified and &#39;intervals&#39; is specified in the granularitySpec, the index task can skip the determine intervals/partitions pass through the data. numShards cannot be specified if maxRowsPerSegment is set.</td>
<td>null</td>
<td>no</td>
</tr>
<tr>
<td>indexSpec</td>
<td>defines segment storage format options to be used at indexing time, see <a href="#indexspec">IndexSpec</a></td>
<td>null</td>
<td>no</td>
</tr>
<tr>
<td>maxPendingPersists</td>
<td>Maximum number of persists that can be pending but not started. If this limit would be exceeded by a new intermediate persist, ingestion will block until the currently-running persist finishes. Maximum heap memory usage for indexing scales with maxRowsInMemory * (2 + maxPendingPersists).</td>
<td>0 (meaning one persist can be running concurrently with ingestion, and none can be queued up)</td>
<td>no</td>
</tr>
<tr>
<td>forceExtendableShardSpecs</td>
<td>Forces use of extendable shardSpecs. Experimental feature intended for use with the <a href="../development/extensions-core/kafka-ingestion.html">Kafka indexing service extension</a>.</td>
<td>false</td>
<td>no</td>
</tr>
<tr>
<td>reportParseExceptions</td>
<td>If true, exceptions encountered during parsing will be thrown and will halt ingestion; if false, unparseable rows and fields will be skipped.</td>
<td>false</td>
<td>no</td>
</tr>
<tr>
<td>pushTimeout</td>
<td>Milliseconds to wait for pushing segments. It must be &gt;= 0, where 0 means to wait forever.</td>
<td>0</td>
<td>no</td>
</tr>
<tr>
<td>segmentWriteOutMediumFactory</td>
<td>Segment write-out medium to use when creating segments. See <a href="#segmentWriteOutMediumFactory">SegmentWriteOutMediumFactory</a>.</td>
<td>Not specified, the value from <code>druid.peon.defaultSegmentWriteOutMediumFactory.type</code> is used</td>
<td>no</td>
</tr>
<tr>
<td>maxNumSubTasks</td>
<td>Maximum number of tasks which can be run at the same time. The supervisor task would spawn worker tasks up to <code>maxNumSubTasks</code> regardless of the available task slots. If this value is set to 1, the supervisor task processes data ingestion on its own instead of spawning worker tasks. If this value is set to too large, too many worker tasks can be created which might block other ingestion. Check <a href="#capacity-planning">Capacity Planning</a> for more details.</td>
<td>1</td>
<td>no</td>
</tr>
<tr>
<td>maxRetry</td>
<td>Maximum number of retries on task failures.</td>
<td>3</td>
<td>no</td>
</tr>
<tr>
<td>taskStatusCheckPeriodMs</td>
<td>Polling period in milleseconds to check running task statuses.</td>
<td>1000</td>
<td>no</td>
</tr>
<tr>
<td>chatHandlerTimeout</td>
<td>Timeout for reporting the pushed segments in worker tasks.</td>
<td>PT10S</td>
<td>no</td>
</tr>
<tr>
<td>chatHandlerNumRetries</td>
<td>Retries for reporting the pushed segments in worker tasks.</td>
<td>5</td>
<td>no</td>
</tr>
</tbody></table>
<h4 id="http-endpoints">HTTP Endpoints</h4>
<p>The supervisor task provides some HTTP endpoints to get running status.</p>
<ul>
<li><code>http://{PEON_IP}:{PEON_PORT}/druid/worker/v1/chat/{SUPERVISOR_TASK_ID}/mode</code></li>
</ul>
<p>Returns &#39;parallel&#39; if the indexing task is running in parallel. Otherwise, it returns &#39;sequential&#39;.</p>
<ul>
<li><code>http://{PEON_IP}:{PEON_PORT}/druid/worker/v1/chat/{SUPERVISOR_TASK_ID}/progress</code></li>
</ul>
<p>Returns the current progress if the supervisor task is running in the parallel mode.</p>
<p>An example of the result is</p>
<div class="highlight"><pre><code class="language-json" data-lang="json"><span></span><span class="p">{</span>
<span class="nt">&quot;running&quot;</span><span class="p">:</span><span class="mi">10</span><span class="p">,</span>
<span class="nt">&quot;succeeded&quot;</span><span class="p">:</span><span class="mi">0</span><span class="p">,</span>
<span class="nt">&quot;failed&quot;</span><span class="p">:</span><span class="mi">0</span><span class="p">,</span>
<span class="nt">&quot;complete&quot;</span><span class="p">:</span><span class="mi">0</span><span class="p">,</span>
<span class="nt">&quot;total&quot;</span><span class="p">:</span><span class="mi">10</span><span class="p">,</span>
<span class="nt">&quot;expectedSucceeded&quot;</span><span class="p">:</span><span class="mi">10</span>
<span class="p">}</span>
</code></pre></div>
<ul>
<li><code>http://{PEON_IP}:{PEON_PORT}/druid/worker/v1/chat/{SUPERVISOR_TASK_ID}/subtasks/running</code></li>
</ul>
<p>Returns the task IDs of running worker tasks, or an empty list if the supervisor task is running in the sequential mode.</p>
<ul>
<li><code>http://{PEON_IP}:{PEON_PORT}/druid/worker/v1/chat/{SUPERVISOR_TASK_ID}/subtaskspecs</code></li>
</ul>
<p>Returns all worker task specs, or an empty list if the supervisor task is running in the sequential mode.</p>
<ul>
<li><code>http://{PEON_IP}:{PEON_PORT}/druid/worker/v1/chat/{SUPERVISOR_TASK_ID}/subtaskspecs/running</code></li>
</ul>
<p>Returns running worker task specs, or an empty list if the supervisor task is running in the sequential mode.</p>
<ul>
<li><code>http://{PEON_IP}:{PEON_PORT}/druid/worker/v1/chat/{SUPERVISOR_TASK_ID}/subtaskspecs/complete</code></li>
</ul>
<p>Returns complete worker task specs, or an empty list if the supervisor task is running in the sequential mode.</p>
<ul>
<li><code>http://{PEON_IP}:{PEON_PORT}/druid/worker/v1/chat/{SUPERVISOR_TASK_ID}/subtaskspec/{SUB_TASK_SPEC_ID}</code></li>
</ul>
<p>Returns the worker task spec of the given id, or HTTP 404 Not Found error if the supervisor task is running in the sequential mode.</p>
<ul>
<li><code>http://{PEON_IP}:{PEON_PORT}/druid/worker/v1/chat/{SUPERVISOR_TASK_ID}/subtaskspec/{SUB_TASK_SPEC_ID}/state</code></li>
</ul>
<p>Returns the state of the worker task spec of the given id, or HTTP 404 Not Found error if the supervisor task is running in the sequential mode.
The returned result contains the worker task spec, a current task status if exists, and task attempt history.</p>
<p>An example of the result is</p>
<div class="highlight"><pre><code class="language-json" data-lang="json"><span></span><span class="p">{</span>
<span class="nt">&quot;spec&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;index_parallel_lineitem_2018-04-20T22:12:43.610Z_2&quot;</span><span class="p">,</span>
<span class="nt">&quot;groupId&quot;</span><span class="p">:</span> <span class="s2">&quot;index_parallel_lineitem_2018-04-20T22:12:43.610Z&quot;</span><span class="p">,</span>
<span class="nt">&quot;supervisorTaskId&quot;</span><span class="p">:</span> <span class="s2">&quot;index_parallel_lineitem_2018-04-20T22:12:43.610Z&quot;</span><span class="p">,</span>
<span class="nt">&quot;context&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;inputSplit&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;split&quot;</span><span class="p">:</span> <span class="s2">&quot;/path/to/data/lineitem.tbl.5&quot;</span>
<span class="p">},</span>
<span class="nt">&quot;ingestionSpec&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;dataSchema&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;dataSource&quot;</span><span class="p">:</span> <span class="s2">&quot;lineitem&quot;</span><span class="p">,</span>
<span class="nt">&quot;parser&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;hadoopyString&quot;</span><span class="p">,</span>
<span class="nt">&quot;parseSpec&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;format&quot;</span><span class="p">:</span> <span class="s2">&quot;tsv&quot;</span><span class="p">,</span>
<span class="nt">&quot;delimiter&quot;</span><span class="p">:</span> <span class="s2">&quot;|&quot;</span><span class="p">,</span>
<span class="nt">&quot;timestampSpec&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;column&quot;</span><span class="p">:</span> <span class="s2">&quot;l_shipdate&quot;</span><span class="p">,</span>
<span class="nt">&quot;format&quot;</span><span class="p">:</span> <span class="s2">&quot;yyyy-MM-dd&quot;</span>
<span class="p">},</span>
<span class="nt">&quot;dimensionsSpec&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;dimensions&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="s2">&quot;l_orderkey&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_partkey&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_suppkey&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_linenumber&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_returnflag&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_linestatus&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_shipdate&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_commitdate&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_receiptdate&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_shipinstruct&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_shipmode&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_comment&quot;</span>
<span class="p">]</span>
<span class="p">},</span>
<span class="nt">&quot;columns&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="s2">&quot;l_orderkey&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_partkey&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_suppkey&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_linenumber&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_quantity&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_extendedprice&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_discount&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_tax&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_returnflag&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_linestatus&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_shipdate&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_commitdate&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_receiptdate&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_shipinstruct&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_shipmode&quot;</span><span class="p">,</span>
<span class="s2">&quot;l_comment&quot;</span>
<span class="p">]</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="nt">&quot;metricsSpec&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;count&quot;</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;count&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;longSum&quot;</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;l_quantity&quot;</span><span class="p">,</span>
<span class="nt">&quot;fieldName&quot;</span><span class="p">:</span> <span class="s2">&quot;l_quantity&quot;</span><span class="p">,</span>
<span class="nt">&quot;expression&quot;</span><span class="p">:</span> <span class="kc">null</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;doubleSum&quot;</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;l_extendedprice&quot;</span><span class="p">,</span>
<span class="nt">&quot;fieldName&quot;</span><span class="p">:</span> <span class="s2">&quot;l_extendedprice&quot;</span><span class="p">,</span>
<span class="nt">&quot;expression&quot;</span><span class="p">:</span> <span class="kc">null</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;doubleSum&quot;</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;l_discount&quot;</span><span class="p">,</span>
<span class="nt">&quot;fieldName&quot;</span><span class="p">:</span> <span class="s2">&quot;l_discount&quot;</span><span class="p">,</span>
<span class="nt">&quot;expression&quot;</span><span class="p">:</span> <span class="kc">null</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;doubleSum&quot;</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;l_tax&quot;</span><span class="p">,</span>
<span class="nt">&quot;fieldName&quot;</span><span class="p">:</span> <span class="s2">&quot;l_tax&quot;</span><span class="p">,</span>
<span class="nt">&quot;expression&quot;</span><span class="p">:</span> <span class="kc">null</span>
<span class="p">}</span>
<span class="p">],</span>
<span class="nt">&quot;granularitySpec&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;uniform&quot;</span><span class="p">,</span>
<span class="nt">&quot;segmentGranularity&quot;</span><span class="p">:</span> <span class="s2">&quot;YEAR&quot;</span><span class="p">,</span>
<span class="nt">&quot;queryGranularity&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;none&quot;</span>
<span class="p">},</span>
<span class="nt">&quot;rollup&quot;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="nt">&quot;intervals&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="s2">&quot;1980-01-01T00:00:00.000Z/2020-01-01T00:00:00.000Z&quot;</span>
<span class="p">]</span>
<span class="p">},</span>
<span class="nt">&quot;transformSpec&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;filter&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;transforms&quot;</span><span class="p">:</span> <span class="p">[]</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="nt">&quot;ioConfig&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;index_parallel&quot;</span><span class="p">,</span>
<span class="nt">&quot;firehose&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;local&quot;</span><span class="p">,</span>
<span class="nt">&quot;baseDir&quot;</span><span class="p">:</span> <span class="s2">&quot;/path/to/data/&quot;</span><span class="p">,</span>
<span class="nt">&quot;filter&quot;</span><span class="p">:</span> <span class="s2">&quot;lineitem.tbl.5&quot;</span><span class="p">,</span>
<span class="nt">&quot;parser&quot;</span><span class="p">:</span> <span class="kc">null</span>
<span class="p">},</span>
<span class="nt">&quot;appendToExisting&quot;</span><span class="p">:</span> <span class="kc">false</span>
<span class="p">},</span>
<span class="nt">&quot;tuningConfig&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;index_parallel&quot;</span><span class="p">,</span>
<span class="nt">&quot;maxRowsPerSegment&quot;</span><span class="p">:</span> <span class="mi">5000000</span><span class="p">,</span>
<span class="nt">&quot;maxRowsInMemory&quot;</span><span class="p">:</span> <span class="mi">1000000</span><span class="p">,</span>
<span class="nt">&quot;maxTotalRows&quot;</span><span class="p">:</span> <span class="mi">20000000</span><span class="p">,</span>
<span class="nt">&quot;numShards&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;indexSpec&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;bitmap&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;concise&quot;</span>
<span class="p">},</span>
<span class="nt">&quot;dimensionCompression&quot;</span><span class="p">:</span> <span class="s2">&quot;lz4&quot;</span><span class="p">,</span>
<span class="nt">&quot;metricCompression&quot;</span><span class="p">:</span> <span class="s2">&quot;lz4&quot;</span><span class="p">,</span>
<span class="nt">&quot;longEncoding&quot;</span><span class="p">:</span> <span class="s2">&quot;longs&quot;</span>
<span class="p">},</span>
<span class="nt">&quot;maxPendingPersists&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">&quot;forceExtendableShardSpecs&quot;</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>
<span class="nt">&quot;reportParseExceptions&quot;</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>
<span class="nt">&quot;pushTimeout&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">&quot;segmentWriteOutMediumFactory&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;maxNumSubTasks&quot;</span><span class="p">:</span> <span class="mi">4</span><span class="p">,</span>
<span class="nt">&quot;maxRetry&quot;</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span>
<span class="nt">&quot;taskStatusCheckPeriodMs&quot;</span><span class="p">:</span> <span class="mi">1000</span><span class="p">,</span>
<span class="nt">&quot;chatHandlerTimeout&quot;</span><span class="p">:</span> <span class="s2">&quot;PT10S&quot;</span><span class="p">,</span>
<span class="nt">&quot;chatHandlerNumRetries&quot;</span><span class="p">:</span> <span class="mi">5</span><span class="p">,</span>
<span class="nt">&quot;logParseExceptions&quot;</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>
<span class="nt">&quot;maxParseExceptions&quot;</span><span class="p">:</span> <span class="mi">2147483647</span><span class="p">,</span>
<span class="nt">&quot;maxSavedParseExceptions&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">&quot;forceGuaranteedRollup&quot;</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>
<span class="nt">&quot;buildV9Directly&quot;</span><span class="p">:</span> <span class="kc">true</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="nt">&quot;currentStatus&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;index_sub_lineitem_2018-04-20T22:16:29.922Z&quot;</span><span class="p">,</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;index_sub&quot;</span><span class="p">,</span>
<span class="nt">&quot;createdTime&quot;</span><span class="p">:</span> <span class="s2">&quot;2018-04-20T22:16:29.925Z&quot;</span><span class="p">,</span>
<span class="nt">&quot;queueInsertionTime&quot;</span><span class="p">:</span> <span class="s2">&quot;2018-04-20T22:16:29.929Z&quot;</span><span class="p">,</span>
<span class="nt">&quot;statusCode&quot;</span><span class="p">:</span> <span class="s2">&quot;RUNNING&quot;</span><span class="p">,</span>
<span class="nt">&quot;duration&quot;</span><span class="p">:</span> <span class="mi">-1</span><span class="p">,</span>
<span class="nt">&quot;location&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;host&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;port&quot;</span><span class="p">:</span> <span class="mi">-1</span><span class="p">,</span>
<span class="nt">&quot;tlsPort&quot;</span><span class="p">:</span> <span class="mi">-1</span>
<span class="p">},</span>
<span class="nt">&quot;dataSource&quot;</span><span class="p">:</span> <span class="s2">&quot;lineitem&quot;</span><span class="p">,</span>
<span class="nt">&quot;errorMsg&quot;</span><span class="p">:</span> <span class="kc">null</span>
<span class="p">},</span>
<span class="nt">&quot;taskHistory&quot;</span><span class="p">:</span> <span class="p">[]</span>
<span class="p">}</span>
</code></pre></div>
<ul>
<li><code>http://{PEON_IP}:{PEON_PORT}/druid/worker/v1/chat/{SUPERVISOR_TASK_ID}/subtaskspec/{SUB_TASK_SPEC_ID}/history</code></li>
</ul>
<p>Returns the task attempt history of the worker task spec of the given id, or HTTP 404 Not Found error if the supervisor task is running in the sequential mode.</p>
<h3 id="capacity-planning">Capacity Planning</h3>
<p>The supervisor task can create up to <code>maxNumSubTasks</code> worker tasks no matter how many task slots are currently available.
As a result, total number of tasks which can be run at the same time is <code>(maxNumSubTasks + 1)</code> (including the supervisor task).
Please note that this can be even larger than total number of task slots (sum of the capacity of all workers).
If <code>maxNumSubTasks</code> is larger than <code>n (available task slots)</code>, then
<code>maxNumSubTasks</code> tasks are created by the supervisor task, but only <code>n</code> tasks would be started.
Others will wait in the pending state until any running task is finished.</p>
<p>If you are using the Parallel Index Task with stream ingestion together,
we would recommend to limit the max capacity for batch ingestion to prevent
stream ingestion from being blocked by batch ingestion. Suppose you have
<code>t</code> Parallel Index Tasks to run at the same time, but want to limit
the max number of tasks for batch ingestion to <code>b</code>. Then, (sum of <code>maxNumSubTasks</code>
of all Parallel Index Tasks + <code>t</code> (for supervisor tasks)) must be smaller than <code>b</code>.</p>
<p>If you have some tasks of a higher priority than others, you may set their
<code>maxNumSubTasks</code> to a higher value than lower priority tasks.
This may help the higher priority tasks to finish earlier than lower priority tasks
by assigning more task slots to them.</p>
<h2 id="local-index-task">Local Index Task</h2>
<p>The Local Index Task is designed to be used for smaller data sets. The task executes within the indexing service. The grammar of the index task is as follows:</p>
<div class="highlight"><pre><code class="language-json" data-lang="json"><span></span><span class="p">{</span>
<span class="nt">&quot;type&quot;</span> <span class="p">:</span> <span class="s2">&quot;index&quot;</span><span class="p">,</span>
<span class="nt">&quot;spec&quot;</span> <span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;dataSchema&quot;</span> <span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;dataSource&quot;</span> <span class="p">:</span> <span class="s2">&quot;wikipedia&quot;</span><span class="p">,</span>
<span class="nt">&quot;parser&quot;</span> <span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;type&quot;</span> <span class="p">:</span> <span class="s2">&quot;string&quot;</span><span class="p">,</span>
<span class="nt">&quot;parseSpec&quot;</span> <span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;format&quot;</span> <span class="p">:</span> <span class="s2">&quot;json&quot;</span><span class="p">,</span>
<span class="nt">&quot;timestampSpec&quot;</span> <span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;column&quot;</span> <span class="p">:</span> <span class="s2">&quot;timestamp&quot;</span><span class="p">,</span>
<span class="nt">&quot;format&quot;</span> <span class="p">:</span> <span class="s2">&quot;auto&quot;</span>
<span class="p">},</span>
<span class="nt">&quot;dimensionsSpec&quot;</span> <span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;dimensions&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;page&quot;</span><span class="p">,</span><span class="s2">&quot;language&quot;</span><span class="p">,</span><span class="s2">&quot;user&quot;</span><span class="p">,</span><span class="s2">&quot;unpatrolled&quot;</span><span class="p">,</span><span class="s2">&quot;newPage&quot;</span><span class="p">,</span><span class="s2">&quot;robot&quot;</span><span class="p">,</span><span class="s2">&quot;anonymous&quot;</span><span class="p">,</span><span class="s2">&quot;namespace&quot;</span><span class="p">,</span><span class="s2">&quot;continent&quot;</span><span class="p">,</span><span class="s2">&quot;country&quot;</span><span class="p">,</span><span class="s2">&quot;region&quot;</span><span class="p">,</span><span class="s2">&quot;city&quot;</span><span class="p">],</span>
<span class="nt">&quot;dimensionExclusions&quot;</span> <span class="p">:</span> <span class="p">[],</span>
<span class="nt">&quot;spatialDimensions&quot;</span> <span class="p">:</span> <span class="p">[]</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="nt">&quot;metricsSpec&quot;</span> <span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="nt">&quot;type&quot;</span> <span class="p">:</span> <span class="s2">&quot;count&quot;</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span> <span class="p">:</span> <span class="s2">&quot;count&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="nt">&quot;type&quot;</span> <span class="p">:</span> <span class="s2">&quot;doubleSum&quot;</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span> <span class="p">:</span> <span class="s2">&quot;added&quot;</span><span class="p">,</span>
<span class="nt">&quot;fieldName&quot;</span> <span class="p">:</span> <span class="s2">&quot;added&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="nt">&quot;type&quot;</span> <span class="p">:</span> <span class="s2">&quot;doubleSum&quot;</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span> <span class="p">:</span> <span class="s2">&quot;deleted&quot;</span><span class="p">,</span>
<span class="nt">&quot;fieldName&quot;</span> <span class="p">:</span> <span class="s2">&quot;deleted&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="nt">&quot;type&quot;</span> <span class="p">:</span> <span class="s2">&quot;doubleSum&quot;</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span> <span class="p">:</span> <span class="s2">&quot;delta&quot;</span><span class="p">,</span>
<span class="nt">&quot;fieldName&quot;</span> <span class="p">:</span> <span class="s2">&quot;delta&quot;</span>
<span class="p">}</span>
<span class="p">],</span>
<span class="nt">&quot;granularitySpec&quot;</span> <span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;type&quot;</span> <span class="p">:</span> <span class="s2">&quot;uniform&quot;</span><span class="p">,</span>
<span class="nt">&quot;segmentGranularity&quot;</span> <span class="p">:</span> <span class="s2">&quot;DAY&quot;</span><span class="p">,</span>
<span class="nt">&quot;queryGranularity&quot;</span> <span class="p">:</span> <span class="s2">&quot;NONE&quot;</span><span class="p">,</span>
<span class="nt">&quot;intervals&quot;</span> <span class="p">:</span> <span class="p">[</span> <span class="s2">&quot;2013-08-31/2013-09-01&quot;</span> <span class="p">]</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="nt">&quot;ioConfig&quot;</span> <span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;type&quot;</span> <span class="p">:</span> <span class="s2">&quot;index&quot;</span><span class="p">,</span>
<span class="nt">&quot;firehose&quot;</span> <span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;type&quot;</span> <span class="p">:</span> <span class="s2">&quot;local&quot;</span><span class="p">,</span>
<span class="nt">&quot;baseDir&quot;</span> <span class="p">:</span> <span class="s2">&quot;examples/indexing/&quot;</span><span class="p">,</span>
<span class="nt">&quot;filter&quot;</span> <span class="p">:</span> <span class="s2">&quot;wikipedia_data.json&quot;</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="nt">&quot;tuningConfig&quot;</span> <span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;type&quot;</span> <span class="p">:</span> <span class="s2">&quot;index&quot;</span><span class="p">,</span>
<span class="nt">&quot;maxRowsPerSegment&quot;</span> <span class="p">:</span> <span class="mi">5000000</span><span class="p">,</span>
<span class="nt">&quot;maxRowsInMemory&quot;</span> <span class="p">:</span> <span class="mi">1000000</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<p>By default, batch ingestion replaces all data in any segment that it writes to. If you&#39;d like to add to the segment
instead, set the appendToExisting flag in ioConfig. Note that it only replaces data in segments where it actively adds
data: if there are segments in your granularitySpec&#39;s intervals that have no data written by this task, they will be
left alone.</p>
<h4 id="task-properties">Task Properties</h4>
<table><thead>
<tr>
<th>property</th>
<th>description</th>
<th>required?</th>
</tr>
</thead><tbody>
<tr>
<td>type</td>
<td>The task type, this should always be &quot;index&quot;.</td>
<td>yes</td>
</tr>
<tr>
<td>id</td>
<td>The task ID. If this is not explicitly specified, Druid generates the task ID using task type, data source name, interval, and date-time stamp.</td>
<td>no</td>
</tr>
<tr>
<td>spec</td>
<td>The ingestion spec including the data schema, IOConfig, and TuningConfig. See below for more details.</td>
<td>yes</td>
</tr>
<tr>
<td>context</td>
<td>Context containing various task configuration parameters. See below for more details.</td>
<td>no</td>
</tr>
</tbody></table>
<h4 id="dataschema">DataSchema</h4>
<p>This field is required.</p>
<p>See <a href="../ingestion/ingestion-spec.html#dataschema">Ingestion Spec DataSchema</a></p>
<p>If you do not specify <code>intervals</code> explicitly in your dataSchema&#39;s granularitySpec, the Local Index Task will do an extra
pass over the data to determine the range to lock when it starts up. If you specify <code>intervals</code> explicitly, any rows
outside the specified intervals will be thrown away. We recommend setting <code>intervals</code> explicitly if you know the time
range of the data because it allows the task to skip the extra pass, and so that you don&#39;t accidentally replace data outside
that range if there&#39;s some stray data with unexpected timestamps.</p>
<h4 id="ioconfig">IOConfig</h4>
<table><thead>
<tr>
<th>property</th>
<th>description</th>
<th>default</th>
<th>required?</th>
</tr>
</thead><tbody>
<tr>
<td>type</td>
<td>The task type, this should always be &quot;index&quot;.</td>
<td>none</td>
<td>yes</td>
</tr>
<tr>
<td>firehose</td>
<td>Specify a <a href="../ingestion/firehose.html">Firehose</a> here.</td>
<td>none</td>
<td>yes</td>
</tr>
<tr>
<td>appendToExisting</td>
<td>Creates segments as additional shards of the latest version, effectively appending to the segment set instead of replacing it. This will only work if the existing segment set has extendable-type shardSpecs (which can be forced by setting &#39;forceExtendableShardSpecs&#39; in the tuning config).</td>
<td>false</td>
<td>no</td>
</tr>
</tbody></table>
<h4 id="tuningconfig">TuningConfig</h4>
<p>The tuningConfig is optional and default parameters will be used if no tuningConfig is specified. See below for more details.</p>
<table><thead>
<tr>
<th>property</th>
<th>description</th>
<th>default</th>
<th>required?</th>
</tr>
</thead><tbody>
<tr>
<td>type</td>
<td>The task type, this should always be &quot;index&quot;.</td>
<td>none</td>
<td>yes</td>
</tr>
<tr>
<td>maxRowsPerSegment</td>
<td>Used in sharding. Determines how many rows are in each segment.</td>
<td>5000000</td>
<td>no</td>
</tr>
<tr>
<td>maxRowsInMemory</td>
<td>Used in determining when intermediate persists to disk should occur. Normally user does not need to set this, but depending on the nature of data, if rows are short in terms of bytes, user may not want to store a million rows in memory and this value should be set.</td>
<td>1000000</td>
<td>no</td>
</tr>
<tr>
<td>maxBytesInMemory</td>
<td>Used in determining when intermediate persists to disk should occur. Normally this is computed internally and user does not need to set it. This value represents number of bytes to aggregate in heap memory before persisting. This is based on a rough estimate of memory usage and not actual usage. The maximum heap memory usage for indexing is maxBytesInMemory * (2 + maxPendingPersists)</td>
<td>1/6 of max JVM memory</td>
<td>no</td>
</tr>
<tr>
<td>maxTotalRows</td>
<td>Total number of rows in segments waiting for being pushed. Used in determining when intermediate pushing should occur.</td>
<td>20000000</td>
<td>no</td>
</tr>
<tr>
<td>numShards</td>
<td>Directly specify the number of shards to create. If this is specified and &#39;intervals&#39; is specified in the granularitySpec, the index task can skip the determine intervals/partitions pass through the data. numShards cannot be specified if maxRowsPerSegment is set.</td>
<td>null</td>
<td>no</td>
</tr>
<tr>
<td>partitionDimensions</td>
<td>The dimensions to partition on. Leave blank to select all dimensions. Only used with <code>forceGuaranteedRollup</code> = true, will be ignored otherwise.</td>
<td>null</td>
<td>no</td>
</tr>
<tr>
<td>indexSpec</td>
<td>defines segment storage format options to be used at indexing time, see <a href="#indexspec">IndexSpec</a></td>
<td>null</td>
<td>no</td>
</tr>
<tr>
<td>maxPendingPersists</td>
<td>Maximum number of persists that can be pending but not started. If this limit would be exceeded by a new intermediate persist, ingestion will block until the currently-running persist finishes. Maximum heap memory usage for indexing scales with maxRowsInMemory * (2 + maxPendingPersists).</td>
<td>0 (meaning one persist can be running concurrently with ingestion, and none can be queued up)</td>
<td>no</td>
</tr>
<tr>
<td>forceExtendableShardSpecs</td>
<td>Forces use of extendable shardSpecs. Experimental feature intended for use with the <a href="../development/extensions-core/kafka-ingestion.html">Kafka indexing service extension</a>.</td>
<td>false</td>
<td>no</td>
</tr>
<tr>
<td>forceGuaranteedRollup</td>
<td>Forces guaranteeing the <a href="../ingestion/index.html#roll-up-modes">perfect rollup</a>. The perfect rollup optimizes the total size of generated segments and querying time while indexing time will be increased. If this is set to true, the index task will read the entire input data twice: one for finding the optimal number of partitions per time chunk and one for generating segments. Note that the result segments would be hash-partitioned. You can set <code>forceExtendableShardSpecs</code> if you plan to append more data to the same time range in the future. This flag cannot be used with <code>appendToExisting</code> of IOConfig. For more details, see the below <strong>Segment pushing modes</strong> section.</td>
<td>false</td>
<td>no</td>
</tr>
<tr>
<td>reportParseExceptions</td>
<td>DEPRECATED. If true, exceptions encountered during parsing will be thrown and will halt ingestion; if false, unparseable rows and fields will be skipped. Setting <code>reportParseExceptions</code> to true will override existing configurations for <code>maxParseExceptions</code> and <code>maxSavedParseExceptions</code>, setting <code>maxParseExceptions</code> to 0 and limiting <code>maxSavedParseExceptions</code> to no more than 1.</td>
<td>false</td>
<td>no</td>
</tr>
<tr>
<td>pushTimeout</td>
<td>Milliseconds to wait for pushing segments. It must be &gt;= 0, where 0 means to wait forever.</td>
<td>0</td>
<td>no</td>
</tr>
<tr>
<td>segmentWriteOutMediumFactory</td>
<td>Segment write-out medium to use when creating segments. See <a href="#segmentWriteOutMediumFactory">SegmentWriteOutMediumFactory</a>.</td>
<td>Not specified, the value from <code>druid.peon.defaultSegmentWriteOutMediumFactory.type</code> is used</td>
<td>no</td>
</tr>
<tr>
<td>logParseExceptions</td>
<td>If true, log an error message when a parsing exception occurs, containing information about the row where the error occurred.</td>
<td>false</td>
<td>no</td>
</tr>
<tr>
<td>maxParseExceptions</td>
<td>The maximum number of parse exceptions that can occur before the task halts ingestion and fails. Overridden if <code>reportParseExceptions</code> is set.</td>
<td>unlimited</td>
<td>no</td>
</tr>
<tr>
<td>maxSavedParseExceptions</td>
<td>When a parse exception occurs, Druid can keep track of the most recent parse exceptions. &quot;maxSavedParseExceptions&quot; limits how many exception instances will be saved. These saved exceptions will be made available after the task finishes in the <a href="../ingestion/reports.html">task completion report</a>. Overridden if <code>reportParseExceptions</code> is set.</td>
<td>0</td>
<td>no</td>
</tr>
</tbody></table>
<h4 id="indexspec">IndexSpec</h4>
<p>The indexSpec defines segment storage format options to be used at indexing time, such as bitmap type and column
compression formats. The indexSpec is optional and default parameters will be used if not specified.</p>
<table><thead>
<tr>
<th>Field</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead><tbody>
<tr>
<td>bitmap</td>
<td>Object</td>
<td>Compression format for bitmap indexes. Should be a JSON object; see below for options.</td>
<td>no (defaults to Concise)</td>
</tr>
<tr>
<td>dimensionCompression</td>
<td>String</td>
<td>Compression format for dimension columns. Choose from <code>LZ4</code>, <code>LZF</code>, or <code>uncompressed</code>.</td>
<td>no (default == <code>LZ4</code>)</td>
</tr>
<tr>
<td>metricCompression</td>
<td>String</td>
<td>Compression format for metric columns. Choose from <code>LZ4</code>, <code>LZF</code>, <code>uncompressed</code>, or <code>none</code>.</td>
<td>no (default == <code>LZ4</code>)</td>
</tr>
<tr>
<td>longEncoding</td>
<td>String</td>
<td>Encoding format for metric and dimension columns with type long. Choose from <code>auto</code> or <code>longs</code>. <code>auto</code> encodes the values using offset or lookup table depending on column cardinality, and store them with variable size. <code>longs</code> stores the value as is with 8 bytes each.</td>
<td>no (default == <code>longs</code>)</td>
</tr>
</tbody></table>
<h5 id="bitmap-types">Bitmap types</h5>
<p>For Concise bitmaps:</p>
<table><thead>
<tr>
<th>Field</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead><tbody>
<tr>
<td>type</td>
<td>String</td>
<td>Must be <code>concise</code>.</td>
<td>yes</td>
</tr>
</tbody></table>
<p>For Roaring bitmaps:</p>
<table><thead>
<tr>
<th>Field</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead><tbody>
<tr>
<td>type</td>
<td>String</td>
<td>Must be <code>roaring</code>.</td>
<td>yes</td>
</tr>
<tr>
<td>compressRunOnSerialization</td>
<td>Boolean</td>
<td>Use a run-length encoding where it is estimated as more space efficient.</td>
<td>no (default == <code>true</code>)</td>
</tr>
</tbody></table>
<h4 id="segmentwriteoutmediumfactory">SegmentWriteOutMediumFactory</h4>
<table><thead>
<tr>
<th>Field</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead><tbody>
<tr>
<td>type</td>
<td>String</td>
<td>See <a href="../configuration/index.html#segmentwriteoutmediumfactory">Additional Peon Configuration: SegmentWriteOutMediumFactory</a> for explanation and available options.</td>
<td>yes</td>
</tr>
</tbody></table>
<h4 id="segment-pushing-modes">Segment pushing modes</h4>
<p>While ingesting data using the Index task, it creates segments from the input data and pushes them. For segment pushing,
the Index task supports two segment pushing modes, i.e., <em>bulk pushing mode</em> and <em>incremental pushing mode</em> for
<a href="../ingestion/index.html#roll-up-modes">perfect rollup and best-effort rollup</a>, respectively.</p>
<p>In the bulk pushing mode, every segment is pushed at the very end of the index task. Until then, created segments
are stored in the memory and local storage of the process running the index task. As a result, this mode might cause a
problem due to limited storage capacity, and is not recommended to use in production.</p>
<p>On the contrary, in the incremental pushing mode, segments are incrementally pushed, that is they can be pushed
in the middle of the index task. More precisely, the index task collects data and stores created segments in the memory
and disks of the process running that task until the total number of collected rows exceeds <code>maxTotalRows</code>. Once it exceeds,
the index task immediately pushes all segments created until that moment, cleans all pushed segments up, and
continues to ingest remaining data.</p>
<p>To enable bulk pushing mode, <code>forceGuaranteedRollup</code> should be set in the TuningConfig. Note that this option cannot
be used with either <code>forceExtendableShardSpecs</code> of TuningConfig or <code>appendToExisting</code> of IOConfig.</p>
</div>
<div class="col-md-3">
<div class="searchbox">
<gcse:searchbox-only></gcse:searchbox-only>
</div>
<div id="toc" class="nav toc hidden-print">
</div>
</div>
</div>
</div>
<!-- Start page_footer include -->
<footer class="druid-footer">
<div class="container">
<div class="text-center">
<p>
<a href="/technology">Technology</a>&ensp;·&ensp;
<a href="/use-cases">Use Cases</a>&ensp;·&ensp;
<a href="/druid-powered">Powered by Druid</a>&ensp;·&ensp;
<a href="/docs/latest">Docs</a>&ensp;·&ensp;
<a href="/community/">Community</a>&ensp;·&ensp;
<a href="/downloads.html">Download</a>&ensp;·&ensp;
<a href="/faq">FAQ</a>
</p>
</div>
<div class="text-center">
<a title="Join the user group" href="https://groups.google.com/forum/#!forum/druid-user" target="_blank"><span class="fa fa-comments"></span></a>&ensp;·&ensp;
<a title="Follow Druid" href="https://twitter.com/druidio" target="_blank"><span class="fab fa-twitter"></span></a>&ensp;·&ensp;
<a title="GitHub" href="https://github.com/apache/druid" target="_blank"><span class="fab fa-github"></span></a>
</div>
<div class="text-center license">
Copyright © 2020 <a href="https://www.apache.org/" target="_blank">Apache Software Foundation</a>.<br>
Except where otherwise noted, licensed under <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>.<br>
Apache Druid, Druid, and the Druid logo are either registered trademarks or trademarks of The Apache Software Foundation in the United States and other countries.
</div>
</div>
</footer>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-131010415-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-131010415-1');
</script>
<script>
function trackDownload(type, url) {
ga('send', 'event', 'download', type, url);
}
</script>
<script src="//code.jquery.com/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="/assets/js/druid.js"></script>
<!-- stop page_footer include -->
<script>
$(function() {
$(".toc").load("/docs/0.14.1-incubating/toc.html");
// There is no way to tell when .gsc-input will be async loaded into the page so just try to set a placeholder until it works
var tries = 0;
var timer = setInterval(function() {
tries++;
if (tries > 300) clearInterval(timer);
var searchInput = $('input.gsc-input');
if (searchInput.length) {
searchInput.attr('placeholder', 'Search');
clearInterval(timer);
}
}, 100);
});
</script>
</body>
</html>