blob: 0d4408cc9146539af7b71cb38413d0982eed75fb [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-61232409-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-61232409-1');
</script>
<!-- Yandex.Metrika counter -->
<script type="text/javascript" >
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
ym(72949126, "init", {
clickmap:true,
trackLinks:true,
accurateTrackBounce:true,
webvisor:true
});
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/72949126" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
<!-- Bugyard widget embed -->
<script type="text/javascript">!function(){if("function"!=typeof window.bugyard){var a=function(){a.c(arguments)};a.q=[],a.c=function(b){a.q.push(b)},window.bugyard=a;var b=document.createElement("script");b.setAttribute("data-bugyard","610961912c35ff001493163a"),b.setAttribute("async","async"),b.setAttribute("defer","defer"),b.setAttribute("src","https://widget.bugyard.io/bugyard.min.js"),document.getElementsByTagName("head")[0].appendChild(b)}}(); window.bugyard("hideButton"); </script>
<link rel="preload" href='/assets/js/code-tabs.js?1' as="script" crossorigin>
<link rel="preload" href='/assets/js/page-nav.js' as="script" crossorigin>
<link rel="preload" href='/assets/js/docs-menu.js?20201005' as="script" crossorigin>
<style>:root{--gg-red:#ec1c24;--gg-orange:#ec1c24;--gg-orange-dark:#bc440b;--gg-orange-filter:invert(47%) sepia(61%) saturate(1950%) hue-rotate(345deg) brightness(100%) contrast(95%);--gg-dark-gray:#333333;--orange-line-thickness:3px;--block-code-background:rgba(241, 241, 241, 20%);--inline-code-background:rgba(241, 241, 241, 90%);--padding-top:25px;--link-color:#ec1c24;--body-background:#fcfcfc}header{min-height:var(--header-height);background:#fff;box-shadow:0 4px 10px 0 #eee,0 0 4px 0 #d5d5d5;z-index:1}header>.container{display:grid;grid-template-columns:auto auto 1fr auto auto auto;grid-template-areas:'left-toggle home nav ver api search lang';grid-template-rows:40px;flex-direction:row;align-items:center;justify-content:flex-start;padding:12px 20px;max-width:1400px;margin:0 auto}header nav>ul{padding:0;margin:0;list-style:none;display:inherit}header .dropdown{display:none;position:fixed;top:calc(var(--header-height) - 12px);width:auto;background:#fff;box-shadow:0 4px 4px 0 rgba(0,0,0,.24),0 0 4px 0 rgba(0,0,0,.12);border-radius:4px;padding-top:10px;padding-bottom:12px;z-index:2}header .dropdown li{display:flex}header .dropdown a{color:grey!important;font-size:16px;padding-top:5px;padding-bottom:4px}header .menu{border:none;background:0 0;width:40px;height:40px;margin-right:12px;grid-area:left-toggle}header .menu img{width:18px;height:12px}header .search-close,header .top-nav-toggle{background:0 0;border:none;padding:0;width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;color:var(--gg-dark-gray);font-size:26px}header .search-toggle{grid-area:search}header .top-nav-toggle{grid-area:top-toggle}header .home{grid-area:home;margin-right:auto}header .home img{height:36px}header #api-docs{grid-area:api;margin:0;display:flex}header #api-docs .dropdown{padding:.5em 0}header #api-docs a{padding:9px 14px;color:var(--gg-dark-gray)!important;text-decoration:none;white-space:nowrap}header #api-docs .dropdown-item a{font-weight:400;display:block;width:100%;min-width:150px}header #lang-selector li{list-style:none;display:flex;padding:9px 14px}header #lang-selector li a{display:flex;color:#000;align-items:center}header #lang-selector li a span{font-size:10px;margin-left:5px}header #lang-selector li a img{width:25px}header #lang-selector li .dropdown{margin-left:-70px}header #lang-selector li .dropdown .dropdown-item{padding:0 1em;margin-bottom:8px}header #lang-selector li .dropdown .dropdown-item a span{font-size:14px}header .search{margin-left:auto;margin-right:20px;grid-area:search}header .search input[type=search]{color:var(--gg-dark-gray);background:rgba(255,255,255,.8);border:1px solid #ccc;padding:10px 15px;font-family:inherit;max-width:148px;height:37px;font-size:14px;-webkit-appearance:unset;appearance:unset}header #version-selector{list-style:none;grid-area:ver;line-height:28px;border-radius:0;margin-right:10px;border:none;color:var(--gg-dark-gray);padding:5px 16px 5px 10px;white-space:nowrap;font-size:14px;width:auto;text-align:right;box-sizing:border-box;text-align-last:right;-moz-appearance:none;-webkit-appearance:none;appearance:none;direction:rtl}header #version-selector option{direction:ltr}header>nav{grid-area:nav;font-size:18px;display:flex;flex-direction:row;margin:0 20px}header #lang-selector{grid-area:lang}header .search-close{margin-right:10px}@media (max-width:600px){header .search{margin-right:5px}header .search input[type=search]{max-width:110px}}header:not(.narrow-header) .search-close,header:not(.narrow-header) .top-nav-toggle{display:none}@media (max-width:670px){header>.container{grid-template-columns:auto 1fr auto;grid-template-areas:'left-toggle home search' 'ver api lang'}header #lang-selector li{justify-content:flex-end}}pre,pre.rouge{padding:8px 15px;background:var(--block-code-background)!important;border-radius:5px;border:1px solid #e5e5e5;overflow-x:auto;min-height:36px;line-height:18px;color:#545454}code{color:#545454}pre.rouge code{background:0 0!important}:not(pre)>code{background:var(--inline-code-background);padding:.1em .5em;background-clip:padding-box;border-radius:3px;color:#545454;font-size:90%}.listingblock .content{position:relative}.highlight{color:#586e75}.highlight .c1{color:#657b83}.highlight .nt{color:#b58900}.highlight .o{color:#93a1a1}.highlight .k{color:#6c71c4}.highlight .kt{color:#cb4b16}.highlight .s,.highlight .s1{color:#859900}.highlight .nc{color:#b58900}.highlight .na{color:#268bd2}body{font-family:'Open Sans',sans-serif}h1,h2{color:#000;font-weight:400;font-family:'Open Sans'}h1{font-size:36px;line-height:40px}a{text-decoration:none;color:var(--link-color)}section{color:#545454}.admonitionblock .icon .title{display:none}body{--header-height:64px;--promotion-bar-height:35px;--footer-height:104px;--footer-gap:60px;padding:0;margin:0;display:flex;flex-direction:column;min-height:100vh;background-color:var(--body-background);font-family:'Open Sans',sans-serif}body>section{flex:1}header{position:-webkit-sticky;position:sticky;top:0;z-index:2}*{box-sizing:border-box}@media (max-width:670px){body{--header-height:97px}}.left-nav{padding:10px 20px;width:289px;overflow-y:auto;top:calc(var(--header-height) + var(--promotion-bar-height));height:calc(100vh - var(--header-height) - var(--promotion-bar-height));font-family:'Open Sans';padding-top:var(--padding-top);background-color:var(--body-background)}.left-nav li{list-style:none}.left-nav a,.left-nav button{text-decoration:none;color:#757575;font-size:16px;display:inline-flex;width:100%;margin:2px 0;padding:.25em .375em;background:0 0;border:none;font:inherit;text-align:left}.left-nav a.active{color:var(--link-color)}.left-nav .nav-group{margin-left:6px;font-size:14px}.left-nav nav{border-left:2px solid #ddd;margin-bottom:5px}.left-nav nav.collapsed{display:none}.left-nav nav>li>a,.left-nav nav>li>button{padding-left:20px;text-align:left}.left-nav nav>li>a.active{border-left:var(--orange-line-thickness) solid var(--active-color);padding-left:calc(20px - var(--orange-line-thickness))}.left-nav nav.sub_pages{border:none}.left-nav nav.sub_pages a{padding-left:32px}.left-nav .state-indicator{margin-left:auto;margin-top:5px;width:6.2px;height:10px;flex:0 0 auto;filter:invert(49%) sepia(4%) saturate(5%) hue-rotate(23deg) brightness(92%) contrast(90%)}.left-nav button.expanded .state-indicator{transform:rotate(90deg)}.right-nav{width:289px;padding:12px 26px;overflow-y:auto;height:calc(100vh - var(--header-height));top:0;position:-webkit-sticky;position:sticky;display:flex;flex-direction:column;font-family:'Open sans';padding-top:var(--padding-top);background-color:#fff}.right-nav ul{list-style:none;padding:0;margin:0}.right-nav li{padding:0}.right-nav a{--border-width:0px;font-size:14px;color:#757575;padding-left:calc(15px * var(--nesting-level) + 8px - var(--border-width));margin:.3em 0;display:inline-block}.right-nav .sectlevel1{border-left:2px solid #ddd}.right-nav .sectlevel1{--nesting-level:0}.right-nav .sectlevel2{--nesting-level:1}.right-nav .sectlevel3{--nesting-level:2}@media (max-width:1200px){.right-nav{width:230px}}.right-nav footer{font-size:12px;padding:calc(var(--footer-gap) * .3) 0 5px;text-align:left;margin:auto 0 0}section.page-docs{display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:100%;grid-template-areas:'left-nav content right-nav';line-height:20px;max-width:1440px;margin:auto;width:100%}section.page-docs>article{border-left:1px solid #eee;background-color:#fff;padding:0 50px 30px;grid-area:content;overflow:hidden;font-family:sans-serif;font-size:16px;color:#545454;line-height:1.6em}section.page-docs>article h1,section.page-docs>article h2{font-family:'Open Sans'}@media (max-width:800px){section.page-docs>article{padding-left:15px;padding-right:15px}}section.page-docs .edit-link{position:relative;top:10px;right:10px;float:right;padding-top:calc(var(--header-height) + var(--padding-top));margin-top:calc((-1 * var(--header-height)))}section.page-docs h1,section.page-docs h2{margin-bottom:0}section.page-docs h2[id]{margin-top:var(--margin-top);margin-bottom:calc(var(--margin-top) * .5);z-index:-1}section.page-docs .title{font-style:italic}section.page-docs h2[id]{--margin-top:1.2em}.left-nav{bottom:0;position:-webkit-sticky;position:sticky}.left-nav{grid-area:left-nav}.right-nav{grid-area:right-nav}.left-nav__overlay{display:none;background:rgba(0,0,0,.5);z-index:1;position:fixed;top:var(--header-height);bottom:0;left:0;right:0}@media (max-width:990px){body:not(.hide-left-nav) .left-nav__overlay{display:block}nav.left-nav{background:#fafafa;grid-area:left-nav;box-shadow:0 4px 4px 0 rgba(0,0,0,.24),0 0 4px 0 rgba(0,0,0,.12);min-height:calc(100vh - var(--header-height));max-height:calc(100vh - var(--header-height));position:fixed;bottom:0;top:var(--header-height);z-index:2}section.page-docs>article{grid-column-start:left-nav;grid-column-end:content;grid-row:content}}@media (max-width:800px){nav.right-nav{display:none}}:target:before{content:"";display:block;margin-top:calc(var(--header-height) * -1);height:var(--header-height);width:1px}@media (min-width:600px) and (max-width:900px){:target:before{content:"";display:block;width:1px;margin-top:-150px;height:150px}}
#header #promotion-bar { background-color: #333333; padding: 8px; }
#header #promotion-bar p { font-size: 14px; line-height: 1.4em; font-weight: 600; padding: 0; margin: 0; color: #f0f0f0; text-align: center;}
#header #promotion-bar p a { color: #FCB903; } </style>
<meta name="ignite-version" content="3.0.0-alpha" />
<title>Data Definition Language (DDL) | Ignite Documentation</title>
<link rel="canonical" href="/docs/3.0.0-alpha/sql-reference/ddl" />
<META NAME="ROBOTS" CONTENT="NOINDEX" />
<link rel="shortcut icon" href="/favicon.ico">
<meta name='viewport' content='width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0'>
<link rel="preload" as="style" href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap" media="print" onload="this.media='all'">
<noscript>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap" rel="stylesheet">
</noscript>
<script>
// AnchorJS - v4.2.0 - 2019-01-01
// https://github.com/bryanbraun/anchorjs
// Copyright (c) 2019 Bryan Braun; Licensed MIT
!function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(this,function(){"use strict";return function(A){function f(A){A.icon=A.hasOwnProperty("icon")?A.icon:"",A.visible=A.hasOwnProperty("visible")?A.visible:"hover",A.placement=A.hasOwnProperty("placement")?A.placement:"right",A.ariaLabel=A.hasOwnProperty("ariaLabel")?A.ariaLabel:"Anchor",A.class=A.hasOwnProperty("class")?A.class:"",A.base=A.hasOwnProperty("base")?A.base:"",A.truncate=A.hasOwnProperty("truncate")?Math.floor(A.truncate):64,A.titleText=A.hasOwnProperty("titleText")?A.titleText:""}function p(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new Error("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}this.options=A||{},this.elements=[],f(this.options),this.isTouchDevice=function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)},this.add=function(A){var e,t,i,n,o,s,a,r,c,h,l,u,d=[];if(f(this.options),"touch"===(l=this.options.visible)&&(l=this.isTouchDevice()?"always":"hover"),A||(A="h2, h3, h4, h5, h6"),0===(e=p(A)).length)return this;for(function(){if(null===document.head.querySelector("style.anchorjs")){var A,e=document.createElement("style");e.className="anchorjs",e.appendChild(document.createTextNode("")),void 0===(A=document.head.querySelector('[rel="stylesheet"], style'))?document.head.appendChild(e):document.head.insertBefore(e,A),e.sheet.insertRule(" .anchorjs-link { opacity: 0; text-decoration: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }",e.sheet.cssRules.length),e.sheet.insertRule(" *:hover > .anchorjs-link, .anchorjs-link:focus { opacity: 1; }",e.sheet.cssRules.length),e.sheet.insertRule(" [data-anchorjs-icon]::after { content: attr(data-anchorjs-icon); }",e.sheet.cssRules.length),e.sheet.insertRule(' @font-face { font-family: "anchorjs-icons"; src: url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype"); }',e.sheet.cssRules.length)}}(),t=document.querySelectorAll("[id]"),i=[].map.call(t,function(A){return A.id}),o=0;o<e.length;o++)if(this.hasAnchorJSLink(e[o]))d.push(o);else{if(e[o].hasAttribute("id"))n=e[o].getAttribute("id");else if(e[o].hasAttribute("data-anchor-id"))n=e[o].getAttribute("data-anchor-id");else{for(c=r=this.urlify(e[o].textContent),a=0;void 0!==s&&(c=r+"-"+a),a+=1,-1!==(s=i.indexOf(c)););s=void 0,i.push(c),e[o].setAttribute("id",c),n=c}n.replace(/-/g," "),(h=document.createElement("a")).className="anchorjs-link "+this.options.class,h.setAttribute("aria-label",this.options.ariaLabel),h.setAttribute("data-anchorjs-icon",this.options.icon),this.options.titleText&&(h.title=this.options.titleText),u=document.querySelector("base")?window.location.pathname+window.location.search:"",u=this.options.base||u,h.href=u+"#"+n,"always"===l&&(h.style.opacity="1"),""===this.options.icon&&(h.style.font="1em/1 anchorjs-icons","left"===this.options.placement&&(h.style.lineHeight="inherit")),"left"===this.options.placement?(h.style.position="absolute",h.style.marginLeft="-1em",h.style.paddingRight="0.5em",e[o].insertBefore(h,e[o].firstChild)):(h.style.paddingLeft="0.375em",e[o].appendChild(h))}for(o=0;o<d.length;o++)e.splice(d[o]-o,1);return this.elements=this.elements.concat(e),this},this.remove=function(A){for(var e,t,i=p(A),n=0;n<i.length;n++)(t=i[n].querySelector(".anchorjs-link"))&&(-1!==(e=this.elements.indexOf(i[n]))&&this.elements.splice(e,1),i[n].removeChild(t));return this},this.removeAll=function(){this.remove(this.elements)},this.urlify=function(A){return this.options.truncate||f(this.options),A.trim().replace(/\'/gi,"").replace(/[& +$,:;=?@"#{}|^~[`%!'<>\]\.\/\(\)\*\\\n\t\b\v]/g,"-").replace(/-{2,}/g,"-").substring(0,this.options.truncate).replace(/^-+|-+$/gm,"").toLowerCase()},this.hasAnchorJSLink=function(A){var e=A.firstChild&&-1<(" "+A.firstChild.className+" ").indexOf(" anchorjs-link "),t=A.lastChild&&-1<(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ");return e||t||!1}}});
</script>
</head>
<body>
<header>
<!--#include virtual="/includes/promotion_banner.html" -->
<div class="container">
<button type='button' class='menu' title='Docs menu'>
<img src="/assets/images/menu-icon.svg" width="18" height="12" alt="menu icon" />
</button>
<div class='home'>
<a href="/" class='home' title='Apache Ignite home'>
<img src="/assets/images/apache_ignite_logo.svg" alt="Apache Ignite logo" width="103" height="36" >
</a>
</div>
<select id="version-selector">
<option value="3.0.0-alpha">3.0.0-alpha</option>
</select>
<nav id="api-docs"><ul>
<li><a href="#">APIs</a>
<nav class='dropdown'>
<ul>
<li class="dropdown-item"><a href="/releases/latest/javadoc/index.html">Java</a></li>
<li class="dropdown-item"><a href="/releases/latest/dotnetdoc/api/">C#/.NET</a></li>
<li class="dropdown-item"><a href="/releases/latest/cppdoc/index.html">C++</a></li>
<li class="dropdown-item"><a href="/releases/latest/scaladoc/scalar/index.html#org.apache.ignite.scalar.scalar$">Scala</a></li>
</ul>
</nav>
</li>
<li><a href="#">Examples</a>
<nav class="dropdown">
<ul>
<li class="dropdown-item"><a href="https://github.com/apache/ignite/tree/master/examples" target="_blank" rel="noopener" title="Apache Ignite Java examples">Java</a></li>
<li class="dropdown-item"><a href="https://github.com/apache/ignite/tree/master/modules/platforms/dotnet/examples" target="_blank" rel="noopener" title="Apache Ignite C#/.NET examples">C#/.NET</a></li>
<li class="dropdown-item"><a href="https://github.com/apache/ignite/tree/master/modules/platforms/cpp/examples" target="_blank" rel="noopener" title="Apache Ignite C++ examples">C++</a></li>
<li class="dropdown-item"><a href="https://github.com/apache/ignite/tree/master/modules/platforms/python/examples" target="_blank" rel="noopener" title="Apache Ignite Python examples">Python</a></li>
<li class="dropdown-item"><a href="https://github.com/apache/ignite/tree/master/modules/platforms/nodejs/examples" target="_blank" rel="noopener" title="Apache Ignite NodeJS examples">NodeJS</a></li>
<li class="dropdown-item"><a href="https://github.com/apache/ignite/tree/master/modules/platforms/php/examples" target="_blank" rel="noopener" title="Apache Ignite PHP examples">PHP</a></li>
</ul>
</nav>
</li></ul>
</nav>
<form class='search'>
<button class="search-close" type='button'><img src='/assets/images/cancel.svg' alt="close" width="10" height="10" /></button>
<input type="search" placeholder="Search…" id="search-input">
</form>
<nav id="lang-selector"><ul>
<li><a href="#"><img src="/assets/images/icon_lang_en_75x75.jpg" alt="English language icon" width="25" height="25" /><span></span></a>
<nav class="dropdown">
<li class="dropdown-item"><a href="/docs/latest/" ><img src="/assets/images/icon_lang_en_75x75.jpg" alt="English language icon" width="25" height="25" /><span>English</span></a></li>
<li class="dropdown-item"><a href="https://www.ignite-service.cn/doc/java/" target="_blank" rel="noopener"><img src="/assets/images/icon_lang_cn_75x75.jpg" width="25" height="25" alt="Chinese language icon" /><span>Chinese</span></a></li>
</nav>
</li></ul>
</nav>
<button type='button' class='top-nav-toggle'></button>
</div>
</header>
<link rel="stylesheet" href="/assets/css/docs.css">
<section class='page-docs'>
<nav class='left-nav' data-swiftype-index='false'>
<li>
<a href="/docs/3.0.0-alpha/index" class='' >Documentation Overview</a>
</li>
<li>
<a href="/docs/3.0.0-alpha/quick-start/getting-started-guide" class='' >Getting Started Guide</a>
</li>
<li>
<a href="/docs/3.0.0-alpha/ignite-cli-tool" class='' >Ignite CLI Tool</a>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Working with SQL<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/3.0.0-alpha/sql/calcite-based-sql-engine"
class=''
>Introduction</a>
</li>
<li>
<a href="/docs/3.0.0-alpha/sql/jdbc-driver"
class=''
>JDBC Driver</a>
</li>
<li>
<a href="/docs/3.0.0-alpha/sql/java"
class=''
>Java API</a>
</li>
</nav>
</li>
<li>
<button type='button' class='group-toggle expanded '>SQL Reference<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group expanded'>
<li>
<a href="/docs/3.0.0-alpha/sql-reference/ddl"
class='active'
>Data Definition Language (DDL)</a>
</li>
<li>
<a href="/docs/3.0.0-alpha/sql-reference/dml"
class=''
>Data Manipulation Language (DML)</a>
</li>
<li>
<a href="/docs/3.0.0-alpha/sql-reference/operators-and-functions"
class=''
>Supported Operators and Functions</a>
</li>
</nav>
</li>
<li>
<a href="/docs/3.0.0-alpha/rest/rest-api" class='' >REST API</a>
</li>
<li>
<a href="/docs/3.0.0-alpha/compute/compute" class='' >Distributed Computing</a>
</li>
<li>
<a href="/docs/3.0.0-alpha/config/data-region" class='' >Data Region Configuration</a>
</li>
<li>
<a href="/docs/3.0.0-alpha/binary-protocol" class='' >Binary Client Protocol</a>
</li>
<li>
<a href="/docs/3.0.0-alpha/persistence" class='' >Native Persistence</a>
</li>
<li>
<a href="/docs/3.0.0-alpha/rebalance" class='' >Data Rebalancing</a>
</li>
<li>
<a href="/docs/3.0.0-alpha/transactions/performing-transactions" class='' >Performing Transactions</a>
</li>
<li>
<a href="/docs/3.0.0-alpha/table-views" class='' >Table Views</a>
</li>
</nav>
<div class="left-nav__overlay"></div>
<article data-swiftype-index='true'>
<a class='edit-link' href="https://github.com/apache/ignite/tree/IGNITE-7595/docs/_docs/sql-reference/ddl.adoc" target="_blank">Edit</a>
<h1>Data Definition Language (DDL)</h1>
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>This section walks you through all data definition language (DDL) commands supported by Apache Ignite 3.0 Alpha.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="create-table">CREATE TABLE</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Creates a new table.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">CREATE</span> <span class="k">TABLE</span> <span class="p">[</span><span class="n">IF</span> <span class="k">NOT</span> <span class="k">EXISTS</span><span class="p">]</span> <span class="p">[</span><span class="n">simpleName</span> <span class="o">|</span> <span class="n">schemaName</span><span class="p">.</span><span class="n">simpleName</span><span class="p">]</span> <span class="p">(</span><span class="n">tableColumn</span> <span class="p">[,</span> <span class="n">tableColumn</span><span class="p">]...)</span>
<span class="p">[</span><span class="n">COLOCATE</span> <span class="p">[</span><span class="k">BY</span><span class="p">]</span> <span class="p">(</span><span class="n">tableColumn</span> <span class="p">[,</span> <span class="n">tableColumn</span><span class="p">]...)]</span>
<span class="p">[</span><span class="n">ENGINE</span> <span class="n">engineName</span><span class="p">]</span>
<span class="p">[</span><span class="k">WITH</span> <span class="n">paramName</span><span class="o">=</span><span class="n">paramValue</span> <span class="p">[,</span><span class="n">paramName</span><span class="o">=</span><span class="n">paramValue</span><span class="p">]...]</span>
<span class="n">tableColumn</span> <span class="o">=</span> <span class="n">columnName</span> <span class="n">columnType</span> <span class="p">[[</span><span class="k">NOT</span><span class="p">]</span> <span class="k">NULL</span><span class="p">]</span> <span class="p">[</span><span class="k">DEFAULT</span> <span class="n">defaultValue</span><span class="p">]</span> <span class="p">[</span><span class="k">PRIMARY</span> <span class="k">KEY</span><span class="p">]</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>tableName</code> - name of the table.</p>
</li>
<li>
<p><code>tableColumn</code> - name and type of a column to be created in the new table.</p>
</li>
<li>
<p><code>DEFAULT</code> - specifies a default value for the column. Only constant values are accepted.</p>
</li>
<li>
<p><code>IF NOT EXISTS</code> - create the table only if a table with the same name does not exist.</p>
</li>
<li>
<p><code>ENGINE</code> - selects the storage engine to use. Currently <code>pagememory</code> and <code>rocksdb</code> are available.</p>
</li>
<li>
<p><code>COLOCATED BY</code> - colocation key. The key can be composite. Primary key must include colocation key. Was <code>affinity_key</code> in Ignite 2.x.</p>
</li>
<li>
<p><code>WITH</code> - accepts additional parameters not defined by ANSI-99 SQL:</p>
<div class="ulist">
<ul>
<li>
<p><code>Replicas</code> - sets the number of partition copies, including the master copy.</p>
</li>
<li>
<p><code>Partitions</code> - sets the number of table partitions.</p>
</li>
<li>
<p><code>dataRegion</code> - sets the data region to work with.</p>
</li>
</ul>
</div>
</li>
</ul>
</div>
<div class="imageblock">
<div class="content">
<svg class="railroad-diagram" width="872" height="122" viewBox="0 0 872 122" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g transform="translate(.5 .5)">
<g>
<path d="M20 51v20m10 -20v20m-10 -10h20"></path>
</g>
<path d="M40 61h10"></path>
<g>
<path d="M50 61h0"></path>
<path d="M822 61h0"></path>
<g class="terminal ">
<path d="M50 61h0"></path>
<path d="M118 61h0"></path>
<rect x="50" y="50" width="68" height="22" rx="10" ry="10"></rect>
<text x="84" y="65">CREATE</text>
</g>
<path d="M118 61h10"></path>
<path d="M128 61h10"></path>
<g class="terminal ">
<path d="M138 61h0"></path>
<path d="M198 61h0"></path>
<rect x="138" y="50" width="60" height="22" rx="10" ry="10"></rect>
<text x="168" y="65">TABLE</text>
</g>
<path d="M198 61h10"></path>
<g>
<path d="M208 61h0"></path>
<path d="M372 61h0"></path>
<path d="M208 61a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M228 41h124"></path>
</g>
<path d="M352 41a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M208 61h20"></path>
<g class="terminal ">
<path d="M228 61h0"></path>
<path d="M352 61h0"></path>
<rect x="228" y="50" width="124" height="22" rx="10" ry="10"></rect>
<text x="290" y="65">IF NOT EXISTS</text>
</g>
<path d="M352 61h20"></path>
</g>
<path d="M372 61h10"></path>
<a xlink:href="https://ignite.apache.org/docs/3.0.0-alpha/sql-reference/ddl#qualified_table_name">
<g class="non-terminal ">
<path d="M382 61h0"></path>
<path d="M482 61h0"></path>
<rect x="382" y="50" width="100" height="22"></rect>
<text x="432" y="65" fill="blue">table&#95;name</text>
</g>
</a>
<path d="M482 61h10"></path>
<path d="M492 61h10"></path>
<g class="terminal ">
<path d="M502 61h0"></path>
<path d="M530 61h0"></path>
<rect x="502" y="50" width="28" height="22" rx="10" ry="10"></rect>
<text x="516" y="65">(</text>
</g>
<path d="M530 61h10"></path>
<path d="M540 61h10"></path>
<g>
<path d="M550 61h0"></path>
<path d="M774 61h0"></path>
<path d="M550 61h10"></path>
<g>
<path d="M560 61h0"></path>
<path d="M764 61h0"></path>
<path d="M560 61a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path>
<a xlink:href="https://ignite.apache.org/docs/3.0.0-alpha/sql-reference/ddl#constraint">
<g class="non-terminal ">
<path d="M580 31h32"></path>
<path d="M712 31h32"></path>
<rect x="612" y="20" width="100" height="22"></rect>
<text x="662" y="35" fill="blue">constraint</text>
</g>
</a>
<path d="M744 31a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path>
<path d="M560 61h20"></path>
<a xlink:href="https://ignite.apache.org/docs/3.0.0-alpha/sql-reference/ddl#column_definition">
<g class="non-terminal ">
<path d="M580 61h0"></path>
<path d="M744 61h0"></path>
<rect x="580" y="50" width="164" height="22"></rect>
<text x="662" y="65" fill="blue">columns&#95;definition</text>
</g>
</a>
<path d="M744 61h20"></path>
</g>
<path d="M764 61h10"></path>
<path d="M560 61a10 10 0 0 0 -10 10v10a10 10 0 0 0 10 10"></path>
<g class="terminal ">
<path d="M560 91h88"></path>
<path d="M676 91h88"></path>
<rect x="648" y="80" width="28" height="22" rx="10" ry="10"></rect>
<text x="662" y="95">,</text>
</g>
<path d="M764 91a10 10 0 0 0 10 -10v-10a10 10 0 0 0 -10 -10"></path>
</g>
<path d="M774 61h10"></path>
<path d="M784 61h10"></path>
<g class="terminal ">
<path d="M794 61h0"></path>
<path d="M822 61h0"></path>
<rect x="794" y="50" width="28" height="22" rx="10" ry="10"></rect>
<text x="808" y="65">)</text>
</g>
</g>
<path d="M822 61h10"></path>
<g fill="none" stroke="black" stroke-width="2">
<path stroke-dasharray="5,5" d="M830 61 l30 0" />
</g>
</g>
<style>
svg {
background-color: hsl(0,0%,100%);
}
path {
stroke-width: 2;
stroke: black;
fill: rgba(0,0,0,0);
}
text {
font: bold 14px monospace;
text-anchor: middle;
white-space: pre;
}
text.diagram-text {
font-size: 12px;
}
text.diagram-arrow {
font-size: 16px;
}
text.label {
text-anchor: start;
}
text.comment {
font: italic 12px monospace;
}
g.non-terminal text {
/&#42;font-style: italic;&#42;/
}
rect {
stroke-width: 2;
stroke: black;
fill: hsl(0,0%,100%);
}
rect.group-box {
stroke: gray;
stroke-dasharray: 10 5;
fill: none;
}
path.diagram-text {
stroke-width: 2;
stroke: black;
fill: white;
cursor: help;
}
g.diagram-text:hover path.diagram-text {
fill: #eee;
}</style>
</svg>
</div>
</div>
<div class="imageblock">
<div class="content">
<svg class="railroad-diagram" width="1072" height="109" viewBox="0 0 1072 109" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g transform="translate(.5 .5)">
<g fill="none" stroke="black" stroke-width="2">
<path stroke-dasharray="5,5" d="M10 48 l30 0" />
</g>
<path d="M40 48h10"></path>
<g>
<path d="M50 48h0"></path>
<path d="M1022 48h0"></path>
<g>
<path d="M50 48h0"></path>
<path d="M378 48h0"></path>
<path d="M50 48a10 10 0 0 0 10 -10v-8a10 10 0 0 1 10 -10"></path>
<g>
<path d="M70 20h288"></path>
</g>
<path d="M358 20a10 10 0 0 1 10 10v8a10 10 0 0 0 10 10"></path>
<path d="M50 48h20"></path>
<g>
<path d="M70 48h0"></path>
<path d="M358 48h0"></path>
<g class="terminal ">
<path d="M70 48h0"></path>
<path d="M154 48h0"></path>
<rect x="70" y="37" width="84" height="22" rx="10" ry="10"></rect>
<text x="112" y="52">COLOCATE</text>
</g>
<path d="M154 48h10"></path>
<g>
<path d="M164 48h0"></path>
<path d="M240 48h0"></path>
<path d="M164 48a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M184 28h36"></path>
</g>
<path d="M220 28a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M164 48h20"></path>
<g class="terminal ">
<path d="M184 48h0"></path>
<path d="M220 48h0"></path>
<rect x="184" y="37" width="36" height="22" rx="10" ry="10"></rect>
<text x="202" y="52">BY</text>
</g>
<path d="M220 48h20"></path>
</g>
<path d="M240 48h10"></path>
<a xlink:href="https://ignite.apache.org/docs/3.0.0-alpha/sql-reference/ddl#column_list">
<g class="non-terminal ">
<path d="M250 48h0"></path>
<path d="M358 48h0"></path>
<rect x="250" y="37" width="108" height="22"></rect>
<text x="304" y="52" fill="blue">column_list</text>
</g>
</a>
</g>
<path d="M358 48h20"></path>
</g>
<g>
<path d="M378 48h0"></path>
<path d="M614 48h0"></path>
<path d="M378 48a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M398 28h196"></path>
</g>
<path d="M594 28a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M378 48h20"></path>
<g>
<path d="M398 48h0"></path>
<path d="M594 48h0"></path>
<g class="terminal ">
<path d="M398 48h0"></path>
<path d="M466 48h0"></path>
<rect x="398" y="37" width="68" height="22" rx="10" ry="10"></rect>
<text x="432" y="52">ENGINE</text>
</g>
<path d="M466 48h10"></path>
<path d="M476 48h10"></path>
<g class="non-terminal ">
<path d="M486 48h0"></path>
<path d="M594 48h0"></path>
<rect x="486" y="37" width="108" height="22"></rect>
<text x="540" y="52">engine&#95;name</text>
</g>
</g>
<path d="M594 48h20"></path>
</g>
<g>
<path d="M614 48h0"></path>
<path d="M1022 48h0"></path>
<path d="M614 48a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M634 28h368"></path>
</g>
<path d="M1002 28a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M614 48h20"></path>
<g>
<path d="M634 48h0"></path>
<path d="M1002 48h0"></path>
<g class="terminal ">
<path d="M634 48h0"></path>
<path d="M686 48h0"></path>
<rect x="634" y="37" width="52" height="22" rx="10" ry="10"></rect>
<text x="660" y="52">WITH</text>
</g>
<path d="M686 48h10"></path>
<path d="M696 48h10"></path>
<g>
<path d="M706 48h0"></path>
<path d="M1002 48h0"></path>
<path d="M706 48h10"></path>
<g>
<path d="M716 48h0"></path>
<path d="M992 48h0"></path>
<g class="non-terminal ">
<path d="M716 48h0"></path>
<path d="M816 48h0"></path>
<rect x="716" y="37" width="100" height="22"></rect>
<text x="766" y="52">param&#95;name</text>
</g>
<path d="M816 48h10"></path>
<path d="M826 48h10"></path>
<g class="terminal ">
<path d="M836 48h0"></path>
<path d="M864 48h0"></path>
<rect x="836" y="37" width="28" height="22" rx="10" ry="10"></rect>
<text x="850" y="52">=</text>
</g>
<path d="M864 48h10"></path>
<path d="M874 48h10"></path>
<g class="non-terminal ">
<path d="M884 48h0"></path>
<path d="M992 48h0"></path>
<rect x="884" y="37" width="108" height="22"></rect>
<text x="938" y="52">param&#95;value</text>
</g>
</g>
<path d="M992 48h10"></path>
<path d="M716 48a10 10 0 0 0 -10 10v10a10 10 0 0 0 10 10"></path>
<g class="terminal ">
<path d="M716 78h124"></path>
<path d="M868 78h124"></path>
<rect x="840" y="67" width="28" height="22" rx="10" ry="10"></rect>
<text x="854" y="82">,</text>
</g>
<path d="M992 78a10 10 0 0 0 10 -10v-10a10 10 0 0 0 -10 -10"></path>
</g>
</g>
<path d="M1002 48h20"></path>
</g>
</g>
<path d="M1022 48h10"></path>
<path d="M 1032 48 h 20 m -10 -10 v 20 m 10 -20 v 20"></path>
</g>
<style>
svg {
background-color: hsl(0,0%,100%);
}
path {
stroke-width: 2;
stroke: black;
fill: rgba(0,0,0,0);
}
text {
font: bold 14px monospace;
text-anchor: middle;
white-space: pre;
}
text.diagram-text {
font-size: 12px;
}
text.diagram-arrow {
font-size: 16px;
}
text.label {
text-anchor: start;
}
text.comment {
font: italic 12px monospace;
}
g.non-terminal text {
/&#42;font-style: italic;&#42;/
}
rect {
stroke-width: 2;
stroke: black;
fill: hsl(0,0%,100%);
}
rect.group-box {
stroke: gray;
stroke-dasharray: 10 5;
fill: none;
}
path.diagram-text {
stroke-width: 2;
stroke: black;
fill: white;
cursor: help;
}
g.diagram-text:hover path.diagram-text {
fill: #eee;
}</style>
</svg>
</div>
</div>
<div class="paragraph">
<p>Examples:</p>
</div>
<div class="paragraph">
<p>Create Person table:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">CREATE</span> <span class="k">TABLE</span> <span class="n">IF</span> <span class="k">NOT</span> <span class="k">EXISTS</span> <span class="n">Person</span> <span class="p">(</span>
<span class="n">id</span> <span class="nb">int</span> <span class="k">primary</span> <span class="k">key</span><span class="p">,</span>
<span class="n">city_id</span> <span class="nb">int</span><span class="p">,</span>
<span class="n">name</span> <span class="nb">varchar</span><span class="p">,</span>
<span class="n">age</span> <span class="nb">int</span><span class="p">,</span>
<span class="n">company</span> <span class="nb">varchar</span><span class="p">,</span>
<span class="p">)</span></code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="alter-table">ALTER TABLE</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Modifies the structure of an existing table.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">
<h3 id="scope-of-alter-table" class="discrete">Scope of ALTER TABLE</h3>
<div class="paragraph">
<p>Presently, Apache Ignite only supports addition and removal of columns.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>ALTER TABLE IF EXISTS table LOGGING</strong></p>
</li>
</ul>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="p">[</span><span class="n">IF</span> <span class="k">EXISTS</span><span class="p">]</span> <span class="n">tableName</span> <span class="err">{</span><span class="n">LOGGING</span><span class="err">}</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>IF EXISTS</code> - if applied to <code>TABLE</code>, do not throw an error if a table with the specified table name does not exist. If applied to <code>COLUMN</code>, do not throw an error if a column with the specified name does not exist.</p>
</li>
<li>
<p><code>qualified_table_name</code> - the name of the table.</p>
</li>
<li>
<p><code>LOGGING</code> - enables write-ahead logging for the table. The command is relevant only if Ignite <a href="https://ignite.apache.org/docs/3.0.0-alpha/persistence" target="_blank" rel="noopener">persistence</a> is used.</p>
</li>
</ul>
</div>
<div class="imageblock">
<div class="content">
<svg class="railroad-diagram" width="738" height="91" viewBox="0 0 738 91" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g transform="translate(.5 .5)">
<g>
<path d="M20 30v20m10 -20v20m-10 -10h20"></path>
</g>
<path d="M40 40h10"></path>
<g>
<path d="M50 40h0"></path>
<path d="M688 40h0"></path>
<g class="terminal ">
<path d="M50 40h0"></path>
<path d="M163.5 40h0"></path>
<rect x="50" y="29" width="113.5" height="22" rx="10" ry="10"></rect>
<text x="106.75" y="44">ALTER TABLE</text>
</g>
<path d="M163.5 40h10"></path>
<g>
<path d="M173.5 40h0"></path>
<path d="M310 40h0"></path>
<path d="M173.5 40h20"></path>
<g>
<path d="M193.5 40h96.5"></path>
</g>
<path d="M290 40h20"></path>
<path d="M173.5 40a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<g class="terminal ">
<path d="M193.5 60h0"></path>
<path d="M290 60h0"></path>
<rect x="193.5" y="49" width="96.5" height="22" rx="10" ry="10"></rect>
<text x="241.75" y="64">IF EXISTS</text>
</g>
<path d="M290 60a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
</g>
<path d="M310 40h10"></path>
<a xlink:href="https://ignite.apache.org/docs/3.0.0-alpha/sql-reference/ddl#qualified_table_name">
<g class="non-terminal ">
<path d="M320 40h0"></path>
<path d="M510 40h0"></path>
<rect x="320" y="29" width="190" height="22"></rect>
<text x="415" y="44" fill="blue">qualified&#95;table&#95;name</text>
</g>
</a>
<path d="M510 40h10"></path>
<path d="M520 40h10"></path>
<g class="terminal ">
<path d="M530 40h0"></path>
<path d="M609.5 40h0"></path>
<rect x="530" y="29" width="79.5" height="22" rx="10" ry="10"></rect>
<text x="569.75" y="44">LOGGING</text>
</g>
<path d="M609.5 40h10"></path>
<g>
<path d="M619.5 40h0"></path>
<path d="M688 40h0"></path>
<path d="M619.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M639.5 20h28.5"></path>
</g>
<path d="M668 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M619.5 40h20"></path>
<g class="terminal ">
<path d="M639.5 40h0"></path>
<path d="M668 40h0"></path>
<rect x="639.5" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="653.75" y="44">;</text>
</g>
<path d="M668 40h20"></path>
</g>
</g>
<path d="M688 40h10"></path>
<path d="M 698 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path>
</g>
<style>
svg {
background-color: hsl(0,0%,100%);
}
path {
stroke-width: 2;
stroke: black;
fill: rgba(0,0,0,0);
}
text {
font: bold 14px monospace;
text-anchor: middle;
white-space: pre;
}
text.diagram-text {
font-size: 12px;
}
text.diagram-arrow {
font-size: 16px;
}
text.label {
text-anchor: start;
}
text.comment {
font: italic 12px monospace;
}
g.non-terminal text {
/&#42;font-style: italic;&#42;/
}
rect {
stroke-width: 2;
stroke: black;
fill: hsl(0,0%,100%);
}
rect.group-box {
stroke: gray;
stroke-dasharray: 10 5;
fill: none;
}
path.diagram-text {
stroke-width: 2;
stroke: black;
fill: white;
cursor: help;
}
g.diagram-text:hover path.diagram-text {
fill: #eee;
}</style>
</svg>
</div>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>ALTER TABLE IF EXISTS table NOLOGGING</strong></p>
</li>
</ul>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="p">[</span><span class="n">IF</span> <span class="k">EXISTS</span><span class="p">]</span> <span class="n">tableName</span> <span class="err">{</span><span class="n">NOLOGGING</span><span class="err">}</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>IF EXISTS</code> - if applied to <code>TABLE</code>, do not throw an error if a table with the specified table name does not exist. If applied to <code>COLUMN</code>, do not throw an error if a column with the specified name does not exist.</p>
</li>
<li>
<p><code>qualified_table_name</code> - the name of the table.</p>
</li>
<li>
<p><code>NOLOGGING</code> - disables write-ahead logging for the table. The command is relevant only if Ignite <a href="https://ignite.apache.org/docs/3.0.0-alpha/persistence" target="_blank" rel="noopener">persistence</a> is used.</p>
</li>
</ul>
</div>
<div class="imageblock">
<div class="content">
<svg class="railroad-diagram" width="755" height="91" viewBox="0 0 755 91" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g transform="translate(.5 .5)">
<g>
<path d="M20 30v20m10 -20v20m-10 -10h20"></path>
</g>
<path d="M40 40h10"></path>
<g>
<path d="M50 40h0"></path>
<path d="M705 40h0"></path>
<g class="terminal ">
<path d="M50 40h0"></path>
<path d="M163.5 40h0"></path>
<rect x="50" y="29" width="113.5" height="22" rx="10" ry="10"></rect>
<text x="106.75" y="44">ALTER TABLE</text>
</g>
<path d="M163.5 40h10"></path>
<g>
<path d="M173.5 40h0"></path>
<path d="M310 40h0"></path>
<path d="M173.5 40h20"></path>
<g>
<path d="M193.5 40h96.5"></path>
</g>
<path d="M290 40h20"></path>
<path d="M173.5 40a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<g class="terminal ">
<path d="M193.5 60h0"></path>
<path d="M290 60h0"></path>
<rect x="193.5" y="49" width="96.5" height="22" rx="10" ry="10"></rect>
<text x="241.75" y="64">IF EXISTS</text>
</g>
<path d="M290 60a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
</g>
<path d="M310 40h10"></path>
<a xlink:href="https://ignite.apache.org/docs/3.0.0-alpha/sql-reference/ddl#qualified_table_name">
<g class="non-terminal ">
<path d="M320 40h0"></path>
<path d="M510 40h0"></path>
<rect x="320" y="29" width="190" height="22"></rect>
<text x="415" y="44" fill="blue">qualified&#95;table&#95;name</text>
</g>
</a>
<path d="M510 40h10"></path>
<path d="M520 40h10"></path>
<g class="terminal ">
<path d="M530 40h0"></path>
<path d="M626.5 40h0"></path>
<rect x="530" y="29" width="96.5" height="22" rx="10" ry="10"></rect>
<text x="578.25" y="44">NOLOGGING</text>
</g>
<path d="M626.5 40h10"></path>
<g>
<path d="M636.5 40h0"></path>
<path d="M705 40h0"></path>
<path d="M636.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M656.5 20h28.5"></path>
</g>
<path d="M685 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M636.5 40h20"></path>
<g class="terminal ">
<path d="M656.5 40h0"></path>
<path d="M685 40h0"></path>
<rect x="656.5" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="670.75" y="44">;</text>
</g>
<path d="M685 40h20"></path>
</g>
</g>
<path d="M705 40h10"></path>
<path d="M 715 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path>
</g>
<style>
svg {
background-color: hsl(0,0%,100%);
}
path {
stroke-width: 2;
stroke: black;
fill: rgba(0,0,0,0);
}
text {
font: bold 14px monospace;
text-anchor: middle;
white-space: pre;
}
text.diagram-text {
font-size: 12px;
}
text.diagram-arrow {
font-size: 16px;
}
text.label {
text-anchor: start;
}
text.comment {
font: italic 12px monospace;
}
g.non-terminal text {
/&#42;font-style: italic;&#42;/
}
rect {
stroke-width: 2;
stroke: black;
fill: hsl(0,0%,100%);
}
rect.group-box {
stroke: gray;
stroke-dasharray: 10 5;
fill: none;
}
path.diagram-text {
stroke-width: 2;
stroke: black;
fill: white;
cursor: help;
}
g.diagram-text:hover path.diagram-text {
fill: #eee;
}</style>
</svg>
</div>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>ALTER TABLE IF EXISTS table ADD COLUMN IF NOT EXISTS (column1 int, column2 int)</strong></p>
</li>
</ul>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="p">[</span><span class="n">IF</span> <span class="k">EXISTS</span><span class="p">]</span> <span class="n">tableName</span> <span class="err">{</span><span class="k">ADD</span> <span class="p">[</span><span class="k">COLUMN</span><span class="p">]</span> <span class="err">{</span><span class="p">[</span><span class="n">IF</span> <span class="k">NOT</span> <span class="k">EXISTS</span><span class="p">]</span> <span class="p">(</span><span class="n">tableColumn</span> <span class="p">[</span><span class="n">column1</span> <span class="nb">int</span><span class="p">,</span> <span class="n">column2</span> <span class="nb">int</span><span class="p">])</span><span class="err">}</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>IF EXISTS</code> - if applied to <code>TABLE</code>, do not throw an error if a table with the specified table name does not exist. If applied to <code>COLUMN</code>, do not throw an error if a column with the specified name does not exist.</p>
</li>
<li>
<p><code>qualified_table_name</code> - the name of the table.</p>
</li>
<li>
<p><code>ADD</code> - adds a new column or several columns to a previously created table. Once a column is added, it can be accessed using <a href="/docs/3.0.0-alpha/sql-reference/dml" target="_blank" rel="noopener">DML commands</a> and indexed with the CREATE INDEX statement (currently not supported).</p>
</li>
<li>
<p><code>COLUMN</code> - name of the defined column.</p>
</li>
<li>
<p><code>IF NOT EXISTS</code> - do not throw an error if a column with the same name already exists.</p>
</li>
<li>
<p><code>column_definition_or_list</code> - the name of the column or the list of columns to be added.</p>
</li>
</ul>
</div>
<div class="imageblock">
<div class="content">
<svg class="railroad-diagram" width="625.5" height="82" viewBox="0 0 625.5 82" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g transform="translate(.5 .5)">
<g>
<path d="M20 21v20m10 -20v20m-10 -10h20"></path>
</g>
<path d="M40 31h10"></path>
<g>
<path d="M50 31h0"></path>
<path d="M575.5 31h0"></path>
<g class="terminal ">
<path d="M50 31h0"></path>
<path d="M163.5 31h0"></path>
<rect x="50" y="20" width="113.5" height="22" rx="10" ry="10"></rect>
<text x="106.75" y="35">ALTER TABLE</text>
</g>
<path d="M163.5 31h10"></path>
<g>
<path d="M173.5 31h0"></path>
<path d="M310 31h0"></path>
<path d="M173.5 31h20"></path>
<g>
<path d="M193.5 31h96.5"></path>
</g>
<path d="M290 31h20"></path>
<path d="M173.5 31a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<g class="terminal ">
<path d="M193.5 51h0"></path>
<path d="M290 51h0"></path>
<rect x="193.5" y="40" width="96.5" height="22" rx="10" ry="10"></rect>
<text x="241.75" y="55">IF EXISTS</text>
</g>
<path d="M290 51a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
</g>
<path d="M310 31h10"></path>
<a xlink:href="https://ignite.apache.org/docs/3.0.0-alpha/sql-reference/ddl#qualified_table_name">
<g class="non-terminal ">
<path d="M320 40h0"></path>
<path d="M510 40h0"></path>
<rect x="320" y="29" width="190" height="22"></rect>
<text x="415" y="44" fill="blue">qualified&#95;table&#95;name</text>
</g>
</a>
<path d="M510 31h10"></path>
<path d="M520 31h10"></path>
<g>
<path d="M530 31h0"></path>
<path d="M575.5 31h0"></path>
<g class="terminal ">
<path d="M530 31h0"></path>
<path d="M575.5 31h0"></path>
<rect x="530" y="20" width="45.5" height="22" rx="10" ry="10"></rect>
<text x="552.75" y="35">ADD</text>
</g>
</g>
</g>
<g fill="none" stroke="black" stroke-width="2">
<path stroke-dasharray="5,5" d="M581 32 l30 0" />
</g>
</g>
<style>
svg {
background-color: hsl(0,0%,100%);
}
path {
stroke-width: 2;
stroke: black;
fill: rgba(0,0,0,0);
}
text {
font: bold 14px monospace;
text-anchor: middle;
white-space: pre;
}
text.diagram-text {
font-size: 12px;
}
text.diagram-arrow {
font-size: 16px;
}
text.label {
text-anchor: start;
}
text.comment {
font: italic 12px monospace;
}
g.non-terminal text {
/&#42;font-style: italic;&#42;/
}
rect {
stroke-width: 2;
stroke: black;
fill: hsl(0,0%,100%);
}
rect.group-box {
stroke: gray;
stroke-dasharray: 10 5;
fill: none;
}
path.diagram-text {
stroke-width: 2;
stroke: black;
fill: white;
cursor: help;
}
g.diagram-text:hover path.diagram-text {
fill: #eee;
}</style>
</svg>
</div>
</div>
<div class="imageblock">
<div class="content">
<svg class="railroad-diagram" width="702.5" height="91" viewBox="0 0 702.5 91" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g transform="translate(.5 .5)">
<g fill="none" stroke="black" stroke-width="2">
<path stroke-dasharray="5,5" d="M11 40 l30 0" />
</g>
<path d="M40 40h10"></path>
<g>
<path d="M50 40h0"></path>
<path d="M652.5 40h0"></path>
<g>
<path d="M50 40h0"></path>
<path d="M574 40h0"></path>
<g>
<path d="M50 40h0"></path>
<path d="M161 40h0"></path>
<path d="M50 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M70 20h71"></path>
</g>
<path d="M141 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M50 40h20"></path>
<g class="terminal ">
<path d="M70 40h0"></path>
<path d="M141 40h0"></path>
<rect x="70" y="29" width="71" height="22" rx="10" ry="10"></rect>
<text x="105.5" y="44">COLUMN</text>
</g>
<path d="M141 40h20"></path>
</g>
<g>
<path d="M161 40h0"></path>
<path d="M331.5 40h0"></path>
<path d="M161 40h20"></path>
<g>
<path d="M181 40h130.5"></path>
</g>
<path d="M311.5 40h20"></path>
<path d="M161 40a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<g class="terminal ">
<path d="M181 60h0"></path>
<path d="M311.5 60h0"></path>
<rect x="181" y="49" width="130.5" height="22" rx="10" ry="10"></rect>
<text x="246.25" y="64">IF NOT EXISTS</text>
</g>
<path d="M311.5 60a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
</g>
<path d="M331.5 40h10"></path>
<a xlink:href="https://ignite.apache.org/docs/3.0.0-alpha/sql-reference/ddl#column_definition_or_list">
<g class="non-terminal ">
<path d="M341.5 40h0"></path>
<path d="M574 40h0"></path>
<rect x="341.5" y="29" width="232.5" height="22"></rect>
<text x="457.75" y="44" fill="blue">column&#95;definition&#95;or&#95;list</text>
</g>
</a>
</g>
<path d="M574 40h10"></path>
<g>
<path d="M584 40h0"></path>
<path d="M652.5 40h0"></path>
<path d="M584 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M604 20h28.5"></path>
</g>
<path d="M632.5 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M584 40h20"></path>
<g class="terminal ">
<path d="M604 40h0"></path>
<path d="M632.5 40h0"></path>
<rect x="604" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="618.25" y="44">;</text>
</g>
<path d="M632.5 40h20"></path>
</g>
</g>
<path d="M652.5 40h10"></path>
<path d="M 662.5 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path>
</g>
<style>
svg {
background-color: hsl(0,0%,100%);
}
path {
stroke-width: 2;
stroke: black;
fill: rgba(0,0,0,0);
}
text {
font: bold 14px monospace;
text-anchor: middle;
white-space: pre;
}
text.diagram-text {
font-size: 12px;
}
text.diagram-arrow {
font-size: 16px;
}
text.label {
text-anchor: start;
}
text.comment {
font: italic 12px monospace;
}
g.non-terminal text {
/&#42;font-style: italic;&#42;/
}
rect {
stroke-width: 2;
stroke: black;
fill: hsl(0,0%,100%);
}
rect.group-box {
stroke: gray;
stroke-dasharray: 10 5;
fill: none;
}
path.diagram-text {
stroke-width: ;
stroke: black;
fill: white;
cursor: help;
}
g.diagram-text:hover path.diagram-text {
fill: #eee;
}</style>
</svg>
</div>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>ALTER TABLE IF EXISTS table ADD COLUMN IF EXISTS (column1, column2 int)</strong></p>
</li>
</ul>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="p">[</span><span class="n">IF</span> <span class="k">EXISTS</span><span class="p">]</span> <span class="n">tableName</span> <span class="k">DROP</span> <span class="p">[</span><span class="k">COLUMN</span><span class="p">]</span> <span class="err">{</span><span class="p">[</span><span class="n">IF</span> <span class="k">EXISTS</span><span class="p">]</span> <span class="p">(</span><span class="n">columnName</span> <span class="p">[</span><span class="n">column1</span><span class="p">,</span> <span class="n">column2</span> <span class="nb">int</span><span class="p">])</span><span class="err">}</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>IF EXISTS</code> - if applied to <code>TABLE</code>, do not throw an error if a table with the specified table name does not exist. If applied to <code>COLUMN</code>, do not throw an error if a column with the specified name does not exist.</p>
</li>
<li>
<p><code>qualified_table_name</code> - the name of the table.</p>
</li>
<li>
<p><code>DROP</code> - removes an existing column or multiple columns from a table. Once a column is removed, it cannot be accessed within queries. Consider the following notes and limitations:</p>
</li>
<li>
<p><code>COLUMN</code> - name of the defined column.</p>
</li>
<li>
<p><code>column_list</code> - the name of the list of columns to be removed.</p>
</li>
</ul>
</div>
<div class="imageblock">
<div class="content">
<svg class="railroad-diagram" width="634" height="82" viewBox="0 0 634 82" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g transform="translate(.5 .5)">
<g>
<path d="M20 21v20m10 -20v20m-10 -10h20"></path>
</g>
<path d="M40 31h10"></path>
<g>
<path d="M50 31h0"></path>
<path d="M584 31h0"></path>
<g class="terminal ">
<path d="M50 31h0"></path>
<path d="M163.5 31h0"></path>
<rect x="50" y="20" width="113.5" height="22" rx="10" ry="10"></rect>
<text x="106.75" y="35">ALTER TABLE</text>
</g>
<path d="M163.5 31h10"></path>
<g>
<path d="M173.5 31h0"></path>
<path d="M310 31h0"></path>
<path d="M173.5 31h20"></path>
<g>
<path d="M193.5 31h96.5"></path>
</g>
<path d="M290 31h20"></path>
<path d="M173.5 31a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<g class="terminal ">
<path d="M193.5 51h0"></path>
<path d="M290 51h0"></path>
<rect x="193.5" y="40" width="96.5" height="22" rx="10" ry="10"></rect>
<text x="241.75" y="55">IF EXISTS</text>
</g>
<path d="M290 51a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
</g>
<path d="M310 31h10"></path>
<a xlink:href="https://ignite.apache.org/docs/3.0.0-alpha/sql-reference/ddl#qualified_table_name">
<g class="non-terminal ">
<path d="M320 40h0"></path>
<path d="M510 40h0"></path>
<rect x="320" y="29" width="190" height="22"></rect>
<text x="415" y="44" fill="blue">qualified&#95;table&#95;name</text>
</g>
</a>
<path d="M510 31h10"></path>
<path d="M520 31h10"></path>
<g>
<path d="M530 31h0"></path>
<path d="M584 31h0"></path>
<g class="terminal ">
<path d="M530 31h0"></path>
<path d="M584 31h0"></path>
<rect x="530" y="20" width="54" height="22" rx="10" ry="10"></rect>
<text x="557" y="35">DROP</text>
</g>
</g>
</g>
<g fill="none" stroke="black" stroke-width="2">
<path stroke-dasharray="5,5" d="M588 32 l30 0" />
</g>
</g>
<style>
svg {
background-color: hsl(0,0%,100%);
}
path {
stroke-width: 2;
stroke: black;
fill: rgba(0,0,0,0);
}
text {
font: bold 14px monospace;
text-anchor: middle;
white-space: pre;
}
text.diagram-text {
font-size: 12px;
}
text.diagram-arrow {
font-size: 16px;
}
text.label {
text-anchor: start;
}
text.comment {
font: italic 12px monospace;
}
g.non-terminal text {
/&#42;font-style: italic;&#42;/
}
rect {
stroke-width: 2;
stroke: black;
fill: hsl(0,0%,100%);
}
rect.group-box {
stroke: gray;
stroke-dasharray: 10 5;
fill: none;
}
path.diagram-text {
stroke-width: 2;
stroke: black;
fill: white;
cursor: help;
}
g.diagram-text:hover path.diagram-text {
fill: #eee;
}</style>
</svg>
</div>
</div>
<div class="imageblock">
<div class="content">
<svg class="railroad-diagram" width="549.5" height="91" viewBox="0 0 549.5 91" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g transform="translate(.5 .5)">
<g fill="none" stroke="black" stroke-width="2">
<path stroke-dasharray="5,5" d="M10 40 l30 0" />
</g>
<path d="M40 40h10"></path>
<g>
<path d="M50 40h0"></path>
<path d="M499.5 40h0"></path>
<g>
<path d="M50 40h0"></path>
<path d="M421 40h0"></path>
<g>
<path d="M50 40h0"></path>
<path d="M161 40h0"></path>
<path d="M50 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M70 20h71"></path>
</g>
<path d="M141 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M50 40h20"></path>
<g class="terminal ">
<path d="M70 40h0"></path>
<path d="M141 40h0"></path>
<rect x="70" y="29" width="71" height="22" rx="10" ry="10"></rect>
<text x="105.5" y="44">COLUMN</text>
</g>
<path d="M141 40h20"></path>
</g>
<g>
<path d="M161 40h0"></path>
<path d="M297.5 40h0"></path>
<path d="M161 40h20"></path>
<g>
<path d="M181 40h96.5"></path>
</g>
<path d="M277.5 40h20"></path>
<path d="M161 40a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<g class="terminal ">
<path d="M181 60h0"></path>
<path d="M277.5 60h0"></path>
<rect x="181" y="49" width="96.5" height="22" rx="10" ry="10"></rect>
<text x="229.25" y="64">IF EXISTS</text>
</g>
<path d="M277.5 60a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
</g>
<path d="M297.5 40h10"></path>
<a xlink:href="https://ignite.apache.org/docs/3.0.0-alpha/sql-reference/ddl#column_list">
<g class="non-terminal ">
<path d="M307.5 40h0"></path>
<path d="M421 40h0"></path>
<rect x="307.5" y="29" width="113.5" height="22"></rect>
<text x="364.25" y="44" fill="blue">column&#95;list</text>
</g>
</a>
</g>
<path d="M421 40h10"></path>
<g>
<path d="M431 40h0"></path>
<path d="M499.5 40h0"></path>
<path d="M431 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M451 20h28.5"></path>
</g>
<path d="M479.5 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M431 40h20"></path>
<g class="terminal ">
<path d="M451 40h0"></path>
<path d="M479.5 40h0"></path>
<rect x="451" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="465.25" y="44">;</text>
</g>
<path d="M479.5 40h20"></path>
</g>
</g>
<path d="M499.5 40h10"></path>
<path d="M 509.5 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path>
</g>
<style>
svg {
background-color: hsl(0,0%,100%);
}
path {
stroke-width: 2;
stroke: black;
fill: rgba(0,0,0,0);
}
text {
font: bold 14px monospace;
text-anchor: middle;
white-space: pre;
}
text.diagram-text {
font-size: 12px;
}
text.diagram-arrow {
font-size: 16px;
}
text.label {
text-anchor: start;
}
text.comment {
font: italic 12px monospace;
}
g.non-terminal text {
/&#42;font-style: italic;&#42;/
}
rect {
stroke-width: 2;
stroke: black;
fill: hsl(0,0%,100%);
}
rect.group-box {
stroke: gray;
stroke-dasharray: 10 5;
fill: none;
}
path.diagram-text {
stroke-width: 2;
stroke: black;
fill: white;
cursor: help;
}
g.diagram-text:hover path.diagram-text {
fill: #eee;
}</style>
</svg>
</div>
</div>
<div class="ulist">
<ul>
<li>
<p>The command does not remove actual data from the cluster which means that if the column 'name' is dropped, the value of the 'name' is still stored in the cluster. This limitation is to be addressed in the next releases.</p>
</li>
<li>
<p>If the column was indexed, the index has to be dropped manually using the 'DROP INDEX' command.</p>
</li>
<li>
<p>It is not possible to remove a column that is a primary key or a part of such a key.</p>
</li>
<li>
<p>It is not possible to remove a column if it represents the whole value stored in the cluster. The limitation is relevant for primitive values.
Ignite stores data in the form of key-value pairs and all the new columns will belong to the value. It&#8217;s not possible to change a set of columns of the key (<code>PRIMARY KEY</code>).</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Both DDL and DML commands targeting the same table are blocked for a short time until <code>ALTER TABLE</code> is in progress.</p>
</div>
<div class="paragraph">
<p>Schema changes applied by this command are persisted on disk if <a href="https://ignite.apache.org/docs/3.0.0-alpha/persistence" target="_blank" rel="noopener">persistence</a> is enabled. Thus, the changes can survive full cluster restarts.</p>
</div>
<div class="paragraph">
<p>Examples:</p>
</div>
<div class="paragraph">
<p>Add a column to the table:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">Person</span> <span class="k">ADD</span> <span class="k">COLUMN</span> <span class="n">city</span> <span class="nb">varchar</span><span class="p">;</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Add a new column to the table only if a column with the same name does not exist:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">City</span> <span class="k">ADD</span> <span class="k">COLUMN</span> <span class="n">IF</span> <span class="k">NOT</span> <span class="k">EXISTS</span> <span class="n">population</span> <span class="nb">int</span><span class="p">;</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Add a column​ only if the table exists:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">IF</span> <span class="k">EXISTS</span> <span class="n">Missing</span> <span class="k">ADD</span> <span class="n">number</span> <span class="n">long</span><span class="p">;</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Add several columns to the table at once:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">Region</span> <span class="k">ADD</span> <span class="k">COLUMN</span> <span class="p">(</span><span class="n">code</span> <span class="nb">varchar</span><span class="p">,</span> <span class="n">gdp</span> <span class="nb">double</span><span class="p">);</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Drop a column from the table:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">Person</span> <span class="k">DROP</span> <span class="k">COLUMN</span> <span class="n">city</span><span class="p">;</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Drop a column from the table only if a column with the same name does exist:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">Person</span> <span class="k">DROP</span> <span class="k">COLUMN</span> <span class="n">IF</span> <span class="k">EXISTS</span> <span class="n">population</span><span class="p">;</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Drop a column only if the table exists:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">IF</span> <span class="k">EXISTS</span> <span class="n">Person</span> <span class="k">DROP</span> <span class="k">COLUMN</span> <span class="n">number</span><span class="p">;</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Drop several columns from the table at once:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">Person</span> <span class="k">DROP</span> <span class="k">COLUMN</span> <span class="p">(</span><span class="n">code</span><span class="p">,</span> <span class="n">gdp</span><span class="p">);</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Disable write-ahead logging:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">Person</span> <span class="n">NOLOGGING</span></code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="drop-table">DROP TABLE</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The <code>DROP TABLE</code> command drops an existing table.
The underlying cache with all the data in it is destroyed, too.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">DROP</span> <span class="k">TABLE</span> <span class="p">[</span><span class="n">IF</span> <span class="k">EXISTS</span><span class="p">]</span> <span class="n">tableName</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>tableName</code> - the name of the table.</p>
</li>
<li>
<p><code>IF NOT EXISTS</code> - do not throw an error if a table with the same name does not exist.</p>
</li>
</ul>
</div>
<div class="imageblock">
<div class="content">
<svg class="railroad-diagram" width="630" height="91" viewBox="0 0 630 91" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g transform="translate(.5 .5)">
<g>
<path d="M20 30v20m10 -20v20m-10 -10h20"></path>
</g>
<path d="M40 40h10"></path>
<g>
<path d="M50 40h0"></path>
<path d="M580 40h0"></path>
<g class="terminal ">
<path d="M50 40h0"></path>
<path d="M155 40h0"></path>
<rect x="50" y="29" width="105" height="22" rx="10" ry="10"></rect>
<text x="102.5" y="44">DROP TABLE</text>
</g>
<path d="M155 40h10"></path>
<g>
<path d="M165 40h0"></path>
<path d="M301.5 40h0"></path>
<path d="M165 40h20"></path>
<g>
<path d="M185 40h96.5"></path>
</g>
<path d="M281.5 40h20"></path>
<path d="M165 40a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<g class="terminal ">
<path d="M185 60h0"></path>
<path d="M281.5 60h0"></path>
<rect x="185" y="49" width="96.5" height="22" rx="10" ry="10"></rect>
<text x="233.25" y="64">IF EXISTS</text>
</g>
<path d="M281.5 60a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
</g>
<path d="M301.5 40h10"></path>
<a xlink:href="https://ignite.apache.org/docs/3.0.0-alpha/sql-reference/ddl#qualified_table_name">
<g class="non-terminal ">
<path d="M311.5 40h0"></path>
<path d="M501.5 40h0"></path>
<rect x="311.5" y="29" width="190" height="22"></rect>
<text x="406.5" y="44" fill="blue">qualified&#95;table&#95;name</text>
</g>
</a>
<path d="M501.5 40h10"></path>
<g>
<path d="M511.5 40h0"></path>
<path d="M580 40h0"></path>
<path d="M511.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M531.5 20h28.5"></path>
</g>
<path d="M560 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M511.5 40h20"></path>
<g class="terminal ">
<path d="M531.5 40h0"></path>
<path d="M560 40h0"></path>
<rect x="531.5" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="545.75" y="44">;</text>
</g>
<path d="M560 40h20"></path>
</g>
</g>
<path d="M580 40h10"></path>
<path d="M 590 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path>
</g>
<style>
svg {
background-color: hsl(0,0%,100%);
}
path {
stroke-width: 2;
stroke: black;
fill: rgba(0,0,0,0);
}
text {
font: bold 14px monospace;
text-anchor: middle;
white-space: pre;
}
text.diagram-text {
font-size: 12px;
}
text.diagram-arrow {
font-size: 16px;
}
text.label {
text-anchor: start;
}
text.comment {
font: italic 12px monospace;
}
g.non-terminal text {
/&#42;font-style: italic;&#42;/
}
rect {
stroke-width: 2;
stroke: black;
fill: hsl(0,0%,100%);
}
rect.group-box {
stroke: gray;
stroke-dasharray: 10 5;
fill: none;
}
path.diagram-text {
stroke-width: 2;
stroke: black;
fill: white;
cursor: help;
}
g.diagram-text:hover path.diagram-text {
fill: #eee;
}</style>
</svg>
</div>
</div>
<div class="paragraph">
<p>Both DDL and DML commands targeting the same table are blocked while the <code>DROP TABLE</code> is in progress.
Once the table is dropped, all pending commands will fail with appropriate errors.</p>
</div>
<div class="paragraph">
<p>Schema changes applied by this command are persisted on disk if <a href="https://ignite.apache.org/docs/3.0.0-alpha/persistence" target="_blank" rel="noopener">persistence</a> is enabled. Thus, the changes can survive full cluster restarts.</p>
</div>
<div class="paragraph">
<p>Examples:</p>
</div>
<div class="paragraph">
<p>Drop Person table if the one exists:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">DROP</span> <span class="k">TABLE</span> <span class="n">IF</span> <span class="k">EXISTS</span> <span class="nv">"Person"</span><span class="p">;</span></code></pre>
</div>
</div>
</div>
</div>
<h1 id="grammar-reference" class="sect0">Grammar Reference</h1>
<div class="sect1">
<h2 id="column_definition_or_list">column_definition_or_list</h2>
<div class="sectionbody">
<div class="imageblock">
<div class="content">
<svg class="railroad-diagram" width="527" height="133" viewBox="0 0 527 133" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g transform="translate(.5 .5)">
<g>
<path d="M20 54v20m0 -10h20"></path>
</g>
<path d="M40 64h10"></path>
<g>
<path d="M50 64h0"></path>
<path d="M477 64h0"></path>
<rect x="50" y="36" width="427" height="77" rx="10" ry="10" class="group-box"></rect>
<g>
<path d="M50 64h10"></path>
<path d="M467 64h10"></path>
<g>
<path d="M60 64h0"></path>
<path d="M128.5 64h0"></path>
<path d="M60 64a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M80 44h28.5"></path>
</g>
<path d="M108.5 44a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M60 64h20"></path>
<g class="terminal ">
<path d="M80 64h0"></path>
<path d="M108.5 64h0"></path>
<rect x="80" y="53" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="94.25" y="68">(</text>
</g>
<path d="M108.5 64h20"></path>
</g>
<path d="M128.5 64h10"></path>
<g>
<path d="M138.5 64h0"></path>
<path d="M388.5 64h0"></path>
<path d="M138.5 64h10"></path>
<g>
<path d="M148.5 64h0"></path>
<path d="M378.5 64h0"></path>
<g class="non-terminal ">
<path d="M148.5 64h0"></path>
<path d="M262 64h0"></path>
<rect x="148.5" y="53" width="113.5" height="22"></rect>
<text x="205.25" y="68">column&#95;name</text>
</g>
<path d="M262 64h10"></path>
<path d="M272 64h10"></path>
<g class="non-terminal ">
<path d="M282 64h0"></path>
<path d="M378.5 64h0"></path>
<rect x="282" y="53" width="96.5" height="22"></rect>
<text x="330.25" y="68">data&#95;type</text>
</g>
</g>
<path d="M378.5 64h10"></path>
<path d="M148.5 64a10 10 0 0 0 -10 10v10a10 10 0 0 0 10 10"></path>
<g class="terminal ">
<path d="M148.5 94h100.75"></path>
<path d="M277.75 94h100.75"></path>
<rect x="249.25" y="83" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="263.5" y="98">,</text>
</g>
<path d="M378.5 94a10 10 0 0 0 10 -10v-10a10 10 0 0 0 -10 -10"></path>
</g>
<path d="M388.5 64h10"></path>
<g>
<path d="M398.5 64h0"></path>
<path d="M467 64h0"></path>
<path d="M398.5 64a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M418.5 44h28.5"></path>
</g>
<path d="M447 44a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M398.5 64h20"></path>
<g class="terminal ">
<path d="M418.5 64h0"></path>
<path d="M447 64h0"></path>
<rect x="418.5" y="53" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="432.75" y="68">)</text>
</g>
<path d="M447 64h20"></path>
</g>
</g>
<g class="comment ">
<path d="M50 28h0"></path>
<path d="M235 28h0"></path>
<text x="142.5" y="25" class="comment">column&#95;definition&#95;or&#95;list</text>
</g>
</g>
<path d="M477 64h10"></path>
<path d="M 487 64 h 20 m 0 -10 v 20"></path>
</g>
<style>
svg {
background-color: hsl(0,0%,100%);
}
path {
stroke-width: 2;
stroke: black;
fill: rgba(0,0,0,0);
}
text {
font: bold 14px monospace;
text-anchor: middle;
white-space: pre;
}
text.diagram-text {
font-size: 12px;
}
text.diagram-arrow {
font-size: 16px;
}
text.label {
text-anchor: start;
}
text.comment {
font: italic 12px monospace;
}
g.non-terminal text {
/&#42;font-style: italic;&#42;/
}
rect {
stroke-width: 2;
stroke: black;
fill: hsl(0,0%,100%);
}
rect.group-box {
stroke: gray;
stroke-dasharray: 10 5;
fill: none;
}
path.diagram-text {
stroke-width: 2;
stroke: black;
fill: white;
cursor: help;
}
g.diagram-text:hover path.diagram-text {
fill: #eee;
}</style>
</svg>
</div>
</div>
<div class="paragraph">
<p>Referenced by:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="/docs/3.0.0-alpha/sql-reference/ddl#alter-table">ALTER TABLE</a></p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="column_definition">column_definition</h2>
<div class="sectionbody">
<div class="imageblock">
<div class="content">
<svg class="railroad-diagram" width="912" height="111" viewBox="0 0 912 111" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g transform="translate(.5 .5)">
<g>
<path d="M20 62v20m0 -10h20"></path>
</g>
<path d="M40 72h10"></path>
<g>
<path d="M50 72h0"></path>
<path d="M862 72h0"></path>
<rect x="50" y="36" width="812" height="55" rx="10" ry="10" class="group-box"></rect>
<g>
<path d="M50 72h10"></path>
<path d="M852 72h10"></path>
<g class="non-terminal ">
<path d="M60 72h0"></path>
<path d="M168 72h0"></path>
<rect x="60" y="61" width="108" height="22"></rect>
<text x="114" y="76">column&#95;name</text>
</g>
<path d="M168 72h10"></path>
<path d="M178 72h10"></path>
<g class="terminal ">
<path d="M188 72h0"></path>
<path d="M280 72h0"></path>
<rect x="188" y="61" width="92" height="22" rx="10" ry="10"></rect>
<text x="234" y="76">DATA TYPE</text>
</g>
<path d="M280 72h10"></path>
<g>
<path d="M290 72h0"></path>
<path d="M476 72h0"></path>
<path d="M290 72a10 10 0 0 0 10 -10v-8a10 10 0 0 1 10 -10"></path>
<g>
<path d="M310 44h146"></path>
</g>
<path d="M456 44a10 10 0 0 1 10 10v8a10 10 0 0 0 10 10"></path>
<path d="M290 72h20"></path>
<g>
<path d="M310 72h0"></path>
<path d="M456 72h0"></path>
<g>
<path d="M310 72h0"></path>
<path d="M394 72h0"></path>
<path d="M310 72a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M330 52h44"></path>
</g>
<path d="M374 52a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M310 72h20"></path>
<g class="terminal ">
<path d="M330 72h0"></path>
<path d="M374 72h0"></path>
<rect x="330" y="61" width="44" height="22" rx="10" ry="10"></rect>
<text x="352" y="76">NOT</text>
</g>
<path d="M374 72h20"></path>
</g>
<path d="M394 72h10"></path>
<g class="terminal ">
<path d="M404 72h0"></path>
<path d="M456 72h0"></path>
<rect x="404" y="61" width="52" height="22" rx="10" ry="10"></rect>
<text x="430" y="76">NULL</text>
</g>
</g>
<path d="M456 72h20"></path>
</g>
<g>
<path d="M476 72h0"></path>
<path d="M736 72h0"></path>
<path d="M476 72a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M496 52h220"></path>
</g>
<path d="M716 52a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M476 72h20"></path>
<g>
<path d="M496 72h0"></path>
<path d="M716 72h0"></path>
<g class="terminal ">
<path d="M496 72h0"></path>
<path d="M572 72h0"></path>
<rect x="496" y="61" width="76" height="22" rx="10" ry="10"></rect>
<text x="534" y="76">DEFAULT</text>
</g>
<path d="M572 72h10"></path>
<path d="M582 72h10"></path>
<g class="non-terminal ">
<path d="M592 72h0"></path>
<path d="M716 72h0"></path>
<rect x="592" y="61" width="124" height="22"></rect>
<text x="654" y="76">literal&#95;value</text>
</g>
</g>
<path d="M716 72h20"></path>
</g>
<g>
<path d="M736 72h0"></path>
<path d="M852 72h0"></path>
<path d="M736 72a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M756 52h76"></path>
</g>
<path d="M832 52a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M736 72h20"></path>
<g class="terminal ">
<path d="M756 72h0"></path>
<path d="M832 72h0"></path>
<rect x="756" y="61" width="76" height="22" rx="10" ry="10"></rect>
<text x="794" y="76">PRIMARY</text>
</g>
<path d="M832 72h20"></path>
</g>
</g>
<g class="comment ">
<path d="M50 28h0"></path>
<path d="M179 28h0"></path>
<text x="114.5" y="25" class="comment">column&#95;definition</text>
</g>
</g>
<path d="M862 72h10"></path>
<path d="M 872 72 h 20 m 0 -10 v 20"></path>
</g>
<style>
svg {
background-color: hsl(0,0%,100%);
}
path {
stroke-width: 2;
stroke: black;
fill: rgba(0,0,0,0);
}
text {
font: bold 14px monospace;
text-anchor: middle;
white-space: pre;
}
text.diagram-text {
font-size: 12px;
}
text.diagram-arrow {
font-size: 16px;
}
text.label {
text-anchor: start;
}
text.comment {
font: italic 12px monospace;
}
g.non-terminal text {
/&#42;font-style: italic;&#42;/
}
rect {
stroke-width: 2;
stroke: black;
fill: hsl(0,0%,100%);
}
rect.group-box {
stroke: gray;
stroke-dasharray: 10 5;
fill: none;
}
path.diagram-text {
stroke-width: 2;
stroke: black;
fill: white;
cursor: help;
}
g.diagram-text:hover path.diagram-text {
fill: #eee;
}</style>
</svg>
</div>
</div>
<div class="paragraph">
<p>Referenced by:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="/docs/3.0.0-alpha/sql-reference/ddl#create-table">CREATE TABLE</a></p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="column_list">column_list</h2>
<div class="sectionbody">
<div class="imageblock">
<div class="content">
<svg class="railroad-diagram" width="410.5" height="133" viewBox="0 0 410.5 133" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g transform="translate(.5 .5)">
<g>
<path d="M20 54v20m0 -10h20"></path>
</g>
<path d="M40 64h10"></path>
<g>
<path d="M50 64h0"></path>
<path d="M360.5 64h0"></path>
<rect x="50" y="36" width="310.5" height="77" rx="10" ry="10" class="group-box"></rect>
<g>
<path d="M50 64h10"></path>
<path d="M350.5 64h10"></path>
<g>
<path d="M60 64h0"></path>
<path d="M128.5 64h0"></path>
<path d="M60 64a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M80 44h28.5"></path>
</g>
<path d="M108.5 44a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M60 64h20"></path>
<g class="terminal ">
<path d="M80 64h0"></path>
<path d="M108.5 64h0"></path>
<rect x="80" y="53" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="94.25" y="68">(</text>
</g>
<path d="M108.5 64h20"></path>
</g>
<path d="M128.5 64h10"></path>
<g>
<path d="M138.5 64h0"></path>
<path d="M272 64h0"></path>
<path d="M138.5 64h10"></path>
<g class="non-terminal ">
<path d="M148.5 64h0"></path>
<path d="M262 64h0"></path>
<rect x="148.5" y="53" width="113.5" height="22"></rect>
<text x="205.25" y="68">column&#95;name</text>
</g>
<path d="M262 64h10"></path>
<path d="M148.5 64a10 10 0 0 0 -10 10v10a10 10 0 0 0 10 10"></path>
<g class="terminal ">
<path d="M148.5 94h42.5"></path>
<path d="M219.5 94h42.5"></path>
<rect x="191" y="83" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="205.25" y="98">,</text>
</g>
<path d="M262 94a10 10 0 0 0 10 -10v-10a10 10 0 0 0 -10 -10"></path>
</g>
<path d="M272 64h10"></path>
<g>
<path d="M282 64h0"></path>
<path d="M350.5 64h0"></path>
<path d="M282 64a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M302 44h28.5"></path>
</g>
<path d="M330.5 44a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M282 64h20"></path>
<g class="terminal ">
<path d="M302 64h0"></path>
<path d="M330.5 64h0"></path>
<rect x="302" y="53" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="316.25" y="68">)</text>
</g>
<path d="M330.5 64h20"></path>
</g>
</g>
<g class="comment ">
<path d="M50 28h0"></path>
<path d="M137 28h0"></path>
<text x="93.5" y="25" class="comment">column&#95;list</text>
</g>
</g>
<path d="M360.5 64h10"></path>
<path d="M 370.5 64 h 20 m 0 -10 v 20"></path>
</g>
<style>
svg {
background-color: hsl(0,0%,100%);
}
path {
stroke-width: 2;
stroke: black;
fill: rgba(0,0,0,0);
}
text {
font: bold 14px monospace;
text-anchor: middle;
white-space: pre;
}
text.diagram-text {
font-size: 12px;
}
text.diagram-arrow {
font-size: 16px;
}
text.label {
text-anchor: start;
}
text.comment {
font: italic 12px monospace;
}
g.non-terminal text {
/&#42;font-style: italic;&#42;/
}
rect {
stroke-width: 2;
stroke: black;
fill: hsl(0,0%,100%);
}
rect.group-box {
stroke: gray;
stroke-dasharray: 10 5;
fill: none;
}
path.diagram-text {
stroke-width: 2;
stroke: black;
fill: white;
cursor: help;
}
g.diagram-text:hover path.diagram-text {
fill: #eee;
}</style>
</svg>
</div>
</div>
<div class="paragraph">
<p>Referenced by:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="/docs/3.0.0-alpha/sql-reference/ddl#alter-table">ALTER TABLE</a></p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="constraint">constraint</h2>
<div class="sectionbody">
<div class="imageblock">
<div class="content">
<svg class="railroad-diagram" width="782" height="133" viewBox="0 0 782 133" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g transform="translate(.5 .5)">
<g>
<path d="M20 54v20m0 -10h20"></path>
</g>
<path d="M40 64h10"></path>
<g>
<path d="M50 64h0"></path>
<path d="M732 64h0"></path>
<rect x="50" y="36" width="682" height="77" rx="10" ry="10" class="group-box"></rect>
<g>
<path d="M50 64h10"></path>
<path d="M722 64h10"></path>
<g>
<path d="M60 64h0"></path>
<path d="M360 64h0"></path>
<path d="M60 64a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M80 44h260"></path>
</g>
<path d="M340 44a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M60 64h20"></path>
<g>
<path d="M80 64h0"></path>
<path d="M340 64h0"></path>
<g class="terminal ">
<path d="M80 64h0"></path>
<path d="M180 64h0"></path>
<rect x="80" y="53" width="100" height="22" rx="10" ry="10"></rect>
<text x="130" y="68">CONSTRAINT</text>
</g>
<path d="M180 64h10"></path>
<path d="M190 64h10"></path>
<g class="non-terminal ">
<path d="M200 64h0"></path>
<path d="M340 64h0"></path>
<rect x="200" y="53" width="140" height="22"></rect>
<text x="270" y="68">constraint&#95;name</text>
</g>
</g>
<path d="M340 64h20"></path>
</g>
<path d="M360 64h10"></path>
<g class="terminal ">
<path d="M370 64h0"></path>
<path d="M478 64h0"></path>
<rect x="370" y="53" width="108" height="22" rx="10" ry="10"></rect>
<text x="424" y="68">PRIMARY KEY</text>
</g>
<path d="M478 64h10"></path>
<path d="M488 64h10"></path>
<g class="terminal ">
<path d="M498 64h0"></path>
<path d="M526 64h0"></path>
<rect x="498" y="53" width="28" height="22" rx="10" ry="10"></rect>
<text x="512" y="68">(</text>
</g>
<path d="M526 64h10"></path>
<path d="M536 64h10"></path>
<g>
<path d="M546 64h0"></path>
<path d="M674 64h0"></path>
<path d="M546 64h10"></path>
<g class="non-terminal ">
<path d="M556 64h0"></path>
<path d="M664 64h0"></path>
<rect x="556" y="53" width="108" height="22"></rect>
<text x="610" y="68">column&#95;name</text>
</g>
<path d="M664 64h10"></path>
<path d="M556 64a10 10 0 0 0 -10 10v10a10 10 0 0 0 10 10"></path>
<g class="terminal ">
<path d="M556 94h40"></path>
<path d="M624 94h40"></path>
<rect x="596" y="83" width="28" height="22" rx="10" ry="10"></rect>
<text x="610" y="98">,</text>
</g>
<path d="M664 94a10 10 0 0 0 10 -10v-10a10 10 0 0 0 -10 -10"></path>
</g>
<path d="M674 64h10"></path>
<path d="M684 64h10"></path>
<g class="terminal ">
<path d="M694 64h0"></path>
<path d="M722 64h0"></path>
<rect x="694" y="53" width="28" height="22" rx="10" ry="10"></rect>
<text x="708" y="68">)</text>
</g>
</g>
<g class="comment ">
<path d="M50 28h0"></path>
<path d="M130 28h0"></path>
<text x="90" y="25" class="comment">constraint</text>
</g>
</g>
<path d="M732 64h10"></path>
<path d="M 742 64 h 20 m 0 -10 v 20"></path>
</g>
<style>
svg {
background-color: hsl(0,0%,100%);
}
path {
stroke-width: 2;
stroke: black;
fill: rgba(0,0,0,0);
}
text {
font: bold 14px monospace;
text-anchor: middle;
white-space: pre;
}
text.diagram-text {
font-size: 12px;
}
text.diagram-arrow {
font-size: 16px;
}
text.label {
text-anchor: start;
}
text.comment {
font: italic 12px monospace;
}
g.non-terminal text {
/&#42;font-style: italic;&#42;/
}
rect {
stroke-width: 2;
stroke: black;
fill: hsl(0,0%,100%);
}
rect.group-box {
stroke: gray;
stroke-dasharray: 10 5;
fill: none;
}
path.diagram-text {
stroke-width: 2;
stroke: black;
fill: white;
cursor: help;
}
g.diagram-text:hover path.diagram-text {
fill: #eee;
}</style>
</svg>
</div>
</div>
<div class="paragraph">
<p>Referenced by:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="/docs/3.0.0-alpha/sql-reference/ddl#create-table">CREATE TABLE</a></p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="qualified_table_name">qualified_table_name</h2>
<div class="sectionbody">
<div class="imageblock">
<div class="content">
<svg class="railroad-diagram" width="394.5" height="114" viewBox="0 0 394.5 114" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g transform="translate(.5 .5)">
<g>
<path d="M20 45v20m0 -10h20"></path>
</g>
<path d="M40 55h10"></path>
<g>
<path d="M50 55h0"></path>
<path d="M344.5 55h0"></path>
<rect x="50" y="36" width="294.5" height="58" rx="10" ry="10" class="group-box"></rect>
<g>
<path d="M50 55h10"></path>
<path d="M334.5 55h10"></path>
<g>
<path d="M60 55h0"></path>
<path d="M219.5 55h0"></path>
<path d="M60 55h20"></path>
<g>
<path d="M80 55h119.5"></path>
</g>
<path d="M199.5 55h20"></path>
<path d="M60 55a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<g>
<path d="M80 75h0"></path>
<path d="M199.5 75h0"></path>
<g class="non-terminal ">
<path d="M80 75h0"></path>
<path d="M151 75h0"></path>
<rect x="80" y="64" width="71" height="22"></rect>
<text x="115.5" y="79">schema</text>
</g>
<path d="M151 75h10"></path>
<path d="M161 75h10"></path>
<g class="terminal ">
<path d="M171 75h0"></path>
<path d="M199.5 75h0"></path>
<rect x="171" y="64" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="185.25" y="79">.</text>
</g>
</g>
<path d="M199.5 75a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
</g>
<path d="M219.5 55h10"></path>
<g class="non-terminal ">
<path d="M229.5 55h0"></path>
<path d="M334.5 55h0"></path>
<rect x="229.5" y="44" width="105" height="22"></rect>
<text x="282" y="59">table&#95;name</text>
</g>
</g>
<g class="comment ">
<path d="M50 28h0"></path>
<path d="M200 28h0"></path>
<text x="125" y="25" class="comment">qualified&#95;table&#95;name</text>
</g>
</g>
<path d="M344.5 55h10"></path>
<path d="M 354.5 55 h 20 m 0 -10 v 20"></path>
</g>
<style>
svg {
background-color: hsl(0,0%,100%);
}
path {
stroke-width: 2;
stroke: black;
fill: rgba(0,0,0,0);
}
text {
font: bold 14px monospace;
text-anchor: middle;
white-space: pre;
}
text.diagram-text {
font-size: 12px;
}
text.diagram-arrow {
font-size: 16px;
}
text.label {
text-anchor: start;
}
text.comment {
font: italic 12px monospace;
}
g.non-terminal text {
/&#42;font-style: italic;&#42;/
}
rect {
stroke-width: 2;
stroke: black;
fill: hsl(0,0%,100%);
}
rect.group-box {
stroke: gray;
stroke-dasharray: 10 5;
fill: none;
}
path.diagram-text {
stroke-width: 2;
stroke: black;
fill: white;
cursor: help;
}
g.diagram-text:hover path.diagram-text {
fill: #ffa500;
}</style>
</svg>
</div>
</div>
<div class="paragraph">
<p>Referenced by:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="/docs/3.0.0-alpha/sql-reference/ddl#сreate-table">CREATE TABLE</a></p>
</li>
<li>
<p><a href="/docs/3.0.0-alpha/sql-reference/ddl#alter-table">ALTER TABLE</a></p>
</li>
<li>
<p><a href="/docs/3.0.0-alpha/sql-reference/ddl#drop-table">DROP TABLE</a></p>
</li>
</ul>
</div>
</div>
</div>
<div class="copyright">
© 2022 The Apache Software Foundation.<br/>
Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are either registered trademarks or trademarks of The Apache Software Foundation.
</div>
</article>
<nav class="right-nav" data-swiftype-index='false'>
<div class="toc-wrapper">
<ul class="sectlevel1">
<li><a href="#create-table">CREATE TABLE</a></li>
<li><a href="#alter-table">ALTER TABLE</a></li>
<li><a href="#drop-table">DROP TABLE</a></li>
<li><a href="#grammar-reference">Grammar Reference</a>
<ul class="sectlevel1">
<li><a href="#column_definition_or_list">column_definition_or_list</a></li>
<li><a href="#column_definition">column_definition</a></li>
<li><a href="#column_list">column_list</a></li>
<li><a href="#constraint">constraint</a></li>
<li><a href="#qualified_table_name">qualified_table_name</a></li>
</ul>
</li>
</ul>
</div>
<nav class="promo-nav">
<!--#include virtual="/includes/docs_rightnav_promotion.html" -->
<a href="#" data-trigger-bugyard-feedback="true" id="doc-feedback-btn">Docs Feedback</a>
</nav>
</nav>
</section>
<script type='module' src='/assets/js/code-copy-to-clipboard.js' async crossorigin></script>
<script>
// inits deep anchors -- needs to be done here because of https://www.bryanbraun.com/anchorjs/#dont-run-it-too-late
anchors.add('.page-docs h1, .page-docs h2, .page-docs h3:not(.discrete), .page-docs h4, .page-docs h5');
anchors.options = {
placement: 'right',
visible: 'always'
};
</script>
<script src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
<script>
docsearch({
// Your apiKey and indexName will be given to you once
// we create your config
apiKey: '3eee686c0ebe39eff3baeb18c56fa5f8',
indexName: 'apache_ignite',
// Replace inputSelector with a CSS selector
// matching your search input
inputSelector: '#search-input',
// algoliaOptions: { 'facetFilters': ["version:$VERSION"] },
// Set debug to true to inspect the dropdown
debug: false,
});
</script>
<script type='module' src='/assets/js/index.js?1655236595' async crossorigin></script>
<script type='module' src='/assets/js/versioning.js?1655236595' async crossorigin></script>
<link rel="stylesheet" href="/assets/css/styles.css?1655236595" media="print" onload="this.media='all'">
<noscript><link media="all" rel="stylesheet" href="/assets/css/styles.css?1655236595"></noscript>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" media="print" onload="this.media='all'">
<noscript><link media="all" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css"></noscript>
</body>
</html>