| <!doctype html> |
| <html lang="en" dir="ltr" class="docs-wrapper docs-doc-page docs-version-current plugin-docs plugin-id-default docs-doc-id-tutorials/tutorial-batch-native"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta name="generator" content="Docusaurus v2.4.1"> |
| <title data-rh="true">Load data with native batch ingestion | 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/27.0.0/tutorials/tutorial-batch-native"><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="Load data with native batch ingestion | 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/27.0.0/tutorials/tutorial-batch-native"><link data-rh="true" rel="alternate" href="https://druid.apache.org/docs/27.0.0/tutorials/tutorial-batch-native" hreflang="en"><link data-rh="true" rel="alternate" href="https://druid.apache.org/docs/27.0.0/tutorials/tutorial-batch-native" 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.f80751b3.css"> |
| <link rel="preload" href="/assets/js/runtime~main.5371e784.js" as="script"> |
| <link rel="preload" href="/assets/js/main.832012d1.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/27.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"><main class="docMainContainer_gTbr docMainContainerEnhanced_Uz_u"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><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>Load data with native batch ingestion</h1></header><p>This topic shows you how to load and query data files in Apache Druid using its native batch ingestion feature. </p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="prerequisites">Prerequisites<a href="#prerequisites" class="hash-link" aria-label="Direct link to Prerequisites" title="Direct link to Prerequisites"></a></h2><p>Install Druid, start up Druid services, and open the web console as described in the <a href="/docs/27.0.0/tutorials/">Druid quickstart</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="load-data">Load data<a href="#load-data" class="hash-link" aria-label="Direct link to Load data" title="Direct link to Load data"></a></h2><p>Ingestion specs define the schema of the data Druid reads and stores. You can write ingestion specs by hand or using the <em>data loader</em>, |
| as we'll do here to perform batch file loading with Druid's native batch ingestion.</p><p>The Druid distribution bundles sample data we can use. The sample data located in <code>quickstart/tutorial/wikiticker-2015-09-12-sampled.json.gz</code> |
| in the Druid root directory represents Wikipedia page edits for a given day. </p><ol><li><p>Click <strong>Load data</strong> from the web console header (<img loading="lazy" alt="Load data" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAXCAYAAABtR5P0AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAX6ADAAQAAAABAAAAFwAAAAAdsfvDAAAKwklEQVRoBe1ZeVDV5xU9vKdsArKIoqIoyiayKBFXEGQRUVyqNS5Zamw1M2bRtpa2qYlJOpMmttNM2nHaOm2nSzJtOk6NdYtL1IgLi8iiiOASREQQEJAdhN5z9ZkHPBanzfgP38zz9/t+337uuefeD61mLlzdgYHyVBAwPJVVBxZVBAbAf4pE6Bf47e3tePDgweNtdq0/bhh4eSIEBvXVm6C7urrAz8cXXl5jMchoREVVJfIu56O4+BasrKz019c8A+3dEegVfALv7T0ecfOiMXToUJDxHR0dGDnSA/6+vjhzLhUZ5zO7z9rHF87BQsN9k4WrNDc3Y9CgQUqavtZqa2sTD2+HjY11X13/L+09yg6BdnF2VuCdHB3R2tqq0sPv3KTBYEDE7FkI8PfT+pPsxt7OFtbW1mrIJxn3JH1pYGsBPSl+HnzGe6HNTDYtzUOiBfr7YkHs3H6RormlBS2Cyf9SegSfm580KUAZb2njbKcBgiZPhp2trXoFDdNb4Riy8KP33sSLzy4DD/BNFa5la2uD5Nc2YPozoUKetl6XapH2+dFzsOXldTAaDb0Sgx4bPWcGZoSF9tqv1wWlsUfZaZfNj3B3V1BNkxhF73mIjo52DB48WD1hpMcIPLdmFW6V3MaF7GyUlZXL5o2mId2eFJrhbq5wchjS48ZbWlphZbCCwcqgXsW1DFJnIRHIUhqxTfZCoPjOQsDJRsalVvFOemiTyA6flgq/85xGIRGJQO9uamp+3JV1ShfbOR/3wV3w27rVy3G38h5OncsQ8tmot3Bto8E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ERmCmXI7Ltg9/sQvqFXFRIXj1urCcS5kVihrQVFd8WI7Uj78pVZOZcwlVJB8NCAvUCNEXmO59zUQ4jKbIE57yCa6LtD+8fzNsLxVN5CYudOxuzw8NUJi9cvAwbkaQ9B4+K1JQjfEowYiJmISTQX9LWi3CUWHFKUtvr4jWMicHyPWp2uGRtmTL/Vcm8ohAlQdZ9mCuyZC5mckdPnlZciE/XYtXf/0yh1rHwQjXcfRj+8rdPBIzKPsHuuiDrTM8MFjbDoGu6JLlLRsVAV363EmQigWMGQuO5u7nQVVAuMqh/ppDvpssXAR0h++MYZkDM0DiOMmdeTPo9TNbhJYmpKvsxd+eFi/Pxu7ubm8zVIGl1jd7kuUd6Lu8B9uKFVIEaYXizEJC5P+8MdyXzoZTy3sDzmLAzX5/v3WSnawdTnZbjJGR2X+w2jenpyT92WSpcg6zk4ei+jFZcy5yxvPQRKBZmGpQXygp5RcMwMBYVl6gnciyBtMg6jpEfU0TTuWQilSR+5y2ZcxWLBLPOuShXprkodZQfpsO6R+lfK1kWDcG6dOzUXzfc5Z9+g89x3OSNG1+hTrKM+ob6xxvpMmefVdMBeurIdkupGfuzrdN4qZsXHStAmEqnvqaPZk8FyqxOA5hKX3Ox3Xx+9WaztaXRNJXF5xOBz42ektSTC9IQ5gtbnH3gY68I9B4dLQw1AW56Wugy8KmfCDwx+P2cd6BbPxD4L4v46/xHH4BCAAAAAElFTkSuQmCC" width="95" height="23" class="img_ev3q">).</p></li><li><p>Select the <strong>Local disk</strong> tile and then click <strong>Connect data</strong>.</p><p><img loading="lazy" alt="Data loader init" src="/assets/images/tutorial-batch-data-loader-01-6c69bcaeea1649df6343a9b9a9f25780.png" title="Data loader init" width="1250" height="740" class="img_ev3q"></p></li><li><p>Enter the following values: </p><ul><li><p><strong>Base directory</strong>: <code>quickstart/tutorial/</code></p></li><li><p><strong>File filter</strong>: <code>wikiticker-2015-09-12-sampled.json.gz</code> </p></li></ul><p><img loading="lazy" alt="Data location" src="/assets/images/tutorial-batch-data-loader-015-55d94d89e0b3a4edf0c1e23bc283b6f1.png" title="Data location" width="1250" height="740" class="img_ev3q"></p><p>Entering the base directory and <a href="https://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/filefilter/WildcardFileFilter.html" target="_blank" rel="noopener noreferrer">wildcard file filter</a> separately, as afforded by the UI, allows you to specify multiple files for ingestion at once.</p></li><li><p>Click <strong>Apply</strong>. </p><p>The data loader displays the raw data, giving you a chance to verify that the data |
| appears as expected. </p><p><img loading="lazy" alt="Data loader sample" src="/assets/images/tutorial-batch-data-loader-02-716ba72a06f10d39340e20fb710f2230.png" title="Data loader sample" width="1250" height="740" class="img_ev3q"></p><p>Notice that your position in the sequence of steps to load data, <strong>Connect</strong> in our case, appears at the top of the console, as shown below. |
| You can click other steps to move forward or backward in the sequence at any time.</p><p><img loading="lazy" alt="Load data" src="/assets/images/tutorial-batch-data-loader-12-220d0ea9d5e2b5549721db29e5ca7260.png" width="1175" height="78" class="img_ev3q"> </p></li></ol><ol start="5"><li><p>Click <strong>Next: Parse data</strong>. </p><p>The data loader tries to determine the parser appropriate for the data format automatically. In this case |
| it identifies the data format as <code>json</code>, as shown in the <strong>Input format</strong> field at the bottom right.</p><p><img loading="lazy" alt="Data loader parse data" src="/assets/images/tutorial-batch-data-loader-03-58febe17527a612312c8477ed7ebc2a5.png" title="Data loader parse data" width="1250" height="740" class="img_ev3q"></p><p>Feel free to select other <strong>Input format</strong> options to get a sense of their configuration settings |
| and how Druid parses other types of data. </p></li><li><p>With the JSON parser selected, click <strong>Next: Parse time</strong>. The <strong>Parse time</strong> settings are where you view and adjust the |
| primary timestamp column for the data.</p><p><img loading="lazy" alt="Data loader parse time" src="/assets/images/tutorial-batch-data-loader-04-fa86ea0f7b9e1790fb2d0db1a05093a8.png" title="Data loader parse time" width="1250" height="740" class="img_ev3q"></p><p>Druid requires data to have a primary timestamp column (internally stored in a column called <code>__time</code>). |
| If you do not have a timestamp in your data, select <code>Constant value</code>. In our example, the data loader |
| determines that the <code>time</code> column is the only candidate that can be used as the primary time column.</p></li><li><p>Click <strong>Next: Transform</strong>, <strong>Next: Filter</strong>, and then <strong>Next: Configure schema</strong>, skipping a few steps.</p><p>You do not need to adjust transformation or filtering settings, as applying ingestion time transforms and |
| filters are out of scope for this tutorial.</p></li><li><p>The Configure schema settings are where you configure what <a href="/docs/27.0.0/ingestion/schema-model#dimensions">dimensions</a> |
| and <a href="/docs/27.0.0/ingestion/schema-model#metrics">metrics</a> are ingested. The outcome of this configuration represents exactly how the |
| data will appear in Druid after ingestion. </p><p>Since our dataset is very small, you can turn off <a href="/docs/27.0.0/ingestion/rollup">rollup</a> |
| by unsetting the <strong>Rollup</strong> switch and confirming the change when prompted.</p><p><img loading="lazy" alt="Data loader schema" src="/assets/images/tutorial-batch-data-loader-05-d0c53acd1380865082797b0714f77f5a.png" title="Data loader schema" width="1250" height="740" class="img_ev3q"></p></li></ol><ol start="9"><li><p>Click <strong>Next: Partition</strong> to configure how the data will be split into segments. In this case, choose <code>DAY</code> as the <strong>Segment granularity</strong>. </p><p><img loading="lazy" alt="Data loader partition" src="/assets/images/tutorial-batch-data-loader-06-4eb248fe1e79b55b2e9419715d55b761.png" title="Data loader partition" width="1250" height="740" class="img_ev3q"></p><p>Since this is a small dataset, we can have just a single segment, which is what selecting <code>DAY</code> as the |
| segment granularity gives us. </p></li><li><p>Click <strong>Next: Tune</strong> and <strong>Next: Publish</strong>.</p></li><li><p>The Publish settings are where you specify the datasource name in Druid. Let's change the default name from <code>wikiticker-2015-09-12-sampled</code> to <code>wikipedia</code>. </p><p><img loading="lazy" alt="Data loader publish" src="/assets/images/tutorial-batch-data-loader-07-384d6ae7af33910e131a46564b7e6677.png" title="Data loader publish" width="1250" height="740" class="img_ev3q"></p></li><li><p>Click <strong>Next: Edit spec</strong> to review the ingestion spec we've constructed with the data loader. </p><p><img loading="lazy" alt="Data loader spec" src="/assets/images/tutorial-batch-data-loader-08-ed6704712050c56e866d3b5c53395fcf.png" title="Data loader spec" width="1250" height="740" class="img_ev3q"></p><p>Feel free to go back and change settings from previous steps to see how doing so updates the spec. |
| Similarly, you can edit the spec directly and see it reflected in the previous steps. </p><p>For other ways to load ingestion specs in Druid, see <a href="/docs/27.0.0/tutorials/tutorial-batch">Tutorial: Loading a file</a>. </p></li><li><p>Once you are satisfied with the spec, click <strong>Submit</strong>.</p></li></ol><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">The new task for our wikipedia datasource now appears in the Ingestion view. </span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">![Tasks view](../assets/tutorial-batch-data-loader-09.png "Tasks view")</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">The task may take a minute or two to complete. When done, the task status should be "SUCCESS", with</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">the duration of the task indicated. Note that the view is set to automatically </span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">refresh, so you do not need to refresh the browser to see the status change.</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">A successful task means that one or more segments have been built and are now picked up by our data servers.</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><h2 class="anchor anchorWithStickyNavbar_LWe7" id="query-the-data">Query the data<a href="#query-the-data" class="hash-link" aria-label="Direct link to Query the data" title="Direct link to Query the data"></a></h2><p>You can now see the data as a datasource in the console and try out a query, as follows: </p><ol><li><p>Click <strong>Datasources</strong> from the console header. </p><p>If the wikipedia datasource doesn't appear, wait a few moments for the segment to finish loading. A datasource is |
| queryable once it is shown to be "Fully available" in the <strong>Availability</strong> column. </p></li><li><p>When the datasource is available, open the Actions menu (<img loading="lazy" alt="Actions" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAVCAYAAACt4nWrAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAF6ADAAQAAAABAAAAFQAAAADcJ4LJAAACiklEQVQ4EbWVvYsTQRjGn9lvczlzkUONeChcLk1ERIygIGdhcXiIYmFnZWWhnYX/hI1WNtopllfcFQcKEhTUxkJPvYBFDk/F0+QSdLNf4zsTs9lsNh8iTpHdndn3977zPO9s2JFTCxz/aWh/xQ18cB5QCANTVLqwoeFjw7nnQt+bR+rQaei5PLytDWw/vgfutWSypCxjwbnvYUdxHpkzV6Bm9hC4iu0n98EdG1CUJK6cGw0PPJgzRWQWrkIxJ+B8rqC+dAvOlwqYanTBnKyLyTQ4bSeMtJ0onYNipSF20Cw/hLP5oRdMXjBNp4heD4bDqRqmmaT1HIFdAmpQd073QIQX2u4DmJy/3CknvA6Hy9e4BEM2LIexvwimm+BuS2quT88ge/4GmVwAvRiCxc1wzWmXwjTvWxVaNked4cI8eBjZizfhVN/A/7GJ9MlLsosazx4BAbWp2q13KFzArHwJxr4COOkqh6LBmj0Ga+44JXNIKh1+Ywv226dyc1HVB8JFoFU4ganFa2DUJRBw6gZGcHmQ/ID8MBDYTdRX78L5tC49aVfQ/k2Eh+CzETB1DSeQTXJoUznSK4D79SN+vl6Fs7HWBxb4PngIXrxOFafaFQswaV9buYPW+gsy1JKlSVMpieiipNEzKzWWUvSD6wS23z+X/SwKkINOJ0PXwHiCEM59H+bsUdK4H1xbuQ17rSw1loCoa3Fi5DlMK05uunQBSmoyIsUv1JZj4EjwqNsQzuk0+s3v1A06aWpIjevLpPG7SMWjaLH1UBZG+jXKD+TnQU3vQvPlEpzKK7I88nGKBY96ZD3/ROQ8p1PGSCOxk0FdMAraWQ8rlxOM3P9zfMf0rMNJvIaaJ67+4+Rvz6X7Gy+xq1sAAAAASUVORK5CYII=" width="23" height="21" class="img_ev3q">) for that |
| datasource and choose <strong>Query with SQL</strong>.</p><p><img loading="lazy" alt="Datasource view" src="/assets/images/tutorial-batch-data-loader-10-3020349a4bc011d974ff49effac64f6f.png" title="Datasource view" width="1250" height="740" class="img_ev3q"></p></li></ol><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p> Notice the other actions you can perform for a datasource, including configuring retention rules, compaction, and more.</p></div></div><ol start="3"><li><p>Run the prepopulated query, <code>SELECT * FROM "wikipedia"</code> to see the results.</p><p><img loading="lazy" alt="Query view" src="/assets/images/tutorial-batch-data-loader-11-e176f4b04d11f4cd667780fef55aceaf.png" title="Query view" width="1250" height="740" class="img_ev3q"></p></li></ol></div></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"></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="#prerequisites" class="table-of-contents__link toc-highlight">Prerequisites</a></li><li><a href="#load-data" class="table-of-contents__link toc-highlight">Load data</a></li><li><a href="#query-the-data" class="table-of-contents__link toc-highlight">Query the data</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.5371e784.js"></script> |
| <script src="/assets/js/main.832012d1.js"></script> |
| </body> |
| </html> |