blob: 7aa78f70dd37fe64d5acce58827cc80dce6a5ecb [file] [log] [blame]
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[7824],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>f});var a=n(67294);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 c(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 s=a.createContext({}),m=function(e){var t=a.useContext(s),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(s.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,s=e.parentName,d=c(e,["components","mdxType","originalType","parentName"]),l=m(n),u=r,f=l["".concat(s,".").concat(u)]||l[u]||p[u]||o;return n?a.createElement(f,i(i({ref:t},d),{},{components:n})):a.createElement(f,i({ref:t},d))}));function f(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 c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c[l]="string"==typeof e?e:r,i[1]=c;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"},39711:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>s,default:()=>f,frontMatter:()=>c,metadata:()=>m,toc:()=>l});var a=n(87462),r=n(63366),o=(n(67294),n(3905)),i=["components"],c={id:"schema-changes",title:"Schema changes"},s=void 0,m={unversionedId:"data-management/schema-changes",id:"data-management/schema-changes",title:"Schema changes",description:"\x3c!--",source:"@site/docs/28.0.1/data-management/schema-changes.md",sourceDirName:"data-management",slug:"/data-management/schema-changes",permalink:"/docs/28.0.1/data-management/schema-changes",draft:!1,tags:[],version:"current",frontMatter:{id:"schema-changes",title:"Schema changes"},sidebar:"docs",previous:{title:"Data deletion",permalink:"/docs/28.0.1/data-management/delete"},next:{title:"Compaction",permalink:"/docs/28.0.1/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 f(e){var t=e.components,n=(0,r.Z)(e,i);return(0,o.kt)(u,(0,a.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h2",{id:"for-new-data"},"For new data"),(0,o.kt)("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.kt)("a",{parentName:"p",href:"/docs/28.0.1/ingestion/#streaming"},"streaming ingestion"),", or to\nprovide the new schema the next time you do a ",(0,o.kt)("a",{parentName:"p",href:"/docs/28.0.1/ingestion/#batch"},"batch ingestion"),". This is made possible by\nthe fact that each ",(0,o.kt)("a",{parentName:"p",href:"/docs/28.0.1/design/architecture#datasources-and-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.kt)("h2",{id:"for-existing-data"},"For existing data"),(0,o.kt)("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.kt)("a",{parentName:"p",href:"/docs/28.0.1/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."))}f.isMDXComponent=!0}}]);