blob: 3425e118b42e897cfb8a7f0bb747ecaec2ac5a78 [file] [log] [blame]
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[2239],{15680:(e,t,n)=>{n.d(t,{xA:()=>d,yg:()=>g});var a=n(96540);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var c=a.createContext({}),m=function(e){var t=a.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},d=function(e){var t=m(e.components);return a.createElement(c.Provider,{value:t},e.children)},l="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},u=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,c=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),l=m(n),u=r,g=l["".concat(c,".").concat(u)]||l[u]||p[u]||o;return n?a.createElement(g,i(i({ref:t},d),{},{components:n})):a.createElement(g,i({ref:t},d))}));function g(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,i=new Array(o);i[0]=u;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s[l]="string"==typeof e?e:r,i[1]=s;for(var m=2;m<o;m++)i[m]=n[m];return a.createElement.apply(null,i)}return a.createElement.apply(null,n)}u.displayName="MDXCreateElement"},98038:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>c,default:()=>g,frontMatter:()=>s,metadata:()=>m,toc:()=>l});var a=n(58168),r=n(98587),o=(n(96540),n(15680)),i=["components"],s={id:"schema-changes",title:"Schema changes"},c=void 0,m={unversionedId:"data-management/schema-changes",id:"data-management/schema-changes",title:"Schema changes",description:"\x3c!--",source:"@site/docs/29.0.0/data-management/schema-changes.md",sourceDirName:"data-management",slug:"/data-management/schema-changes",permalink:"/docs/29.0.0/data-management/schema-changes",draft:!1,tags:[],version:"current",frontMatter:{id:"schema-changes",title:"Schema changes"},sidebar:"docs",previous:{title:"Data deletion",permalink:"/docs/29.0.0/data-management/delete"},next:{title:"Compaction",permalink:"/docs/29.0.0/data-management/compaction"}},d={},l=[{value:"For new data",id:"for-new-data",level:2},{value:"For existing data",id:"for-existing-data",level:2}],p={toc:l},u="wrapper";function g(e){var t=e.components,n=(0,r.A)(e,i);return(0,o.yg)(u,(0,a.A)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,o.yg)("h2",{id:"for-new-data"},"For new data"),(0,o.yg)("p",null,"Apache Druid allows you to provide a new schema for new data without the need to update the schema of any existing data.\nIt is sufficient to update your supervisor spec, if using ",(0,o.yg)("a",{parentName:"p",href:"/docs/29.0.0/ingestion/#streaming"},"streaming ingestion"),", or to\nprovide the new schema the next time you do a ",(0,o.yg)("a",{parentName:"p",href:"/docs/29.0.0/ingestion/#batch"},"batch ingestion"),". This is made possible by\nthe fact that each ",(0,o.yg)("a",{parentName:"p",href:"/docs/29.0.0/design/segments"},"segment"),", at the time it is created, stores a\ncopy of its own schema. Druid reconciles all of these individual segment schemas automatically at query time."),(0,o.yg)("h2",{id:"for-existing-data"},"For existing data"),(0,o.yg)("p",null,"Schema changes are sometimes necessary for existing data. For example, you may want to change the type of a column in\npreviously-ingested data, or drop a column entirely. Druid handles this using ",(0,o.yg)("a",{parentName:"p",href:"/docs/29.0.0/data-management/update"},"reindexing"),", the same method\nit uses to handle updates of existing data. Reindexing involves rewriting all affected segments and can be a\ntime-consuming operation."))}g.isMDXComponent=!0}}]);