| "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[4224],{3905:(e,t,a)=>{a.d(t,{Zo:()=>p,kt:()=>h});var n=a(67294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function o(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?l(Object(a),!0).forEach((function(t){r(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function i(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a,n,r={},l=Object.keys(e);for(n=0;n<l.length;n++)a=l[n],t.indexOf(a)>=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)a=l[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var s=n.createContext({}),u=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):o(o({},t),e)),a},p=function(e){var t=u(e.components);return n.createElement(s.Provider,{value:t},e.children)},d="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},c=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,l=e.originalType,s=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),d=u(a),c=r,h=d["".concat(s,".").concat(c)]||d[c]||m[c]||l;return a?n.createElement(h,o(o({ref:t},p),{},{components:a})):n.createElement(h,o({ref:t},p))}));function h(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=a.length,o=new Array(l);o[0]=c;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[d]="string"==typeof e?e:r,o[1]=i;for(var u=2;u<l;u++)o[u]=a[u];return n.createElement.apply(null,o)}return n.createElement.apply(null,a)}c.displayName="MDXCreateElement"},85162:(e,t,a)=>{a.d(t,{Z:()=>o});var n=a(67294),r=a(86010);const l={tabItem:"tabItem_Ymn6"};function o(e){var t=e.children,a=e.hidden,o=e.className;return n.createElement("div",{role:"tabpanel",className:(0,r.Z)(l.tabItem,o),hidden:a},t)}},74866:(e,t,a)=>{a.d(t,{Z:()=>y});var n=a(87462),r=a(67294),l=a(86010),o=a(12466),i=a(16550),s=a(91980),u=a(67392),p=a(50012);function d(e){return function(e){var t,a;return null!=(t=null==(a=r.Children.map(e,(function(e){if(!e||(0,r.isValidElement)(e)&&(t=e.props)&&"object"==typeof t&&"value"in t)return e;var t;throw new Error("Docusaurus error: Bad <Tabs> child <"+("string"==typeof e.type?e.type:e.type.name)+'>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.')})))?void 0:a.filter(Boolean))?t:[]}(e).map((function(e){var t=e.props;return{value:t.value,label:t.label,attributes:t.attributes,default:t.default}}))}function m(e){var t=e.values,a=e.children;return(0,r.useMemo)((function(){var e=null!=t?t:d(a);return function(e){var t=(0,u.l)(e,(function(e,t){return e.value===t.value}));if(t.length>0)throw new Error('Docusaurus error: Duplicate values "'+t.map((function(e){return e.value})).join(", ")+'" found in <Tabs>. Every value needs to be unique.')}(e),e}),[t,a])}function c(e){var t=e.value;return e.tabValues.some((function(e){return e.value===t}))}function h(e){var t=e.queryString,a=void 0!==t&&t,n=e.groupId,l=(0,i.k6)(),o=function(e){var t=e.queryString,a=void 0!==t&&t,n=e.groupId;if("string"==typeof a)return a;if(!1===a)return null;if(!0===a&&!n)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return null!=n?n:null}({queryString:a,groupId:n});return[(0,s._X)(o),(0,r.useCallback)((function(e){if(o){var t=new URLSearchParams(l.location.search);t.set(o,e),l.replace(Object.assign({},l.location,{search:t.toString()}))}}),[o,l])]}function k(e){var t,a,n,l,o=e.defaultValue,i=e.queryString,s=void 0!==i&&i,u=e.groupId,d=m(e),k=(0,r.useState)((function(){return function(e){var t,a=e.defaultValue,n=e.tabValues;if(0===n.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(a){if(!c({value:a,tabValues:n}))throw new Error('Docusaurus error: The <Tabs> has a defaultValue "'+a+'" but none of its children has the corresponding value. Available values are: '+n.map((function(e){return e.value})).join(", ")+". If you intend to show no default tab, use defaultValue={null} instead.");return a}var r=null!=(t=n.find((function(e){return e.default})))?t:n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:o,tabValues:d})})),b=k[0],g=k[1],f=h({queryString:s,groupId:u}),v=f[0],N=f[1],y=(t=function(e){return e?"docusaurus.tab."+e:null}({groupId:u}.groupId),a=(0,p.Nk)(t),n=a[0],l=a[1],[n,(0,r.useCallback)((function(e){t&&l.set(e)}),[t,l])]),T=y[0],w=y[1],R=function(){var e=null!=v?v:T;return c({value:e,tabValues:d})?e:null}();return(0,r.useLayoutEffect)((function(){R&&g(R)}),[R]),{selectedValue:b,selectValue:(0,r.useCallback)((function(e){if(!c({value:e,tabValues:d}))throw new Error("Can't select invalid tab value="+e);g(e),N(e),w(e)}),[N,w,d]),tabValues:d}}var b=a(72389);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function f(e){var t=e.className,a=e.block,i=e.selectedValue,s=e.selectValue,u=e.tabValues,p=[],d=(0,o.o5)().blockElementScrollPositionUntilNextRender,m=function(e){var t=e.currentTarget,a=p.indexOf(t),n=u[a].value;n!==i&&(d(t),s(n))},c=function(e){var t,a=null;switch(e.key){case"Enter":m(e);break;case"ArrowRight":var n,r=p.indexOf(e.currentTarget)+1;a=null!=(n=p[r])?n:p[0];break;case"ArrowLeft":var l,o=p.indexOf(e.currentTarget)-1;a=null!=(l=p[o])?l:p[p.length-1]}null==(t=a)||t.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":a},t)},u.map((function(e){var t=e.value,a=e.label,o=e.attributes;return r.createElement("li",(0,n.Z)({role:"tab",tabIndex:i===t?0:-1,"aria-selected":i===t,key:t,ref:function(e){return p.push(e)},onKeyDown:c,onClick:m},o,{className:(0,l.Z)("tabs__item",g.tabItem,null==o?void 0:o.className,{"tabs__item--active":i===t})}),null!=a?a:t)})))}function v(e){var t=e.lazy,a=e.children,n=e.selectedValue,l=(Array.isArray(a)?a:[a]).filter(Boolean);if(t){var o=l.find((function(e){return e.props.value===n}));return o?(0,r.cloneElement)(o,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},l.map((function(e,t){return(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==n})})))}function N(e){var t=k(e);return r.createElement("div",{className:(0,l.Z)("tabs-container",g.tabList)},r.createElement(f,(0,n.Z)({},e,t)),r.createElement(v,(0,n.Z)({},e,t)))}function y(e){var t=(0,b.Z)();return r.createElement(N,(0,n.Z)({key:String(t)},e))}},64518:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>m,contentTitle:()=>p,default:()=>b,frontMatter:()=>u,metadata:()=>d,toc:()=>c});var n=a(87462),r=a(63366),l=(a(67294),a(3905)),o=a(74866),i=a(85162),s=["components"],u={id:"catalog",title:"Catalog"},p=void 0,d={unversionedId:"development/extensions-core/catalog",id:"development/extensions-core/catalog",title:"Catalog",description:"\x3c!--",source:"@site/docs/latest/development/extensions-core/catalog.md",sourceDirName:"development/extensions-core",slug:"/development/extensions-core/catalog",permalink:"/docs/latest/development/extensions-core/catalog",draft:!1,tags:[],version:"current",frontMatter:{id:"catalog",title:"Catalog"}},m={},c=[{value:"Configuration",id:"configuration",level:2},{value:"Tables",id:"tables",level:2},{value:"API Objects",id:"api-objects",level:3},{value:"TableSpec",id:"tablespec",level:4},{value:"Table Properties",id:"table-properties",level:4},{value:"ColumnSpec",id:"columnspec",level:4},{value:"APIs",id:"apis",level:3},{value:"Create or update a table",id:"create-or-update-a-table",level:4},{value:"URL",id:"url",level:5},{value:"Request body",id:"request-body",level:5},{value:"Query parameters",id:"query-parameters",level:5},{value:"Responses",id:"responses",level:5},{value:"Sample request",id:"sample-request",level:5},{value:"Sample response",id:"sample-response",level:5},{value:"Retrieve a table",id:"retrieve-a-table",level:4},{value:"URL",id:"url-1",level:5},{value:"Responses",id:"responses-1",level:5},{value:"Sample request",id:"sample-request-1",level:5},{value:"Sample response",id:"sample-response-1",level:5},{value:"Delete a table",id:"delete-a-table",level:4},{value:"URL",id:"url-2",level:5},{value:"Responses",id:"responses-2",level:5},{value:"Sample request",id:"sample-request-2",level:5},{value:"Sample response",id:"sample-response-2",level:5},{value:"Retrieve list of schema names",id:"retrieve-list-of-schema-names",level:4},{value:"URL",id:"url-3",level:5},{value:"Responses",id:"responses-3",level:5},{value:"Sample request",id:"sample-request-3",level:5},{value:"Sample response",id:"sample-response-3",level:5},{value:"Retrieve list of table names in schema",id:"retrieve-list-of-table-names-in-schema",level:4},{value:"URL",id:"url-4",level:5},{value:"Responses",id:"responses-4",level:5},{value:"Sample request",id:"sample-request-4",level:5},{value:"Sample response",id:"sample-response-4",level:5}],h={toc:c},k="wrapper";function b(e){var t=e.components,a=(0,r.Z)(e,s);return(0,l.kt)(k,(0,n.Z)({},h,a,{components:t,mdxType:"MDXLayout"}),(0,l.kt)("p",null,"Consider this an ",(0,l.kt)("a",{parentName:"p",href:"/docs/latest/development/experimental"},"EXPERIMENTAL")," feature mostly because it has not been tested yet on a wide variety of long running Druid clusters."),(0,l.kt)("p",null,"This extension allows users to configure, update, retrieve, and manage metadata stored in Druid's catalog. At present, only metadata about tables is stored in the catalog. This extension only supports MSQ based ingestion."),(0,l.kt)("h2",{id:"configuration"},"Configuration"),(0,l.kt)("p",null,"To use this extension please make sure to ",(0,l.kt)("a",{parentName:"p",href:"/docs/latest/configuration/extensions#loading-extensions"},"include")," ",(0,l.kt)("inlineCode",{parentName:"p"},"druid-catalog")," in the extensions load list."),(0,l.kt)("h1",{id:"catalog-metadata"},"Catalog Metadata"),(0,l.kt)("h2",{id:"tables"},"Tables"),(0,l.kt)("p",null,"A user may define a table with a defined set of column names, and respective data types, along with other properties. When\ningesting data into a table defined in the catalog, the DML query is validated against the definition of the table\nas defined in the catalog. This allows the user to omit the table's properties that are found in its definition,\nallowing queries to be more concise, and simpler to write. This also allows the user to ensure that the type of data being\nwritten into a defined column of the table is consistent with that columns definition, minimizing errors where unexpected\ndata is written into a particular column of the table."),(0,l.kt)("h3",{id:"api-objects"},"API Objects"),(0,l.kt)("h4",{id:"tablespec"},"TableSpec"),(0,l.kt)("p",null,"A tableSpec defines a table"),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"Property"),(0,l.kt)("th",{parentName:"tr",align:null},"Type"),(0,l.kt)("th",{parentName:"tr",align:null},"Description"),(0,l.kt)("th",{parentName:"tr",align:null},"Required"),(0,l.kt)("th",{parentName:"tr",align:null},"Default"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},"type")),(0,l.kt)("td",{parentName:"tr",align:null},"String"),(0,l.kt)("td",{parentName:"tr",align:null},"the type of table. The only value supported at this time is ",(0,l.kt)("inlineCode",{parentName:"td"},"datasource")),(0,l.kt)("td",{parentName:"tr",align:null},"yes"),(0,l.kt)("td",{parentName:"tr",align:null},"null")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},"properties")),(0,l.kt)("td",{parentName:"tr",align:null},"Map<String, Object>"),(0,l.kt)("td",{parentName:"tr",align:null},"the table's defined properties. see ",(0,l.kt)("a",{parentName:"td",href:"#table-properties"},"table properties")),(0,l.kt)("td",{parentName:"tr",align:null},"no"),(0,l.kt)("td",{parentName:"tr",align:null},"null")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},"columns")),(0,l.kt)("td",{parentName:"tr",align:null},"List<",(0,l.kt)("a",{parentName:"td",href:"#columnspec"},"ColumnSpec"),">"),(0,l.kt)("td",{parentName:"tr",align:null},"the table's defined columns"),(0,l.kt)("td",{parentName:"tr",align:null},"no"),(0,l.kt)("td",{parentName:"tr",align:null},"null")))),(0,l.kt)("h4",{id:"table-properties"},"Table Properties"),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"PropertyKeyName"),(0,l.kt)("th",{parentName:"tr",align:null},"PropertyValueType"),(0,l.kt)("th",{parentName:"tr",align:null},"Description"),(0,l.kt)("th",{parentName:"tr",align:null},"Required"),(0,l.kt)("th",{parentName:"tr",align:null},"Default"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},"segmentGranularity")),(0,l.kt)("td",{parentName:"tr",align:null},"String"),(0,l.kt)("td",{parentName:"tr",align:null},"determines how time-based partitioning is done. See ",(0,l.kt)("a",{parentName:"td",href:"/docs/latest/multi-stage-query/concepts#partitioning-by-time"},"Partitioning by time"),". Can specify any of the values as permitted for ",(0,l.kt)("a",{parentName:"td",href:"/docs/latest/multi-stage-query/reference#partitioned-by"},"PARTITIONED BY"),". This property value may be overridden at query time, by specifying the PARTITIONED BY clause."),(0,l.kt)("td",{parentName:"tr",align:null},"no"),(0,l.kt)("td",{parentName:"tr",align:null},"null")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},"sealed")),(0,l.kt)("td",{parentName:"tr",align:null},"boolean"),(0,l.kt)("td",{parentName:"tr",align:null},"require all columns in the table schema to be fully declared before data is ingested. Setting this to true will cause failure when DML queries attempt to add undefined columns to the table."),(0,l.kt)("td",{parentName:"tr",align:null},"no"),(0,l.kt)("td",{parentName:"tr",align:null},"false")))),(0,l.kt)("h4",{id:"columnspec"},"ColumnSpec"),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"Property"),(0,l.kt)("th",{parentName:"tr",align:null},"Type"),(0,l.kt)("th",{parentName:"tr",align:null},"Description"),(0,l.kt)("th",{parentName:"tr",align:null},"Required"),(0,l.kt)("th",{parentName:"tr",align:null},"Default"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},"name")),(0,l.kt)("td",{parentName:"tr",align:null},"String"),(0,l.kt)("td",{parentName:"tr",align:null},"The name of the column"),(0,l.kt)("td",{parentName:"tr",align:null},"yes"),(0,l.kt)("td",{parentName:"tr",align:null},"null")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},"dataType")),(0,l.kt)("td",{parentName:"tr",align:null},"String"),(0,l.kt)("td",{parentName:"tr",align:null},"The type of the column. Can be any column data type that is available to Druid. Depends on what extensions are loaded."),(0,l.kt)("td",{parentName:"tr",align:null},"no"),(0,l.kt)("td",{parentName:"tr",align:null},"null")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},"properties")),(0,l.kt)("td",{parentName:"tr",align:null},"Map<String, Object>"),(0,l.kt)("td",{parentName:"tr",align:null},"the column's defined properties. Non properties defined at this time."),(0,l.kt)("td",{parentName:"tr",align:null},"no"),(0,l.kt)("td",{parentName:"tr",align:null},"null")))),(0,l.kt)("h3",{id:"apis"},"APIs"),(0,l.kt)("h4",{id:"create-or-update-a-table"},"Create or update a table"),(0,l.kt)("p",null,"Update or create a new table containing the given table specification."),(0,l.kt)("h5",{id:"url"},"URL"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"POST")," ",(0,l.kt)("inlineCode",{parentName:"p"},"/druid/coordinator/v1/catalog/schemas/{schema}/tables/{name}")),(0,l.kt)("h5",{id:"request-body"},"Request body"),(0,l.kt)("p",null,"The request object for this request is a ",(0,l.kt)("a",{parentName:"p",href:"#tablespec"},"TableSpec")),(0,l.kt)("h5",{id:"query-parameters"},"Query parameters"),(0,l.kt)("p",null,"The endpoint supports a set of optional query parameters to enforce optimistic locking, and to specify that a request\nis meant to update a table rather than create a new one. In the default case, with no query parameters set, this request\nwill return an error if a table of the same name already exists in the schema specified."),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"Parameter"),(0,l.kt)("th",{parentName:"tr",align:null},"Type"),(0,l.kt)("th",{parentName:"tr",align:null},"Description"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},"version")),(0,l.kt)("td",{parentName:"tr",align:null},"Long"),(0,l.kt)("td",{parentName:"tr",align:null},"the expected version of an existing table. The version must match. If not (or if the table does not exist), returns an error.")),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},"overwrite")),(0,l.kt)("td",{parentName:"tr",align:null},"boolean"),(0,l.kt)("td",{parentName:"tr",align:null},"if true, then overwrites any existing table. Otherwise, the operation fails if the table already exists.")))),(0,l.kt)("h5",{id:"responses"},"Responses"),(0,l.kt)(o.Z,{mdxType:"Tabs"},(0,l.kt)(i.Z,{value:"1",label:"200 SUCCESS",mdxType:"TabItem"},(0,l.kt)("p",null,(0,l.kt)("em",{parentName:"p"},"Successfully submitted table spec. Returns an object that includes the version of the table created or updated:")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'{\n "version": 12345687\n}\n'))),(0,l.kt)(i.Z,{value:"2",label:"400 BAD REQUEST",mdxType:"TabItem"},(0,l.kt)("p",null,(0,l.kt)("em",{parentName:"p"},"Error thrown due to bad request. Returns a JSON object detailing the error with the following format:")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'{\n "error": "A well-defined error code.",\n "errorMessage": "A message with additional details about the error."\n}\n'))),(0,l.kt)(i.Z,{value:"3",label:"500 INTERNAL SERVER ERROR",mdxType:"TabItem"},(0,l.kt)("p",null,(0,l.kt)("em",{parentName:"p"},"Error thrown due to unexpected conditions. Returns a JSON object detailing the error with the following format:")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'{\n "error": "A well-defined error code.",\n "errorMessage": "A message with additional details about the error."\n}\n')))),(0,l.kt)("h5",{id:"sample-request"},"Sample request"),(0,l.kt)("p",null,"The following example shows how to create a sealed table with several defined columns, and a defined segment granularity of ",(0,l.kt)("inlineCode",{parentName:"p"},'"P1D"')),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-shell"},'curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/catalog/schemas/druid/tables/test_table" \\\n-X \'POST\' \\\n--header \'Content-Type: application/json\' \\\n--data \'{\n "type": "datasource",\n "columns": [\n {\n "name": "__time",\n "dataType": "long"\n },\n {\n "name": "double_col",\n "dataType": "double"\n },\n {\n "name": "float_col",\n "dataType": "float"\n },\n {\n "name": "long_col",\n "dataType": "long"\n },\n {\n "name": "string_col",\n "dataType": "string"\n }\n ],\n "properties": {\n "segmentGranularity": "P1D",\n "sealed": true\n }\n}\'\n')),(0,l.kt)("h5",{id:"sample-response"},"Sample response"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'{\n "version": 1730965026295\n}\n')),(0,l.kt)("h4",{id:"retrieve-a-table"},"Retrieve a table"),(0,l.kt)("p",null,"Retrieve a table"),(0,l.kt)("h5",{id:"url-1"},"URL"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"GET")," `/druid/coordinator/v1/catalog/schemas/{schema}/tables/{name}"),(0,l.kt)("h5",{id:"responses-1"},"Responses"),(0,l.kt)(o.Z,{mdxType:"Tabs"},(0,l.kt)(i.Z,{value:"1",label:"200 SUCCESS",mdxType:"TabItem"},(0,l.kt)("p",null,(0,l.kt)("em",{parentName:"p"},"Successfully retrieved corresponding table's ",(0,l.kt)("a",{parentName:"em",href:"#tablespec"},"TableSpec")))),(0,l.kt)(i.Z,{value:"2",label:"400 BAD REQUEST",mdxType:"TabItem"},(0,l.kt)("p",null,(0,l.kt)("em",{parentName:"p"},"Error thrown due to bad request. Returns a JSON object detailing the error with the following format:")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'{\n "error": "A well-defined error code.",\n "errorMessage": "A message with additional details about the error."\n}\n'))),(0,l.kt)(i.Z,{value:"3",label:"500 INTERNAL SERVER ERROR",mdxType:"TabItem"},(0,l.kt)("p",null,(0,l.kt)("em",{parentName:"p"},"Error thrown due to unexpected conditions. Returns a JSON object detailing the error with the following format:")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'{\n "error": "A well-defined error code.",\n "errorMessage": "A message with additional details about the error."\n}\n')))),(0,l.kt)("h5",{id:"sample-request-1"},"Sample request"),(0,l.kt)("p",null,"The following example shows how to retrieve a table named 'test_table' in schema 'druid'"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-shell"},'curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/catalog/schemas/druid/tables/test_table"\n')),(0,l.kt)("h5",{id:"sample-response-1"},"Sample response"),(0,l.kt)("details",null,(0,l.kt)("summary",null,"View the response"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'{\n "id": {\n "schema": "druid",\n "name": "test_table"\n },\n "creationTime": 1730965026295,\n "updateTime": 1730965026295,\n "state": "ACTIVE",\n "spec": {\n "type": "datasource",\n "properties": {\n "segmentGranularity": "P1D",\n "sealed": true\n },\n "columns": [\n {\n "name": "__time",\n "dataType": "long"\n },\n {\n "name": "double_col",\n "dataType": "double"\n },\n {\n "name": "float_col",\n "dataType": "float"\n },\n {\n "name": "long_col",\n "dataType": "long"\n },\n {\n "name": "string_col",\n "dataType": "string"\n }\n ]\n }\n}\n'))),(0,l.kt)("h4",{id:"delete-a-table"},"Delete a table"),(0,l.kt)("p",null,"Delete a table"),(0,l.kt)("h5",{id:"url-2"},"URL"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"DELETE")," `/druid/coordinator/v1/catalog/schemas/{schema}/tables/{name}"),(0,l.kt)("h5",{id:"responses-2"},"Responses"),(0,l.kt)(o.Z,{mdxType:"Tabs"},(0,l.kt)(i.Z,{value:"1",label:"200 SUCCESS",mdxType:"TabItem"},(0,l.kt)("p",null,(0,l.kt)("em",{parentName:"p"},"No response body"))),(0,l.kt)(i.Z,{value:"2",label:"400 BAD REQUEST",mdxType:"TabItem"},(0,l.kt)("p",null,(0,l.kt)("em",{parentName:"p"},"Error thrown due to bad request. Returns a JSON object detailing the error with the following format:")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'{\n "error": "A well-defined error code.",\n "errorMessage": "A message with additional details about the error."\n}\n'))),(0,l.kt)(i.Z,{value:"3",label:"500 INTERNAL SERVER ERROR",mdxType:"TabItem"},(0,l.kt)("p",null,(0,l.kt)("em",{parentName:"p"},"Error thrown due to unexpected conditions. Returns a JSON object detailing the error with the following format:")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'{\n "error": "A well-defined error code.",\n "errorMessage": "A message with additional details about the error."\n}\n')))),(0,l.kt)("h5",{id:"sample-request-2"},"Sample request"),(0,l.kt)("p",null,"The following example shows how to delete the a table named ",(0,l.kt)("inlineCode",{parentName:"p"},"test_table")," in schema ",(0,l.kt)("inlineCode",{parentName:"p"},"druid")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-shell"},"curl -X 'DELETE' \"http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/catalog/schemas/druid/tables/test_table\"\n")),(0,l.kt)("h5",{id:"sample-response-2"},"Sample response"),(0,l.kt)("p",null,"No response body"),(0,l.kt)("h4",{id:"retrieve-list-of-schema-names"},"Retrieve list of schema names"),(0,l.kt)("p",null,"retrieve list of schema names"),(0,l.kt)("h5",{id:"url-3"},"URL"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"GET")," `/druid/coordinator/v1/catalog/schemas"),(0,l.kt)("h5",{id:"responses-3"},"Responses"),(0,l.kt)(o.Z,{mdxType:"Tabs"},(0,l.kt)(i.Z,{value:"1",label:"200 SUCCESS",mdxType:"TabItem"},(0,l.kt)("p",null,(0,l.kt)("em",{parentName:"p"},"Successfully retrieved list of schema names"))),(0,l.kt)(i.Z,{value:"2",label:"400 BAD REQUEST",mdxType:"TabItem"},(0,l.kt)("p",null,(0,l.kt)("em",{parentName:"p"},"Error thrown due to bad request. Returns a JSON object detailing the error with the following format:")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'{\n "error": "A well-defined error code.",\n "errorMessage": "A message with additional details about the error."\n}\n'))),(0,l.kt)(i.Z,{value:"3",label:"500 INTERNAL SERVER ERROR",mdxType:"TabItem"},(0,l.kt)("p",null,(0,l.kt)("em",{parentName:"p"},"Error thrown due to unexpected conditions. Returns a JSON object detailing the error with the following format:")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'{\n "error": "A well-defined error code.",\n "errorMessage": "A message with additional details about the error."\n}\n')))),(0,l.kt)("h5",{id:"sample-request-3"},"Sample request"),(0,l.kt)("p",null,"The following example shows how to retrieve the list of schema names."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-shell"},'curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/catalog/schemas"\n')),(0,l.kt)("h5",{id:"sample-response-3"},"Sample response"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'[\n "INFORMATION_SCHEMA",\n "druid",\n "ext",\n "lookups",\n "sys",\n "view"\n]\n')),(0,l.kt)("h4",{id:"retrieve-list-of-table-names-in-schema"},"Retrieve list of table names in schema"),(0,l.kt)("p",null,"Retrieve a list of table names in the schema."),(0,l.kt)("h5",{id:"url-4"},"URL"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"GET")," `/druid/coordinator/v1/catalog/schemas/{schema}/table"),(0,l.kt)("h5",{id:"responses-4"},"Responses"),(0,l.kt)(o.Z,{mdxType:"Tabs"},(0,l.kt)(i.Z,{value:"1",label:"200 SUCCESS",mdxType:"TabItem"},(0,l.kt)("p",null,(0,l.kt)("em",{parentName:"p"},"Successfully retrieved list of table names belonging to schema"))),(0,l.kt)(i.Z,{value:"2",label:"400 BAD REQUEST",mdxType:"TabItem"},(0,l.kt)("p",null,(0,l.kt)("em",{parentName:"p"},"Error thrown due to bad request. Returns a JSON object detailing the error with the following format:")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'{\n "error": "A well-defined error code.",\n "errorMessage": "A message with additional details about the error."\n}\n'))),(0,l.kt)(i.Z,{value:"3",label:"500 INTERNAL SERVER ERROR",mdxType:"TabItem"},(0,l.kt)("p",null,(0,l.kt)("em",{parentName:"p"},"Error thrown due to unexpected conditions. Returns a JSON object detailing the error with the following format:")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'{\n "error": "A well-defined error code.",\n "errorMessage": "A message with additional details about the error."\n}\n')))),(0,l.kt)("h5",{id:"sample-request-4"},"Sample request"),(0,l.kt)("p",null,"The following example shows how to retrieve all of the table names of tables belonging to the ",(0,l.kt)("inlineCode",{parentName:"p"},"druid")," schema."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-shell"},'curl "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/catalog/schemas/druid/tables"\n')),(0,l.kt)("h5",{id:"sample-response-4"},"Sample response"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-json"},'[\n "test_table"\n]\n')))}b.isMDXComponent=!0}}]); |