blob: 3efcd3b8c9b4f5f56eeeb0e6898ecbf5d5e9093b [file] [log] [blame]
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[9789],{15680:(e,t,a)=>{a.d(t,{xA:()=>c,yg:()=>g});var r=a(96540);function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function i(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?o(Object(a),!0).forEach((function(t){n(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):o(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function u(e,t){if(null==e)return{};var a,r,n=function(e,t){if(null==e)return{};var a,r,n={},o=Object.keys(e);for(r=0;r<o.length;r++)a=o[r],t.indexOf(a)>=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)a=o[r],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var l=r.createContext({}),s=function(e){var t=r.useContext(l),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},c=function(e){var t=s(e.components);return r.createElement(l.Provider,{value:t},e.children)},y="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var a=e.components,n=e.mdxType,o=e.originalType,l=e.parentName,c=u(e,["components","mdxType","originalType","parentName"]),y=s(a),d=n,g=y["".concat(l,".").concat(d)]||y[d]||p[d]||o;return a?r.createElement(g,i(i({ref:t},c),{},{components:a})):r.createElement(g,i({ref:t},c))}));function g(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=a.length,i=new Array(o);i[0]=d;var u={};for(var l in t)hasOwnProperty.call(t,l)&&(u[l]=t[l]);u.originalType=e,u[y]="string"==typeof e?e:n,i[1]=u;for(var s=2;s<o;s++)i[s]=a[s];return r.createElement.apply(null,i)}return r.createElement.apply(null,a)}d.displayName="MDXCreateElement"},29195:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>c,contentTitle:()=>l,default:()=>g,frontMatter:()=>u,metadata:()=>s,toc:()=>y});var r=a(58168),n=a(98587),o=(a(96540),a(15680)),i=["components"],u={id:"datasourcemetadataquery",title:"DatasourceMetadata queries",sidebar_label:"DatasourceMetadata"},l=void 0,s={unversionedId:"querying/datasourcemetadataquery",id:"querying/datasourcemetadataquery",title:"DatasourceMetadata queries",description:"\x3c!--",source:"@site/docs/29.0.0/querying/datasourcemetadataquery.md",sourceDirName:"querying",slug:"/querying/datasourcemetadataquery",permalink:"/docs/29.0.0/querying/datasourcemetadataquery",draft:!1,tags:[],version:"current",frontMatter:{id:"datasourcemetadataquery",title:"DatasourceMetadata queries",sidebar_label:"DatasourceMetadata"},sidebar:"docs",previous:{title:"SegmentMetadata",permalink:"/docs/29.0.0/querying/segmentmetadataquery"},next:{title:"Filters",permalink:"/docs/29.0.0/querying/filters"}},c={},y=[],p={toc:y},d="wrapper";function g(e){var t=e.components,a=(0,n.A)(e,i);return(0,o.yg)(d,(0,r.A)({},p,a,{components:t,mdxType:"MDXLayout"}),(0,o.yg)("admonition",{type:"info"},(0,o.yg)("p",{parentName:"admonition"}," Apache Druid supports two query languages: ",(0,o.yg)("a",{parentName:"p",href:"/docs/29.0.0/querying/sql"},"Druid SQL")," and ",(0,o.yg)("a",{parentName:"p",href:"/docs/29.0.0/querying/"},"native queries"),".\nThis document describes a query\ntype that is only available in the native language.")),(0,o.yg)("p",null,"Data Source Metadata queries return metadata information for a dataSource. These queries return information about:"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},"The timestamp of the latest ingested event for the dataSource. This is the ingested event without any consideration of rollup.")),(0,o.yg)("p",null,"The grammar for these queries is:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-json"},'{\n "queryType" : "dataSourceMetadata",\n "dataSource": "sample_datasource"\n}\n')),(0,o.yg)("p",null,"There are 2 main parts to a Data Source Metadata query:"),(0,o.yg)("table",null,(0,o.yg)("thead",{parentName:"table"},(0,o.yg)("tr",{parentName:"thead"},(0,o.yg)("th",{parentName:"tr",align:null},"property"),(0,o.yg)("th",{parentName:"tr",align:null},"description"),(0,o.yg)("th",{parentName:"tr",align:null},"required?"))),(0,o.yg)("tbody",{parentName:"table"},(0,o.yg)("tr",{parentName:"tbody"},(0,o.yg)("td",{parentName:"tr",align:null},"queryType"),(0,o.yg)("td",{parentName:"tr",align:null},'This String should always be "dataSourceMetadata"; this is the first thing Apache Druid looks at to figure out how to interpret the query'),(0,o.yg)("td",{parentName:"tr",align:null},"yes")),(0,o.yg)("tr",{parentName:"tbody"},(0,o.yg)("td",{parentName:"tr",align:null},"dataSource"),(0,o.yg)("td",{parentName:"tr",align:null},"A String or Object defining the data source to query, very similar to a table in a relational database. See ",(0,o.yg)("a",{parentName:"td",href:"/docs/29.0.0/querying/datasource"},"DataSource")," for more information."),(0,o.yg)("td",{parentName:"tr",align:null},"yes")),(0,o.yg)("tr",{parentName:"tbody"},(0,o.yg)("td",{parentName:"tr",align:null},"context"),(0,o.yg)("td",{parentName:"tr",align:null},"See ",(0,o.yg)("a",{parentName:"td",href:"/docs/29.0.0/querying/query-context"},"Context")),(0,o.yg)("td",{parentName:"tr",align:null},"no")))),(0,o.yg)("p",null,"The format of the result is:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-json"},'[ {\n "timestamp" : "2013-05-09T18:24:00.000Z",\n "result" : {\n "maxIngestedEventTime" : "2013-05-09T18:24:09.007Z"\n }\n} ]\n')))}g.isMDXComponent=!0}}]);