| <!doctype html> |
| <html lang="en" dir="ltr" class="docs-wrapper docs-doc-page docs-version-current plugin-docs plugin-id-default docs-doc-id-data-management/delete" data-has-hydrated="false"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta name="generator" content="Docusaurus v2.4.3"> |
| <title data-rh="true">Data deletion | Apache® Druid</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:image" content="https://druid.apache.org/img/druid_nav.png"><meta data-rh="true" name="twitter:image" content="https://druid.apache.org/img/druid_nav.png"><meta data-rh="true" property="og:url" content="https://druid.apache.org/docs/31.0.0/data-management/delete"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Data deletion | Apache® Druid"><meta data-rh="true" name="description" content="<!--"><meta data-rh="true" property="og:description" content="<!--"><link data-rh="true" rel="icon" href="/img/favicon.png"><link data-rh="true" rel="canonical" href="https://druid.apache.org/docs/31.0.0/data-management/delete"><link data-rh="true" rel="alternate" href="https://druid.apache.org/docs/31.0.0/data-management/delete" hreflang="en"><link data-rh="true" rel="alternate" href="https://druid.apache.org/docs/31.0.0/data-management/delete" hreflang="x-default"><link rel="preconnect" href="https://www.google-analytics.com"> |
| <link rel="preconnect" href="https://www.googletagmanager.com"> |
| <script async src="https://www.googletagmanager.com/gtag/js?id=UA-131010415-1"></script> |
| <script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","UA-131010415-1",{})</script> |
| |
| |
| |
| |
| |
| <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css"> |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js"></script><link rel="stylesheet" href="/assets/css/styles.60a7f877.css"> |
| <link rel="preload" href="/assets/js/runtime~main.7d8e1a79.js" as="script"> |
| <link rel="preload" href="/assets/js/main.f9c13e33.js" as="script"> |
| </head> |
| <body class="navigation-with-keyboard"> |
| <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script><div id="__docusaurus"> |
| <div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top navbar--dark"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/img/druid_nav.png" alt="Apache® Druid" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/druid_nav.png" alt="Apache® Druid" class="themedImage_ToTc themedImage--dark_i4oU"></div></a></div><div class="navbar__items navbar__items--right"><a class="navbar__item navbar__link" href="/technology">Technology</a><a class="navbar__item navbar__link" href="/use-cases">Use Cases</a><a class="navbar__item navbar__link" href="/druid-powered">Powered By</a><a class="navbar__item navbar__link" href="/docs/31.0.0/design/">Docs</a><a class="navbar__item navbar__link" href="/community/">Community</a><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a href="#" aria-haspopup="true" aria-expanded="false" role="button" class="navbar__link">Apache®</a><ul class="dropdown__menu"><li><a href="https://www.apache.org/" target="_blank" rel="noopener noreferrer" class="dropdown__link">Foundation<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><a href="https://apachecon.com/?ref=druid.apache.org" target="_blank" rel="noopener noreferrer" class="dropdown__link">Events<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><a href="https://www.apache.org/licenses/" target="_blank" rel="noopener noreferrer" class="dropdown__link">License<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><a href="https://www.apache.org/foundation/thanks.html" target="_blank" rel="noopener noreferrer" class="dropdown__link">Thanks<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><a href="https://www.apache.org/security/" target="_blank" rel="noopener noreferrer" class="dropdown__link">Security<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><a href="https://www.apache.org/foundation/sponsorship.html" target="_blank" rel="noopener noreferrer" class="dropdown__link">Sponsorship<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div><a class="navbar__item navbar__link" href="/downloads/">Download</a><div class="searchBox_ZlJk"><div class="navbar__search"><span aria-label="expand searchbar" role="button" class="search-icon" tabindex="0"></span><input type="search" id="search_input_react" placeholder="Loading..." aria-label="Search" class="navbar__search-input search-bar" disabled=""></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/31.0.0/design/">Introduction to Apache Druid</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/31.0.0/tutorials/">Getting started</a><button aria-label="Toggle the collapsible sidebar category 'Getting started'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/docs/31.0.0/design/architecture">Design</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/31.0.0/ingestion/">Ingestion</a><button aria-label="Toggle the collapsible sidebar category 'Ingestion'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/31.0.0/data-management/">Data management</a><button aria-label="Toggle the collapsible sidebar category 'Data management'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/31.0.0/data-management/update">Data updates</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/31.0.0/data-management/delete">Data deletion</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/31.0.0/data-management/schema-changes">Schema changes</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/31.0.0/data-management/compaction">Compaction</a><button aria-label="Toggle the collapsible sidebar category 'Compaction'" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/docs/31.0.0/querying/sql">Querying</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/31.0.0/api-reference/">API reference</a><button aria-label="Toggle the collapsible sidebar category 'API reference'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/31.0.0/configuration/">Configuration</a><button aria-label="Toggle the collapsible sidebar category 'Configuration'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/docs/31.0.0/api-reference/automatic-compaction-api">Operations</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/31.0.0/development/overview">Development</a><button aria-label="Toggle the collapsible sidebar category 'Development'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/docs/31.0.0/release-info/release-notes">Release info</a></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/31.0.0/misc/papers-and-talks">Papers</a></li></ul></nav></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/31.0.0/data-management/"><span itemprop="name">Data management</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Data deletion</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>Data deletion</h1></header><h2 class="anchor anchorWithStickyNavbar_LWe7" id="by-time-range-manually">By time range, manually<a href="#by-time-range-manually" class="hash-link" aria-label="Direct link to By time range, manually" title="Direct link to By time range, manually"></a></h2><p>Apache Druid stores data <a href="/docs/31.0.0/design/storage">partitioned by time chunk</a> and supports |
| deleting data for time chunks by dropping segments. This is a fast, metadata-only operation.</p><p>Deletion by time range happens in two steps:</p><ol><li>Segments to be deleted must first be marked as <a href="/docs/31.0.0/design/storage#segment-lifecycle">"unused"</a>. This can |
| happen when a segment is dropped by a <a href="/docs/31.0.0/operations/rule-configuration">drop rule</a> or when you manually mark a |
| segment unused through the Coordinator API or web console. This is a soft delete: the data is not available for |
| querying, but the segment files remains in deep storage, and the segment records remains in the metadata store.</li><li>Once a segment is marked "unused", you can use a <a href="#kill-task"><code>kill</code> task</a> to permanently delete the segment file from |
| deep storage and remove its record from the metadata store. This is a hard delete: the data is unrecoverable unless |
| you have a backup.</li></ol><p>For documentation on disabling segments using the Coordinator API, see the |
| <a href="/docs/31.0.0/api-reference/legacy-metadata-api#datasources">Legacy metadata API reference</a>.</p><p>A data deletion tutorial is available at <a href="/docs/31.0.0/tutorials/tutorial-delete-data">Tutorial: Deleting data</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="by-time-range-automatically">By time range, automatically<a href="#by-time-range-automatically" class="hash-link" aria-label="Direct link to By time range, automatically" title="Direct link to By time range, automatically"></a></h2><p>Druid supports <a href="/docs/31.0.0/operations/rule-configuration">load and drop rules</a>, which are used to define intervals of time |
| where data should be preserved, and intervals where data should be discarded. Data that falls under a drop rule is |
| marked unused, in the same manner as if you <a href="#by-time-range-manually">manually mark that time range unused</a>. This is a |
| fast, metadata-only operation.</p><p>Data that is dropped in this way is marked unused, but remains in deep storage. To permanently delete it, use a |
| <a href="#kill-task"><code>kill</code> task</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="specific-records">Specific records<a href="#specific-records" class="hash-link" aria-label="Direct link to Specific records" title="Direct link to Specific records"></a></h2><p>Druid supports deleting specific records using <a href="/docs/31.0.0/data-management/update#reindex">reindexing</a> with a filter. The filter specifies which |
| data remains after reindexing, so it must be the inverse of the data you want to delete. Because segments must be |
| rewritten to delete data in this way, it can be a time-consuming operation.</p><p>For example, to delete records where <code>userName</code> is <code>'bob'</code> with native batch indexing, use a |
| <a href="/docs/31.0.0/ingestion/ingestion-spec#transformspec"><code>transformSpec</code></a> with filter <code>{"type": "not", "field": {"type": |
| "selector", "dimension": "userName", "value": "bob"}}</code>.</p><p>To delete the same records using SQL, use <a href="/docs/31.0.0/multi-stage-query/concepts#replace">REPLACE</a> with <code>WHERE userName <> 'bob'</code>.</p><p>To reindex using <a href="/docs/31.0.0/ingestion/native-batch">native batch</a>, use the <a href="/docs/31.0.0/ingestion/input-sources#druid-input-source"><code>druid</code> input |
| source</a>. If needed, |
| <a href="/docs/31.0.0/ingestion/ingestion-spec#transformspec"><code>transformSpec</code></a> can be used to filter or modify data during the |
| reindexing job. To reindex with SQL, use <a href="/docs/31.0.0/multi-stage-query/reference#replace"><code>REPLACE <table> OVERWRITE</code></a> |
| with <code>SELECT ... FROM <table></code>. (Druid does not have <code>UPDATE</code> or <code>ALTER TABLE</code> statements.) Any SQL SELECT query can be |
| used to filter, modify, or enrich the data during the reindexing job.</p><p>Data that is deleted in this way is marked unused, but remains in deep storage. To permanently delete it, use a <a href="#kill-task"><code>kill</code> |
| task</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="entire-table">Entire table<a href="#entire-table" class="hash-link" aria-label="Direct link to Entire table" title="Direct link to Entire table"></a></h2><p>Deleting an entire table works the same way as <a href="#by-time-range-manually">deleting part of a table by time range</a>. First, |
| mark all segments unused using the Coordinator API or web console. Then, optionally, delete it permanently using a |
| <a href="#kill-task"><code>kill</code> task</a>.</p><a name="kill-task"></a><h2 class="anchor anchorWithStickyNavbar_LWe7" id="permanently-kill-task">Permanently (<code>kill</code> task)<a href="#permanently-kill-task" class="hash-link" aria-label="Direct link to permanently-kill-task" title="Direct link to permanently-kill-task"></a></h2><p>Data that has been overwritten or soft-deleted still remains as segments that have been marked unused. You can use a |
| <code>kill</code> task to permanently delete this data.</p><p>The available grammar is:</p><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"kill"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"id"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> <task_id></span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"dataSource"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> <task_datasource></span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"interval"</span><span class="token plain"> </span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> <all_unused_segments_in_this_interval_will_die!></span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"versions"</span><span class="token plain"> </span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> <optional_list_of_segment_versions_to_delete_in_this_interval></span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"context"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> <task_context></span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"batchSize"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> <optional_batch_size></span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"limit"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> <optional_maximum_number_of_segments_to_delete></span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"maxUsedStatusLastUpdatedTime"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> <optional_maximum_timestamp_when_segments_were_marked_as_unused></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Some of the parameters used in the task payload are further explained below:</p><table><thead><tr><th>Parameter</th><th>Default</th><th>Explanation</th></tr></thead><tbody><tr><td><code>versions</code></td><td>null (all versions)</td><td>List of segment versions within the specified <code>interval</code> for the kill task to delete. The default behavior is to delete all unused segment versions in the specified <code>interval</code>.</td></tr><tr><td><code>batchSize</code></td><td>100</td><td>Maximum number of segments that are deleted in one kill batch. Some operations on the Overlord may get stuck while a <code>kill</code> task is in progress due to concurrency constraints (such as in <code>TaskLockbox</code>). Thus, a <code>kill</code> task splits the list of unused segments to be deleted into smaller batches to yield the Overlord resources intermittently to other task operations.</td></tr><tr><td><code>limit</code></td><td>null (no limit)</td><td>Maximum number of segments for the kill task to delete.</td></tr><tr><td><code>maxUsedStatusLastUpdatedTime</code></td><td>null (no cutoff)</td><td>Maximum timestamp used as a cutoff to include unused segments. The kill task only considers segments which lie in the specified <code>interval</code> and were marked as unused no later than this time. The default behavior is to kill all unused segments in the <code>interval</code> regardless of when they where marked as unused.</td></tr></tbody></table><p><strong>WARNING:</strong> The <code>kill</code> task permanently removes all information about the affected segments from the metadata store and |
| deep storage. This operation cannot be undone.</p></div></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/31.0.0/data-management/update"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Data updates</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/31.0.0/data-management/schema-changes"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Schema changes</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#by-time-range-manually" class="table-of-contents__link toc-highlight">By time range, manually</a></li><li><a href="#by-time-range-automatically" class="table-of-contents__link toc-highlight">By time range, automatically</a></li><li><a href="#specific-records" class="table-of-contents__link toc-highlight">Specific records</a></li><li><a href="#entire-table" class="table-of-contents__link toc-highlight">Entire table</a></li><li><a href="#permanently-kill-task" class="table-of-contents__link toc-highlight">Permanently (<code>kill</code> task)</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__bottom text--center"><div class="margin-bottom--sm"><img src="/img/favicon.png" class="themedImage_ToTc themedImage--light_HNdA footer__logo"><img src="/img/favicon.png" class="themedImage_ToTc themedImage--dark_i4oU footer__logo"></div><div class="footer__copyright">Copyright © 2023 Apache Software Foundation. Except where otherwise noted, licensed under CC BY-SA 4.0. 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></div></footer></div> |
| <script src="/assets/js/runtime~main.7d8e1a79.js"></script> |
| <script src="/assets/js/main.f9c13e33.js"></script> |
| </body> |
| </html> |