diff options
Diffstat (limited to 'docs/sqlglot/dialects/teradata.html')
-rw-r--r-- | docs/sqlglot/dialects/teradata.html | 1171 |
1 files changed, 620 insertions, 551 deletions
diff --git a/docs/sqlglot/dialects/teradata.html b/docs/sqlglot/dialects/teradata.html index fd9bc5a..1f06255 100644 --- a/docs/sqlglot/dialects/teradata.html +++ b/docs/sqlglot/dialects/teradata.html @@ -3,14 +3,14 @@ <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> - <meta name="generator" content="pdoc 14.0.0"/> + <meta name="generator" content="pdoc 14.1.0"/> <title>sqlglot.dialects.teradata API documentation</title> <style>/*! * Bootstrap Reboot v5.0.0 (https://getbootstrap.com/) * Copyright 2011-2021 The Bootstrap Authors * Copyright 2011-2021 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) */*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}hr{margin:1rem 0;color:inherit;background-color:currentColor;border:0;opacity:.25}hr:not([size]){height:1px}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){h1{font-size:2.5rem}}h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){h2{font-size:2rem}}h3{font-size:calc(1.3rem + .6vw)}@media (min-width:1200px){h3{font-size:1.75rem}}h4{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){h4{font-size:1.5rem}}h5{font-size:1.25rem}h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[data-bs-original-title],abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-left:2rem}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:.875em}mark{padding:.2em;background-color:#fcf8e3}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#0d6efd;text-decoration:underline}a:hover{color:#0a58ca}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em;direction:ltr;unicode-bidi:bidi-override}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:.875em}pre code{font-size:inherit;color:inherit;word-break:normal}code{font-size:.875em;color:#d63384;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:.875em;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:1em;font-weight:700}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:#6c757d;text-align:left}th{text-align:inherit;text-align:-webkit-match-parent}tbody,td,tfoot,th,thead,tr{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]::-webkit-calendar-picker-indicator{display:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:left;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + .3vw);line-height:inherit}@media (min-width:1200px){legend{font-size:1.5rem}}legend+*{clear:left}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:textfield}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important}</style> <style>/*! syntax-highlighting.css */pre{line-height:125%;}span.linenos{color:inherit; background-color:transparent; padding-left:5px; padding-right:20px;}.pdoc-code .hll{background-color:#ffffcc}.pdoc-code{background:#f8f8f8;}.pdoc-code .c{color:#3D7B7B; font-style:italic}.pdoc-code .err{border:1px solid #FF0000}.pdoc-code .k{color:#008000; font-weight:bold}.pdoc-code .o{color:#666666}.pdoc-code .ch{color:#3D7B7B; font-style:italic}.pdoc-code .cm{color:#3D7B7B; font-style:italic}.pdoc-code .cp{color:#9C6500}.pdoc-code .cpf{color:#3D7B7B; font-style:italic}.pdoc-code .c1{color:#3D7B7B; font-style:italic}.pdoc-code .cs{color:#3D7B7B; font-style:italic}.pdoc-code .gd{color:#A00000}.pdoc-code .ge{font-style:italic}.pdoc-code .gr{color:#E40000}.pdoc-code .gh{color:#000080; font-weight:bold}.pdoc-code .gi{color:#008400}.pdoc-code .go{color:#717171}.pdoc-code .gp{color:#000080; font-weight:bold}.pdoc-code .gs{font-weight:bold}.pdoc-code .gu{color:#800080; font-weight:bold}.pdoc-code .gt{color:#0044DD}.pdoc-code .kc{color:#008000; font-weight:bold}.pdoc-code .kd{color:#008000; font-weight:bold}.pdoc-code .kn{color:#008000; font-weight:bold}.pdoc-code .kp{color:#008000}.pdoc-code .kr{color:#008000; font-weight:bold}.pdoc-code .kt{color:#B00040}.pdoc-code .m{color:#666666}.pdoc-code .s{color:#BA2121}.pdoc-code .na{color:#687822}.pdoc-code .nb{color:#008000}.pdoc-code .nc{color:#0000FF; font-weight:bold}.pdoc-code .no{color:#880000}.pdoc-code .nd{color:#AA22FF}.pdoc-code .ni{color:#717171; font-weight:bold}.pdoc-code .ne{color:#CB3F38; font-weight:bold}.pdoc-code .nf{color:#0000FF}.pdoc-code .nl{color:#767600}.pdoc-code .nn{color:#0000FF; font-weight:bold}.pdoc-code .nt{color:#008000; font-weight:bold}.pdoc-code .nv{color:#19177C}.pdoc-code .ow{color:#AA22FF; font-weight:bold}.pdoc-code .w{color:#bbbbbb}.pdoc-code .mb{color:#666666}.pdoc-code .mf{color:#666666}.pdoc-code .mh{color:#666666}.pdoc-code .mi{color:#666666}.pdoc-code .mo{color:#666666}.pdoc-code .sa{color:#BA2121}.pdoc-code .sb{color:#BA2121}.pdoc-code .sc{color:#BA2121}.pdoc-code .dl{color:#BA2121}.pdoc-code .sd{color:#BA2121; font-style:italic}.pdoc-code .s2{color:#BA2121}.pdoc-code .se{color:#AA5D1F; font-weight:bold}.pdoc-code .sh{color:#BA2121}.pdoc-code .si{color:#A45A77; font-weight:bold}.pdoc-code .sx{color:#008000}.pdoc-code .sr{color:#A45A77}.pdoc-code .s1{color:#BA2121}.pdoc-code .ss{color:#19177C}.pdoc-code .bp{color:#008000}.pdoc-code .fm{color:#0000FF}.pdoc-code .vc{color:#19177C}.pdoc-code .vg{color:#19177C}.pdoc-code .vi{color:#19177C}.pdoc-code .vm{color:#19177C}.pdoc-code .il{color:#666666}</style> <style>/*! theme.css */:root{--pdoc-background:#fff;}.pdoc{--text:#212529;--muted:#6c757d;--link:#3660a5;--link-hover:#1659c5;--code:#f8f8f8;--active:#fff598;--accent:#eee;--accent2:#c1c1c1;--nav-hover:rgba(255, 255, 255, 0.5);--name:#0066BB;--def:#008800;--annotation:#007020;}</style> - <style>/*! layout.css */html, body{width:100%;height:100%;}html, main{scroll-behavior:smooth;}body{background-color:var(--pdoc-background);}@media (max-width:769px){#navtoggle{cursor:pointer;position:absolute;width:50px;height:40px;top:1rem;right:1rem;border-color:var(--text);color:var(--text);display:flex;opacity:0.8;z-index:999;}#navtoggle:hover{opacity:1;}#togglestate + div{display:none;}#togglestate:checked + div{display:inherit;}main, header{padding:2rem 3vw;}header + main{margin-top:-3rem;}.git-button{display:none !important;}nav input[type="search"]{max-width:77%;}nav input[type="search"]:first-child{margin-top:-6px;}nav input[type="search"]:valid ~ *{display:none !important;}}@media (min-width:770px){:root{--sidebar-width:clamp(12.5rem, 28vw, 22rem);}nav{position:fixed;overflow:auto;height:100vh;width:var(--sidebar-width);}main, header{padding:3rem 2rem 3rem calc(var(--sidebar-width) + 3rem);width:calc(54rem + var(--sidebar-width));max-width:100%;}header + main{margin-top:-4rem;}#navtoggle{display:none;}}#togglestate{position:absolute;height:0;opacity:0;}nav.pdoc{--pad:clamp(0.5rem, 2vw, 1.75rem);--indent:1.5rem;background-color:var(--accent);border-right:1px solid var(--accent2);box-shadow:0 0 20px rgba(50, 50, 50, .2) inset;padding:0 0 0 var(--pad);overflow-wrap:anywhere;scrollbar-width:thin; scrollbar-color:var(--accent2) transparent }nav.pdoc::-webkit-scrollbar{width:.4rem; }nav.pdoc::-webkit-scrollbar-thumb{background-color:var(--accent2); }nav.pdoc > div{padding:var(--pad) 0;}nav.pdoc .module-list-button{display:inline-flex;align-items:center;color:var(--text);border-color:var(--muted);margin-bottom:1rem;}nav.pdoc .module-list-button:hover{border-color:var(--text);}nav.pdoc input[type=search]{display:block;outline-offset:0;width:calc(100% - var(--pad));}nav.pdoc .logo{max-width:calc(100% - var(--pad));max-height:35vh;display:block;margin:0 auto 1rem;transform:translate(calc(-.5 * var(--pad)), 0);}nav.pdoc ul{list-style:none;padding-left:0;}nav.pdoc > div > ul{margin-left:calc(0px - var(--pad));}nav.pdoc li a{padding:.2rem 0 .2rem calc(var(--pad) + var(--indent));}nav.pdoc > div > ul > li > a{padding-left:var(--pad);}nav.pdoc li{transition:all 100ms;}nav.pdoc li:hover{background-color:var(--nav-hover);}nav.pdoc a, nav.pdoc a:hover{color:var(--text);}nav.pdoc a{display:block;}nav.pdoc > h2:first-of-type{margin-top:1.5rem;}nav.pdoc .class:before{content:"class ";color:var(--muted);}nav.pdoc .function:after{content:"()";color:var(--muted);}nav.pdoc footer:before{content:"";display:block;width:calc(100% - var(--pad));border-top:solid var(--accent2) 1px;margin-top:1.5rem;padding-top:.5rem;}nav.pdoc footer{font-size:small;}</style> - <style>/*! content.css */.pdoc{color:var(--text);box-sizing:border-box;line-height:1.5;background:none;}.pdoc .pdoc-button{cursor:pointer;display:inline-block;border:solid black 1px;border-radius:2px;font-size:.75rem;padding:calc(0.5em - 1px) 1em;transition:100ms all;}.pdoc .pdoc-alert{padding:1rem 1rem 1rem calc(1.5rem + 24px);border:1px solid transparent;border-radius:.25rem;background-repeat:no-repeat;background-position:1rem center;margin-bottom:1rem;}.pdoc .pdoc-alert > *:last-child{margin-bottom:0;}.pdoc .pdoc-alert-note {color:#084298;background-color:#cfe2ff;border-color:#b6d4fe;background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22%23084298%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20d%3D%22M8%2016A8%208%200%201%200%208%200a8%208%200%200%200%200%2016zm.93-9.412-1%204.705c-.07.34.029.533.304.533.194%200%20.487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703%200-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381%202.29-.287zM8%205.5a1%201%200%201%201%200-2%201%201%200%200%201%200%202z%22/%3E%3C/svg%3E");}.pdoc .pdoc-alert-warning{color:#664d03;background-color:#fff3cd;border-color:#ffecb5;background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22%23664d03%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20d%3D%22M8.982%201.566a1.13%201.13%200%200%200-1.96%200L.165%2013.233c-.457.778.091%201.767.98%201.767h13.713c.889%200%201.438-.99.98-1.767L8.982%201.566zM8%205c.535%200%20.954.462.9.995l-.35%203.507a.552.552%200%200%201-1.1%200L7.1%205.995A.905.905%200%200%201%208%205zm.002%206a1%201%200%201%201%200%202%201%201%200%200%201%200-2z%22/%3E%3C/svg%3E");}.pdoc .pdoc-alert-danger{color:#842029;background-color:#f8d7da;border-color:#f5c2c7;background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22%23842029%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20d%3D%22M5.52.359A.5.5%200%200%201%206%200h4a.5.5%200%200%201%20.474.658L8.694%206H12.5a.5.5%200%200%201%20.395.807l-7%209a.5.5%200%200%201-.873-.454L6.823%209.5H3.5a.5.5%200%200%201-.48-.641l2.5-8.5z%22/%3E%3C/svg%3E");}.pdoc .visually-hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important;}.pdoc h1, .pdoc h2, .pdoc h3{font-weight:300;margin:.3em 0;padding:.2em 0;}.pdoc > section:not(.module-info) h1{font-size:1.5rem;font-weight:500;}.pdoc > section:not(.module-info) h2{font-size:1.4rem;font-weight:500;}.pdoc > section:not(.module-info) h3{font-size:1.3rem;font-weight:500;}.pdoc > section:not(.module-info) h4{font-size:1.2rem;}.pdoc > section:not(.module-info) h5{font-size:1.1rem;}.pdoc a{text-decoration:none;color:var(--link);}.pdoc a:hover{color:var(--link-hover);}.pdoc blockquote{margin-left:2rem;}.pdoc pre{border-top:1px solid var(--accent2);border-bottom:1px solid var(--accent2);margin-top:0;margin-bottom:1em;padding:.5rem 0 .5rem .5rem;overflow-x:auto;background-color:var(--code);}.pdoc code{color:var(--text);padding:.2em .4em;margin:0;font-size:85%;background-color:var(--code);border-radius:6px;}.pdoc a > code{color:inherit;}.pdoc pre > code{display:inline-block;font-size:inherit;background:none;border:none;padding:0;}.pdoc > section:not(.module-info){margin-bottom:1.5rem;}.pdoc .modulename{margin-top:0;font-weight:bold;}.pdoc .modulename a{color:var(--link);transition:100ms all;}.pdoc .git-button{float:right;border:solid var(--link) 1px;}.pdoc .git-button:hover{background-color:var(--link);color:var(--pdoc-background);}.view-source-toggle-state,.view-source-toggle-state ~ .pdoc-code{display:none;}.view-source-toggle-state:checked ~ .pdoc-code{display:block;}.view-source-button{display:inline-block;float:right;font-size:.75rem;line-height:1.5rem;color:var(--muted);padding:0 .4rem 0 1.3rem;cursor:pointer;text-indent:-2px;}.view-source-button > span{visibility:hidden;}.module-info .view-source-button{float:none;display:flex;justify-content:flex-end;margin:-1.2rem .4rem -.2rem 0;}.view-source-button::before{position:absolute;content:"View Source";display:list-item;list-style-type:disclosure-closed;}.view-source-toggle-state:checked ~ .attr .view-source-button::before,.view-source-toggle-state:checked ~ .view-source-button::before{list-style-type:disclosure-open;}.pdoc .docstring{margin-bottom:1.5rem;}.pdoc section:not(.module-info) .docstring{margin-left:clamp(0rem, 5vw - 2rem, 1rem);}.pdoc .docstring .pdoc-code{margin-left:1em;margin-right:1em;}.pdoc h1:target,.pdoc h2:target,.pdoc h3:target,.pdoc h4:target,.pdoc h5:target,.pdoc h6:target,.pdoc .pdoc-code > pre > span:target{background-color:var(--active);box-shadow:-1rem 0 0 0 var(--active);}.pdoc .pdoc-code > pre > span:target{display:block;}.pdoc div:target > .attr,.pdoc section:target > .attr,.pdoc dd:target > a{background-color:var(--active);}.pdoc *{scroll-margin:2rem;}.pdoc .pdoc-code .linenos{user-select:none;}.pdoc .attr:hover{filter:contrast(0.95);}.pdoc section, .pdoc .classattr{position:relative;}.pdoc .headerlink{--width:clamp(1rem, 3vw, 2rem);position:absolute;top:0;left:calc(0rem - var(--width));transition:all 100ms ease-in-out;opacity:0;}.pdoc .headerlink::before{content:"#";display:block;text-align:center;width:var(--width);height:2.3rem;line-height:2.3rem;font-size:1.5rem;}.pdoc .attr:hover ~ .headerlink,.pdoc *:target > .headerlink,.pdoc .headerlink:hover{opacity:1;}.pdoc .attr{display:block;margin:.5rem 0 .5rem;padding:.4rem .4rem .4rem 1rem;background-color:var(--accent);overflow-x:auto;}.pdoc .classattr{margin-left:2rem;}.pdoc .name{color:var(--name);font-weight:bold;}.pdoc .def{color:var(--def);font-weight:bold;}.pdoc .signature{background-color:transparent;}.pdoc .param, .pdoc .return-annotation{white-space:pre;}.pdoc .signature.multiline .param{display:block;}.pdoc .signature.condensed .param{display:inline-block;}.pdoc .annotation{color:var(--annotation);}.pdoc .view-value-toggle-state,.pdoc .view-value-toggle-state ~ .default_value{display:none;}.pdoc .view-value-toggle-state:checked ~ .default_value{display:inherit;}.pdoc .view-value-button{font-size:.5rem;vertical-align:middle;border-style:dashed;margin-top:-0.1rem;}.pdoc .view-value-button:hover{background:white;}.pdoc .view-value-button::before{content:"show";text-align:center;width:2.2em;display:inline-block;}.pdoc .view-value-toggle-state:checked ~ .view-value-button::before{content:"hide";}.pdoc .inherited{margin-left:2rem;}.pdoc .inherited dt{font-weight:700;}.pdoc .inherited dt, .pdoc .inherited dd{display:inline;margin-left:0;margin-bottom:.5rem;}.pdoc .inherited dd:not(:last-child):after{content:", ";}.pdoc .inherited .class:before{content:"class ";}.pdoc .inherited .function a:after{content:"()";}.pdoc .search-result .docstring{overflow:auto;max-height:25vh;}.pdoc .search-result.focused > .attr{background-color:var(--active);}.pdoc .attribution{margin-top:2rem;display:block;opacity:0.5;transition:all 200ms;filter:grayscale(100%);}.pdoc .attribution:hover{opacity:1;filter:grayscale(0%);}.pdoc .attribution img{margin-left:5px;height:35px;vertical-align:middle;width:70px;transition:all 200ms;}.pdoc table{display:block;width:max-content;max-width:100%;overflow:auto;margin-bottom:1rem;}.pdoc table th{font-weight:600;}.pdoc table th, .pdoc table td{padding:6px 13px;border:1px solid var(--accent2);}</style> + <style>/*! layout.css */html, body{width:100%;height:100%;}html, main{scroll-behavior:smooth;}body{background-color:var(--pdoc-background);}@media (max-width:769px){#navtoggle{cursor:pointer;position:absolute;width:50px;height:40px;top:1rem;right:1rem;border-color:var(--text);color:var(--text);display:flex;opacity:0.8;z-index:999;}#navtoggle:hover{opacity:1;}#togglestate + div{display:none;}#togglestate:checked + div{display:inherit;}main, header{padding:2rem 3vw;}header + main{margin-top:-3rem;}.git-button{display:none !important;}nav input[type="search"]{max-width:77%;}nav input[type="search"]:first-child{margin-top:-6px;}nav input[type="search"]:valid ~ *{display:none !important;}}@media (min-width:770px){:root{--sidebar-width:clamp(12.5rem, 28vw, 22rem);}nav{position:fixed;overflow:auto;height:100vh;width:var(--sidebar-width);}main, header{padding:3rem 2rem 3rem calc(var(--sidebar-width) + 3rem);width:calc(54rem + var(--sidebar-width));max-width:100%;}header + main{margin-top:-4rem;}#navtoggle{display:none;}}#togglestate{position:absolute;height:0;opacity:0;}nav.pdoc{--pad:clamp(0.5rem, 2vw, 1.75rem);--indent:1.5rem;background-color:var(--accent);border-right:1px solid var(--accent2);box-shadow:0 0 20px rgba(50, 50, 50, .2) inset;padding:0 0 0 var(--pad);overflow-wrap:anywhere;scrollbar-width:thin; scrollbar-color:var(--accent2) transparent; z-index:1}nav.pdoc::-webkit-scrollbar{width:.4rem; }nav.pdoc::-webkit-scrollbar-thumb{background-color:var(--accent2); }nav.pdoc > div{padding:var(--pad) 0;}nav.pdoc .module-list-button{display:inline-flex;align-items:center;color:var(--text);border-color:var(--muted);margin-bottom:1rem;}nav.pdoc .module-list-button:hover{border-color:var(--text);}nav.pdoc input[type=search]{display:block;outline-offset:0;width:calc(100% - var(--pad));}nav.pdoc .logo{max-width:calc(100% - var(--pad));max-height:35vh;display:block;margin:0 auto 1rem;transform:translate(calc(-.5 * var(--pad)), 0);}nav.pdoc ul{list-style:none;padding-left:0;}nav.pdoc > div > ul{margin-left:calc(0px - var(--pad));}nav.pdoc li a{padding:.2rem 0 .2rem calc(var(--pad) + var(--indent));}nav.pdoc > div > ul > li > a{padding-left:var(--pad);}nav.pdoc li{transition:all 100ms;}nav.pdoc li:hover{background-color:var(--nav-hover);}nav.pdoc a, nav.pdoc a:hover{color:var(--text);}nav.pdoc a{display:block;}nav.pdoc > h2:first-of-type{margin-top:1.5rem;}nav.pdoc .class:before{content:"class ";color:var(--muted);}nav.pdoc .function:after{content:"()";color:var(--muted);}nav.pdoc footer:before{content:"";display:block;width:calc(100% - var(--pad));border-top:solid var(--accent2) 1px;margin-top:1.5rem;padding-top:.5rem;}nav.pdoc footer{font-size:small;}</style> + <style>/*! content.css */.pdoc{color:var(--text);box-sizing:border-box;line-height:1.5;background:none;}.pdoc .pdoc-button{cursor:pointer;display:inline-block;border:solid black 1px;border-radius:2px;font-size:.75rem;padding:calc(0.5em - 1px) 1em;transition:100ms all;}.pdoc .pdoc-alert{padding:1rem 1rem 1rem calc(1.5rem + 24px);border:1px solid transparent;border-radius:.25rem;background-repeat:no-repeat;background-position:1rem center;margin-bottom:1rem;}.pdoc .pdoc-alert > *:last-child{margin-bottom:0;}.pdoc .pdoc-alert-note {color:#084298;background-color:#cfe2ff;border-color:#b6d4fe;background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22%23084298%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20d%3D%22M8%2016A8%208%200%201%200%208%200a8%208%200%200%200%200%2016zm.93-9.412-1%204.705c-.07.34.029.533.304.533.194%200%20.487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703%200-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381%202.29-.287zM8%205.5a1%201%200%201%201%200-2%201%201%200%200%201%200%202z%22/%3E%3C/svg%3E");}.pdoc .pdoc-alert-warning{color:#664d03;background-color:#fff3cd;border-color:#ffecb5;background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22%23664d03%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20d%3D%22M8.982%201.566a1.13%201.13%200%200%200-1.96%200L.165%2013.233c-.457.778.091%201.767.98%201.767h13.713c.889%200%201.438-.99.98-1.767L8.982%201.566zM8%205c.535%200%20.954.462.9.995l-.35%203.507a.552.552%200%200%201-1.1%200L7.1%205.995A.905.905%200%200%201%208%205zm.002%206a1%201%200%201%201%200%202%201%201%200%200%201%200-2z%22/%3E%3C/svg%3E");}.pdoc .pdoc-alert-danger{color:#842029;background-color:#f8d7da;border-color:#f5c2c7;background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22%23842029%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20d%3D%22M5.52.359A.5.5%200%200%201%206%200h4a.5.5%200%200%201%20.474.658L8.694%206H12.5a.5.5%200%200%201%20.395.807l-7%209a.5.5%200%200%201-.873-.454L6.823%209.5H3.5a.5.5%200%200%201-.48-.641l2.5-8.5z%22/%3E%3C/svg%3E");}.pdoc .visually-hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important;}.pdoc h1, .pdoc h2, .pdoc h3{font-weight:300;margin:.3em 0;padding:.2em 0;}.pdoc > section:not(.module-info) h1{font-size:1.5rem;font-weight:500;}.pdoc > section:not(.module-info) h2{font-size:1.4rem;font-weight:500;}.pdoc > section:not(.module-info) h3{font-size:1.3rem;font-weight:500;}.pdoc > section:not(.module-info) h4{font-size:1.2rem;}.pdoc > section:not(.module-info) h5{font-size:1.1rem;}.pdoc a{text-decoration:none;color:var(--link);}.pdoc a:hover{color:var(--link-hover);}.pdoc blockquote{margin-left:2rem;}.pdoc pre{border-top:1px solid var(--accent2);border-bottom:1px solid var(--accent2);margin-top:0;margin-bottom:1em;padding:.5rem 0 .5rem .5rem;overflow-x:auto;background-color:var(--code);}.pdoc code{color:var(--text);padding:.2em .4em;margin:0;font-size:85%;background-color:var(--accent);border-radius:6px;}.pdoc a > code{color:inherit;}.pdoc pre > code{display:inline-block;font-size:inherit;background:none;border:none;padding:0;}.pdoc > section:not(.module-info){margin-bottom:1.5rem;}.pdoc .modulename{margin-top:0;font-weight:bold;}.pdoc .modulename a{color:var(--link);transition:100ms all;}.pdoc .git-button{float:right;border:solid var(--link) 1px;}.pdoc .git-button:hover{background-color:var(--link);color:var(--pdoc-background);}.view-source-toggle-state,.view-source-toggle-state ~ .pdoc-code{display:none;}.view-source-toggle-state:checked ~ .pdoc-code{display:block;}.view-source-button{display:inline-block;float:right;font-size:.75rem;line-height:1.5rem;color:var(--muted);padding:0 .4rem 0 1.3rem;cursor:pointer;text-indent:-2px;}.view-source-button > span{visibility:hidden;}.module-info .view-source-button{float:none;display:flex;justify-content:flex-end;margin:-1.2rem .4rem -.2rem 0;}.view-source-button::before{position:absolute;content:"View Source";display:list-item;list-style-type:disclosure-closed;}.view-source-toggle-state:checked ~ .attr .view-source-button::before,.view-source-toggle-state:checked ~ .view-source-button::before{list-style-type:disclosure-open;}.pdoc .docstring{margin-bottom:1.5rem;}.pdoc section:not(.module-info) .docstring{margin-left:clamp(0rem, 5vw - 2rem, 1rem);}.pdoc .docstring .pdoc-code{margin-left:1em;margin-right:1em;}.pdoc h1:target,.pdoc h2:target,.pdoc h3:target,.pdoc h4:target,.pdoc h5:target,.pdoc h6:target,.pdoc .pdoc-code > pre > span:target{background-color:var(--active);box-shadow:-1rem 0 0 0 var(--active);}.pdoc .pdoc-code > pre > span:target{display:block;}.pdoc div:target > .attr,.pdoc section:target > .attr,.pdoc dd:target > a{background-color:var(--active);}.pdoc *{scroll-margin:2rem;}.pdoc .pdoc-code .linenos{user-select:none;}.pdoc .attr:hover{filter:contrast(0.95);}.pdoc section, .pdoc .classattr{position:relative;}.pdoc .headerlink{--width:clamp(1rem, 3vw, 2rem);position:absolute;top:0;left:calc(0rem - var(--width));transition:all 100ms ease-in-out;opacity:0;}.pdoc .headerlink::before{content:"#";display:block;text-align:center;width:var(--width);height:2.3rem;line-height:2.3rem;font-size:1.5rem;}.pdoc .attr:hover ~ .headerlink,.pdoc *:target > .headerlink,.pdoc .headerlink:hover{opacity:1;}.pdoc .attr{display:block;margin:.5rem 0 .5rem;padding:.4rem .4rem .4rem 1rem;background-color:var(--accent);overflow-x:auto;}.pdoc .classattr{margin-left:2rem;}.pdoc .name{color:var(--name);font-weight:bold;}.pdoc .def{color:var(--def);font-weight:bold;}.pdoc .signature{background-color:transparent;}.pdoc .param, .pdoc .return-annotation{white-space:pre;}.pdoc .signature.multiline .param{display:block;}.pdoc .signature.condensed .param{display:inline-block;}.pdoc .annotation{color:var(--annotation);}.pdoc .view-value-toggle-state,.pdoc .view-value-toggle-state ~ .default_value{display:none;}.pdoc .view-value-toggle-state:checked ~ .default_value{display:inherit;}.pdoc .view-value-button{font-size:.5rem;vertical-align:middle;border-style:dashed;margin-top:-0.1rem;}.pdoc .view-value-button:hover{background:white;}.pdoc .view-value-button::before{content:"show";text-align:center;width:2.2em;display:inline-block;}.pdoc .view-value-toggle-state:checked ~ .view-value-button::before{content:"hide";}.pdoc .inherited{margin-left:2rem;}.pdoc .inherited dt{font-weight:700;}.pdoc .inherited dt, .pdoc .inherited dd{display:inline;margin-left:0;margin-bottom:.5rem;}.pdoc .inherited dd:not(:last-child):after{content:", ";}.pdoc .inherited .class:before{content:"class ";}.pdoc .inherited .function a:after{content:"()";}.pdoc .search-result .docstring{overflow:auto;max-height:25vh;}.pdoc .search-result.focused > .attr{background-color:var(--active);}.pdoc .attribution{margin-top:2rem;display:block;opacity:0.5;transition:all 200ms;filter:grayscale(100%);}.pdoc .attribution:hover{opacity:1;filter:grayscale(0%);}.pdoc .attribution img{margin-left:5px;height:35px;vertical-align:middle;width:70px;transition:all 200ms;}.pdoc table{display:block;width:max-content;max-width:100%;overflow:auto;margin-bottom:1rem;}.pdoc table th{font-weight:600;}.pdoc table th, .pdoc table td{padding:6px 13px;border:1px solid var(--accent2);}</style> <style>/*! custom.css */</style></head> <body> <nav class="pdoc"> @@ -52,6 +52,9 @@ <a class="class" href="#Teradata.Parser">Teradata.Parser</a> <ul class="memberlist"> <li> + <a class="variable" href="#Teradata.Parser.TABLESAMPLE_CSV">TABLESAMPLE_CSV</a> + </li> + <li> <a class="variable" href="#Teradata.Parser.CHARSET_TRANSLATORS">CHARSET_TRANSLATORS</a> </li> <li> @@ -106,6 +109,9 @@ <a class="variable" href="#Teradata.Generator.TRANSFORMS">TRANSFORMS</a> </li> <li> + <a class="function" href="#Teradata.Generator.tablesample_sql">tablesample_sql</a> + </li> + <li> <a class="function" href="#Teradata.Generator.partitionedbyproperty_sql">partitionedbyproperty_sql</a> </li> <li> @@ -295,174 +301,182 @@ </span><span id="L-45"><a href="#L-45"><span class="linenos"> 45</span></a> <span class="s2">"MOD"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">MOD</span><span class="p">,</span> </span><span id="L-46"><a href="#L-46"><span class="linenos"> 46</span></a> <span class="s2">"NE"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">NEQ</span><span class="p">,</span> </span><span id="L-47"><a href="#L-47"><span class="linenos"> 47</span></a> <span class="s2">"NOT="</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">NEQ</span><span class="p">,</span> -</span><span id="L-48"><a href="#L-48"><span class="linenos"> 48</span></a> <span class="s2">"SEL"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">SELECT</span><span class="p">,</span> -</span><span id="L-49"><a href="#L-49"><span class="linenos"> 49</span></a> <span class="s2">"ST_GEOMETRY"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">GEOMETRY</span><span class="p">,</span> -</span><span id="L-50"><a href="#L-50"><span class="linenos"> 50</span></a> <span class="s2">"TOP"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">TOP</span><span class="p">,</span> -</span><span id="L-51"><a href="#L-51"><span class="linenos"> 51</span></a> <span class="p">}</span> -</span><span id="L-52"><a href="#L-52"><span class="linenos"> 52</span></a> -</span><span id="L-53"><a href="#L-53"><span class="linenos"> 53</span></a> <span class="c1"># Teradata does not support % as a modulo operator</span> -</span><span id="L-54"><a href="#L-54"><span class="linenos"> 54</span></a> <span class="n">SINGLE_TOKENS</span> <span class="o">=</span> <span class="p">{</span><span class="o">**</span><span class="n">tokens</span><span class="o">.</span><span class="n">Tokenizer</span><span class="o">.</span><span class="n">SINGLE_TOKENS</span><span class="p">}</span> -</span><span id="L-55"><a href="#L-55"><span class="linenos"> 55</span></a> <span class="n">SINGLE_TOKENS</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">"%"</span><span class="p">)</span> -</span><span id="L-56"><a href="#L-56"><span class="linenos"> 56</span></a> -</span><span id="L-57"><a href="#L-57"><span class="linenos"> 57</span></a> <span class="k">class</span> <span class="nc">Parser</span><span class="p">(</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="p">):</span> -</span><span id="L-58"><a href="#L-58"><span class="linenos"> 58</span></a> <span class="n">CHARSET_TRANSLATORS</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-59"><a href="#L-59"><span class="linenos"> 59</span></a> <span class="s2">"GRAPHIC_TO_KANJISJIS"</span><span class="p">,</span> -</span><span id="L-60"><a href="#L-60"><span class="linenos"> 60</span></a> <span class="s2">"GRAPHIC_TO_LATIN"</span><span class="p">,</span> -</span><span id="L-61"><a href="#L-61"><span class="linenos"> 61</span></a> <span class="s2">"GRAPHIC_TO_UNICODE"</span><span class="p">,</span> -</span><span id="L-62"><a href="#L-62"><span class="linenos"> 62</span></a> <span class="s2">"GRAPHIC_TO_UNICODE_PadSpace"</span><span class="p">,</span> -</span><span id="L-63"><a href="#L-63"><span class="linenos"> 63</span></a> <span class="s2">"KANJI1_KanjiEBCDIC_TO_UNICODE"</span><span class="p">,</span> -</span><span id="L-64"><a href="#L-64"><span class="linenos"> 64</span></a> <span class="s2">"KANJI1_KanjiEUC_TO_UNICODE"</span><span class="p">,</span> -</span><span id="L-65"><a href="#L-65"><span class="linenos"> 65</span></a> <span class="s2">"KANJI1_KANJISJIS_TO_UNICODE"</span><span class="p">,</span> -</span><span id="L-66"><a href="#L-66"><span class="linenos"> 66</span></a> <span class="s2">"KANJI1_SBC_TO_UNICODE"</span><span class="p">,</span> -</span><span id="L-67"><a href="#L-67"><span class="linenos"> 67</span></a> <span class="s2">"KANJISJIS_TO_GRAPHIC"</span><span class="p">,</span> -</span><span id="L-68"><a href="#L-68"><span class="linenos"> 68</span></a> <span class="s2">"KANJISJIS_TO_LATIN"</span><span class="p">,</span> -</span><span id="L-69"><a href="#L-69"><span class="linenos"> 69</span></a> <span class="s2">"KANJISJIS_TO_UNICODE"</span><span class="p">,</span> -</span><span id="L-70"><a href="#L-70"><span class="linenos"> 70</span></a> <span class="s2">"LATIN_TO_GRAPHIC"</span><span class="p">,</span> -</span><span id="L-71"><a href="#L-71"><span class="linenos"> 71</span></a> <span class="s2">"LATIN_TO_KANJISJIS"</span><span class="p">,</span> -</span><span id="L-72"><a href="#L-72"><span class="linenos"> 72</span></a> <span class="s2">"LATIN_TO_UNICODE"</span><span class="p">,</span> -</span><span id="L-73"><a href="#L-73"><span class="linenos"> 73</span></a> <span class="s2">"LOCALE_TO_UNICODE"</span><span class="p">,</span> -</span><span id="L-74"><a href="#L-74"><span class="linenos"> 74</span></a> <span class="s2">"UNICODE_TO_GRAPHIC"</span><span class="p">,</span> -</span><span id="L-75"><a href="#L-75"><span class="linenos"> 75</span></a> <span class="s2">"UNICODE_TO_GRAPHIC_PadGraphic"</span><span class="p">,</span> -</span><span id="L-76"><a href="#L-76"><span class="linenos"> 76</span></a> <span class="s2">"UNICODE_TO_GRAPHIC_VarGraphic"</span><span class="p">,</span> -</span><span id="L-77"><a href="#L-77"><span class="linenos"> 77</span></a> <span class="s2">"UNICODE_TO_KANJI1_KanjiEBCDIC"</span><span class="p">,</span> -</span><span id="L-78"><a href="#L-78"><span class="linenos"> 78</span></a> <span class="s2">"UNICODE_TO_KANJI1_KanjiEUC"</span><span class="p">,</span> -</span><span id="L-79"><a href="#L-79"><span class="linenos"> 79</span></a> <span class="s2">"UNICODE_TO_KANJI1_KANJISJIS"</span><span class="p">,</span> -</span><span id="L-80"><a href="#L-80"><span class="linenos"> 80</span></a> <span class="s2">"UNICODE_TO_KANJI1_SBC"</span><span class="p">,</span> -</span><span id="L-81"><a href="#L-81"><span class="linenos"> 81</span></a> <span class="s2">"UNICODE_TO_KANJISJIS"</span><span class="p">,</span> -</span><span id="L-82"><a href="#L-82"><span class="linenos"> 82</span></a> <span class="s2">"UNICODE_TO_LATIN"</span><span class="p">,</span> -</span><span id="L-83"><a href="#L-83"><span class="linenos"> 83</span></a> <span class="s2">"UNICODE_TO_LOCALE"</span><span class="p">,</span> -</span><span id="L-84"><a href="#L-84"><span class="linenos"> 84</span></a> <span class="s2">"UNICODE_TO_UNICODE_FoldSpace"</span><span class="p">,</span> -</span><span id="L-85"><a href="#L-85"><span class="linenos"> 85</span></a> <span class="s2">"UNICODE_TO_UNICODE_Fullwidth"</span><span class="p">,</span> -</span><span id="L-86"><a href="#L-86"><span class="linenos"> 86</span></a> <span class="s2">"UNICODE_TO_UNICODE_Halfwidth"</span><span class="p">,</span> -</span><span id="L-87"><a href="#L-87"><span class="linenos"> 87</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFC"</span><span class="p">,</span> -</span><span id="L-88"><a href="#L-88"><span class="linenos"> 88</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFD"</span><span class="p">,</span> -</span><span id="L-89"><a href="#L-89"><span class="linenos"> 89</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFKC"</span><span class="p">,</span> -</span><span id="L-90"><a href="#L-90"><span class="linenos"> 90</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFKD"</span><span class="p">,</span> -</span><span id="L-91"><a href="#L-91"><span class="linenos"> 91</span></a> <span class="p">}</span> -</span><span id="L-92"><a href="#L-92"><span class="linenos"> 92</span></a> -</span><span id="L-93"><a href="#L-93"><span class="linenos"> 93</span></a> <span class="n">FUNC_TOKENS</span> <span class="o">=</span> <span class="p">{</span><span class="o">*</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNC_TOKENS</span><span class="p">}</span> -</span><span id="L-94"><a href="#L-94"><span class="linenos"> 94</span></a> <span class="n">FUNC_TOKENS</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">REPLACE</span><span class="p">)</span> +</span><span id="L-48"><a href="#L-48"><span class="linenos"> 48</span></a> <span class="s2">"SAMPLE"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">TABLE_SAMPLE</span><span class="p">,</span> +</span><span id="L-49"><a href="#L-49"><span class="linenos"> 49</span></a> <span class="s2">"SEL"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">SELECT</span><span class="p">,</span> +</span><span id="L-50"><a href="#L-50"><span class="linenos"> 50</span></a> <span class="s2">"ST_GEOMETRY"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">GEOMETRY</span><span class="p">,</span> +</span><span id="L-51"><a href="#L-51"><span class="linenos"> 51</span></a> <span class="s2">"TOP"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">TOP</span><span class="p">,</span> +</span><span id="L-52"><a href="#L-52"><span class="linenos"> 52</span></a> <span class="p">}</span> +</span><span id="L-53"><a href="#L-53"><span class="linenos"> 53</span></a> +</span><span id="L-54"><a href="#L-54"><span class="linenos"> 54</span></a> <span class="c1"># Teradata does not support % as a modulo operator</span> +</span><span id="L-55"><a href="#L-55"><span class="linenos"> 55</span></a> <span class="n">SINGLE_TOKENS</span> <span class="o">=</span> <span class="p">{</span><span class="o">**</span><span class="n">tokens</span><span class="o">.</span><span class="n">Tokenizer</span><span class="o">.</span><span class="n">SINGLE_TOKENS</span><span class="p">}</span> +</span><span id="L-56"><a href="#L-56"><span class="linenos"> 56</span></a> <span class="n">SINGLE_TOKENS</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">"%"</span><span class="p">)</span> +</span><span id="L-57"><a href="#L-57"><span class="linenos"> 57</span></a> +</span><span id="L-58"><a href="#L-58"><span class="linenos"> 58</span></a> <span class="k">class</span> <span class="nc">Parser</span><span class="p">(</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="p">):</span> +</span><span id="L-59"><a href="#L-59"><span class="linenos"> 59</span></a> <span class="n">TABLESAMPLE_CSV</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-60"><a href="#L-60"><span class="linenos"> 60</span></a> +</span><span id="L-61"><a href="#L-61"><span class="linenos"> 61</span></a> <span class="n">CHARSET_TRANSLATORS</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-62"><a href="#L-62"><span class="linenos"> 62</span></a> <span class="s2">"GRAPHIC_TO_KANJISJIS"</span><span class="p">,</span> +</span><span id="L-63"><a href="#L-63"><span class="linenos"> 63</span></a> <span class="s2">"GRAPHIC_TO_LATIN"</span><span class="p">,</span> +</span><span id="L-64"><a href="#L-64"><span class="linenos"> 64</span></a> <span class="s2">"GRAPHIC_TO_UNICODE"</span><span class="p">,</span> +</span><span id="L-65"><a href="#L-65"><span class="linenos"> 65</span></a> <span class="s2">"GRAPHIC_TO_UNICODE_PadSpace"</span><span class="p">,</span> +</span><span id="L-66"><a href="#L-66"><span class="linenos"> 66</span></a> <span class="s2">"KANJI1_KanjiEBCDIC_TO_UNICODE"</span><span class="p">,</span> +</span><span id="L-67"><a href="#L-67"><span class="linenos"> 67</span></a> <span class="s2">"KANJI1_KanjiEUC_TO_UNICODE"</span><span class="p">,</span> +</span><span id="L-68"><a href="#L-68"><span class="linenos"> 68</span></a> <span class="s2">"KANJI1_KANJISJIS_TO_UNICODE"</span><span class="p">,</span> +</span><span id="L-69"><a href="#L-69"><span class="linenos"> 69</span></a> <span class="s2">"KANJI1_SBC_TO_UNICODE"</span><span class="p">,</span> +</span><span id="L-70"><a href="#L-70"><span class="linenos"> 70</span></a> <span class="s2">"KANJISJIS_TO_GRAPHIC"</span><span class="p">,</span> +</span><span id="L-71"><a href="#L-71"><span class="linenos"> 71</span></a> <span class="s2">"KANJISJIS_TO_LATIN"</span><span class="p">,</span> +</span><span id="L-72"><a href="#L-72"><span class="linenos"> 72</span></a> <span class="s2">"KANJISJIS_TO_UNICODE"</span><span class="p">,</span> +</span><span id="L-73"><a href="#L-73"><span class="linenos"> 73</span></a> <span class="s2">"LATIN_TO_GRAPHIC"</span><span class="p">,</span> +</span><span id="L-74"><a href="#L-74"><span class="linenos"> 74</span></a> <span class="s2">"LATIN_TO_KANJISJIS"</span><span class="p">,</span> +</span><span id="L-75"><a href="#L-75"><span class="linenos"> 75</span></a> <span class="s2">"LATIN_TO_UNICODE"</span><span class="p">,</span> +</span><span id="L-76"><a href="#L-76"><span class="linenos"> 76</span></a> <span class="s2">"LOCALE_TO_UNICODE"</span><span class="p">,</span> +</span><span id="L-77"><a href="#L-77"><span class="linenos"> 77</span></a> <span class="s2">"UNICODE_TO_GRAPHIC"</span><span class="p">,</span> +</span><span id="L-78"><a href="#L-78"><span class="linenos"> 78</span></a> <span class="s2">"UNICODE_TO_GRAPHIC_PadGraphic"</span><span class="p">,</span> +</span><span id="L-79"><a href="#L-79"><span class="linenos"> 79</span></a> <span class="s2">"UNICODE_TO_GRAPHIC_VarGraphic"</span><span class="p">,</span> +</span><span id="L-80"><a href="#L-80"><span class="linenos"> 80</span></a> <span class="s2">"UNICODE_TO_KANJI1_KanjiEBCDIC"</span><span class="p">,</span> +</span><span id="L-81"><a href="#L-81"><span class="linenos"> 81</span></a> <span class="s2">"UNICODE_TO_KANJI1_KanjiEUC"</span><span class="p">,</span> +</span><span id="L-82"><a href="#L-82"><span class="linenos"> 82</span></a> <span class="s2">"UNICODE_TO_KANJI1_KANJISJIS"</span><span class="p">,</span> +</span><span id="L-83"><a href="#L-83"><span class="linenos"> 83</span></a> <span class="s2">"UNICODE_TO_KANJI1_SBC"</span><span class="p">,</span> +</span><span id="L-84"><a href="#L-84"><span class="linenos"> 84</span></a> <span class="s2">"UNICODE_TO_KANJISJIS"</span><span class="p">,</span> +</span><span id="L-85"><a href="#L-85"><span class="linenos"> 85</span></a> <span class="s2">"UNICODE_TO_LATIN"</span><span class="p">,</span> +</span><span id="L-86"><a href="#L-86"><span class="linenos"> 86</span></a> <span class="s2">"UNICODE_TO_LOCALE"</span><span class="p">,</span> +</span><span id="L-87"><a href="#L-87"><span class="linenos"> 87</span></a> <span class="s2">"UNICODE_TO_UNICODE_FoldSpace"</span><span class="p">,</span> +</span><span id="L-88"><a href="#L-88"><span class="linenos"> 88</span></a> <span class="s2">"UNICODE_TO_UNICODE_Fullwidth"</span><span class="p">,</span> +</span><span id="L-89"><a href="#L-89"><span class="linenos"> 89</span></a> <span class="s2">"UNICODE_TO_UNICODE_Halfwidth"</span><span class="p">,</span> +</span><span id="L-90"><a href="#L-90"><span class="linenos"> 90</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFC"</span><span class="p">,</span> +</span><span id="L-91"><a href="#L-91"><span class="linenos"> 91</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFD"</span><span class="p">,</span> +</span><span id="L-92"><a href="#L-92"><span class="linenos"> 92</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFKC"</span><span class="p">,</span> +</span><span id="L-93"><a href="#L-93"><span class="linenos"> 93</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFKD"</span><span class="p">,</span> +</span><span id="L-94"><a href="#L-94"><span class="linenos"> 94</span></a> <span class="p">}</span> </span><span id="L-95"><a href="#L-95"><span class="linenos"> 95</span></a> -</span><span id="L-96"><a href="#L-96"><span class="linenos"> 96</span></a> <span class="n">STATEMENT_PARSERS</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-97"><a href="#L-97"><span class="linenos"> 97</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">STATEMENT_PARSERS</span><span class="p">,</span> -</span><span id="L-98"><a href="#L-98"><span class="linenos"> 98</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">DATABASE</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span> -</span><span id="L-99"><a href="#L-99"><span class="linenos"> 99</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Use</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_table</span><span class="p">(</span><span class="n">schema</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> -</span><span id="L-100"><a href="#L-100"><span class="linenos">100</span></a> <span class="p">),</span> -</span><span id="L-101"><a href="#L-101"><span class="linenos">101</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">REPLACE</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_create</span><span class="p">(),</span> -</span><span id="L-102"><a href="#L-102"><span class="linenos">102</span></a> <span class="p">}</span> -</span><span id="L-103"><a href="#L-103"><span class="linenos">103</span></a> -</span><span id="L-104"><a href="#L-104"><span class="linenos">104</span></a> <span class="n">FUNCTION_PARSERS</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-105"><a href="#L-105"><span class="linenos">105</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNCTION_PARSERS</span><span class="p">,</span> -</span><span id="L-106"><a href="#L-106"><span class="linenos">106</span></a> <span class="s2">"RANGE_N"</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_rangen</span><span class="p">(),</span> -</span><span id="L-107"><a href="#L-107"><span class="linenos">107</span></a> <span class="s2">"TRANSLATE"</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_translate</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">STRICT_CAST</span><span class="p">),</span> -</span><span id="L-108"><a href="#L-108"><span class="linenos">108</span></a> <span class="p">}</span> -</span><span id="L-109"><a href="#L-109"><span class="linenos">109</span></a> -</span><span id="L-110"><a href="#L-110"><span class="linenos">110</span></a> <span class="k">def</span> <span class="nf">_parse_translate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">strict</span><span class="p">:</span> <span class="nb">bool</span><span class="p">)</span> <span class="o">-></span> <span class="n">exp</span><span class="o">.</span><span class="n">Expression</span><span class="p">:</span> -</span><span id="L-111"><a href="#L-111"><span class="linenos">111</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_conjunction</span><span class="p">()</span> +</span><span id="L-96"><a href="#L-96"><span class="linenos"> 96</span></a> <span class="n">FUNC_TOKENS</span> <span class="o">=</span> <span class="p">{</span><span class="o">*</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNC_TOKENS</span><span class="p">}</span> +</span><span id="L-97"><a href="#L-97"><span class="linenos"> 97</span></a> <span class="n">FUNC_TOKENS</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">REPLACE</span><span class="p">)</span> +</span><span id="L-98"><a href="#L-98"><span class="linenos"> 98</span></a> +</span><span id="L-99"><a href="#L-99"><span class="linenos"> 99</span></a> <span class="n">STATEMENT_PARSERS</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-100"><a href="#L-100"><span class="linenos">100</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">STATEMENT_PARSERS</span><span class="p">,</span> +</span><span id="L-101"><a href="#L-101"><span class="linenos">101</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">DATABASE</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span> +</span><span id="L-102"><a href="#L-102"><span class="linenos">102</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Use</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_table</span><span class="p">(</span><span class="n">schema</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> +</span><span id="L-103"><a href="#L-103"><span class="linenos">103</span></a> <span class="p">),</span> +</span><span id="L-104"><a href="#L-104"><span class="linenos">104</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">REPLACE</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_create</span><span class="p">(),</span> +</span><span id="L-105"><a href="#L-105"><span class="linenos">105</span></a> <span class="p">}</span> +</span><span id="L-106"><a href="#L-106"><span class="linenos">106</span></a> +</span><span id="L-107"><a href="#L-107"><span class="linenos">107</span></a> <span class="n">FUNCTION_PARSERS</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-108"><a href="#L-108"><span class="linenos">108</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNCTION_PARSERS</span><span class="p">,</span> +</span><span id="L-109"><a href="#L-109"><span class="linenos">109</span></a> <span class="s2">"RANGE_N"</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_rangen</span><span class="p">(),</span> +</span><span id="L-110"><a href="#L-110"><span class="linenos">110</span></a> <span class="s2">"TRANSLATE"</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_translate</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">STRICT_CAST</span><span class="p">),</span> +</span><span id="L-111"><a href="#L-111"><span class="linenos">111</span></a> <span class="p">}</span> </span><span id="L-112"><a href="#L-112"><span class="linenos">112</span></a> -</span><span id="L-113"><a href="#L-113"><span class="linenos">113</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">USING</span><span class="p">):</span> -</span><span id="L-114"><a href="#L-114"><span class="linenos">114</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">raise_error</span><span class="p">(</span><span class="s2">"Expected USING in TRANSLATE"</span><span class="p">)</span> +</span><span id="L-113"><a href="#L-113"><span class="linenos">113</span></a> <span class="k">def</span> <span class="nf">_parse_translate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">strict</span><span class="p">:</span> <span class="nb">bool</span><span class="p">)</span> <span class="o">-></span> <span class="n">exp</span><span class="o">.</span><span class="n">Expression</span><span class="p">:</span> +</span><span id="L-114"><a href="#L-114"><span class="linenos">114</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_conjunction</span><span class="p">()</span> </span><span id="L-115"><a href="#L-115"><span class="linenos">115</span></a> -</span><span id="L-116"><a href="#L-116"><span class="linenos">116</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match_texts</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">CHARSET_TRANSLATORS</span><span class="p">):</span> -</span><span id="L-117"><a href="#L-117"><span class="linenos">117</span></a> <span class="n">charset_split</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_prev</span><span class="o">.</span><span class="n">text</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"_TO_"</span><span class="p">)</span> -</span><span id="L-118"><a href="#L-118"><span class="linenos">118</span></a> <span class="n">to</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">CharacterSet</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">charset_split</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span> -</span><span id="L-119"><a href="#L-119"><span class="linenos">119</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="L-120"><a href="#L-120"><span class="linenos">120</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">raise_error</span><span class="p">(</span><span class="s2">"Expected a character set translator after USING in TRANSLATE"</span><span class="p">)</span> -</span><span id="L-121"><a href="#L-121"><span class="linenos">121</span></a> -</span><span id="L-122"><a href="#L-122"><span class="linenos">122</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Cast</span> <span class="k">if</span> <span class="n">strict</span> <span class="k">else</span> <span class="n">exp</span><span class="o">.</span><span class="n">TryCast</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">this</span><span class="p">,</span> <span class="n">to</span><span class="o">=</span><span class="n">to</span><span class="p">)</span> -</span><span id="L-123"><a href="#L-123"><span class="linenos">123</span></a> -</span><span id="L-124"><a href="#L-124"><span class="linenos">124</span></a> <span class="c1"># FROM before SET in Teradata UPDATE syntax</span> -</span><span id="L-125"><a href="#L-125"><span class="linenos">125</span></a> <span class="c1"># https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/Teradata-VantageTM-SQL-Data-Manipulation-Language-17.20/Statement-Syntax/UPDATE/UPDATE-Syntax-Basic-Form-FROM-Clause</span> -</span><span id="L-126"><a href="#L-126"><span class="linenos">126</span></a> <span class="k">def</span> <span class="nf">_parse_update</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">exp</span><span class="o">.</span><span class="n">Update</span><span class="p">:</span> -</span><span id="L-127"><a href="#L-127"><span class="linenos">127</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span> -</span><span id="L-128"><a href="#L-128"><span class="linenos">128</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Update</span><span class="p">,</span> -</span><span id="L-129"><a href="#L-129"><span class="linenos">129</span></a> <span class="o">**</span><span class="p">{</span> <span class="c1"># type: ignore</span> -</span><span id="L-130"><a href="#L-130"><span class="linenos">130</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_table</span><span class="p">(</span><span class="n">alias_tokens</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">UPDATE_ALIAS_TOKENS</span><span class="p">),</span> -</span><span id="L-131"><a href="#L-131"><span class="linenos">131</span></a> <span class="s2">"from"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_from</span><span class="p">(</span><span class="n">joins</span><span class="o">=</span><span class="kc">True</span><span class="p">),</span> -</span><span id="L-132"><a href="#L-132"><span class="linenos">132</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">SET</span><span class="p">)</span> -</span><span id="L-133"><a href="#L-133"><span class="linenos">133</span></a> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_csv</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_equality</span><span class="p">),</span> -</span><span id="L-134"><a href="#L-134"><span class="linenos">134</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_where</span><span class="p">(),</span> -</span><span id="L-135"><a href="#L-135"><span class="linenos">135</span></a> <span class="p">},</span> -</span><span id="L-136"><a href="#L-136"><span class="linenos">136</span></a> <span class="p">)</span> -</span><span id="L-137"><a href="#L-137"><span class="linenos">137</span></a> -</span><span id="L-138"><a href="#L-138"><span class="linenos">138</span></a> <span class="k">def</span> <span class="nf">_parse_rangen</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-139"><a href="#L-139"><span class="linenos">139</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_id_var</span><span class="p">()</span> -</span><span id="L-140"><a href="#L-140"><span class="linenos">140</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_match</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">BETWEEN</span><span class="p">)</span> -</span><span id="L-141"><a href="#L-141"><span class="linenos">141</span></a> -</span><span id="L-142"><a href="#L-142"><span class="linenos">142</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_csv</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_conjunction</span><span class="p">)</span> -</span><span id="L-143"><a href="#L-143"><span class="linenos">143</span></a> <span class="n">each</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match_text_seq</span><span class="p">(</span><span class="s2">"EACH"</span><span class="p">)</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_conjunction</span><span class="p">()</span> +</span><span id="L-116"><a href="#L-116"><span class="linenos">116</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">USING</span><span class="p">):</span> +</span><span id="L-117"><a href="#L-117"><span class="linenos">117</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">raise_error</span><span class="p">(</span><span class="s2">"Expected USING in TRANSLATE"</span><span class="p">)</span> +</span><span id="L-118"><a href="#L-118"><span class="linenos">118</span></a> +</span><span id="L-119"><a href="#L-119"><span class="linenos">119</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match_texts</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">CHARSET_TRANSLATORS</span><span class="p">):</span> +</span><span id="L-120"><a href="#L-120"><span class="linenos">120</span></a> <span class="n">charset_split</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_prev</span><span class="o">.</span><span class="n">text</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"_TO_"</span><span class="p">)</span> +</span><span id="L-121"><a href="#L-121"><span class="linenos">121</span></a> <span class="n">to</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">CharacterSet</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">charset_split</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span> +</span><span id="L-122"><a href="#L-122"><span class="linenos">122</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="L-123"><a href="#L-123"><span class="linenos">123</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">raise_error</span><span class="p">(</span><span class="s2">"Expected a character set translator after USING in TRANSLATE"</span><span class="p">)</span> +</span><span id="L-124"><a href="#L-124"><span class="linenos">124</span></a> +</span><span id="L-125"><a href="#L-125"><span class="linenos">125</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Cast</span> <span class="k">if</span> <span class="n">strict</span> <span class="k">else</span> <span class="n">exp</span><span class="o">.</span><span class="n">TryCast</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">this</span><span class="p">,</span> <span class="n">to</span><span class="o">=</span><span class="n">to</span><span class="p">)</span> +</span><span id="L-126"><a href="#L-126"><span class="linenos">126</span></a> +</span><span id="L-127"><a href="#L-127"><span class="linenos">127</span></a> <span class="c1"># FROM before SET in Teradata UPDATE syntax</span> +</span><span id="L-128"><a href="#L-128"><span class="linenos">128</span></a> <span class="c1"># https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/Teradata-VantageTM-SQL-Data-Manipulation-Language-17.20/Statement-Syntax/UPDATE/UPDATE-Syntax-Basic-Form-FROM-Clause</span> +</span><span id="L-129"><a href="#L-129"><span class="linenos">129</span></a> <span class="k">def</span> <span class="nf">_parse_update</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">exp</span><span class="o">.</span><span class="n">Update</span><span class="p">:</span> +</span><span id="L-130"><a href="#L-130"><span class="linenos">130</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span> +</span><span id="L-131"><a href="#L-131"><span class="linenos">131</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Update</span><span class="p">,</span> +</span><span id="L-132"><a href="#L-132"><span class="linenos">132</span></a> <span class="o">**</span><span class="p">{</span> <span class="c1"># type: ignore</span> +</span><span id="L-133"><a href="#L-133"><span class="linenos">133</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_table</span><span class="p">(</span><span class="n">alias_tokens</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">UPDATE_ALIAS_TOKENS</span><span class="p">),</span> +</span><span id="L-134"><a href="#L-134"><span class="linenos">134</span></a> <span class="s2">"from"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_from</span><span class="p">(</span><span class="n">joins</span><span class="o">=</span><span class="kc">True</span><span class="p">),</span> +</span><span id="L-135"><a href="#L-135"><span class="linenos">135</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">SET</span><span class="p">)</span> +</span><span id="L-136"><a href="#L-136"><span class="linenos">136</span></a> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_csv</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_equality</span><span class="p">),</span> +</span><span id="L-137"><a href="#L-137"><span class="linenos">137</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_where</span><span class="p">(),</span> +</span><span id="L-138"><a href="#L-138"><span class="linenos">138</span></a> <span class="p">},</span> +</span><span id="L-139"><a href="#L-139"><span class="linenos">139</span></a> <span class="p">)</span> +</span><span id="L-140"><a href="#L-140"><span class="linenos">140</span></a> +</span><span id="L-141"><a href="#L-141"><span class="linenos">141</span></a> <span class="k">def</span> <span class="nf">_parse_rangen</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-142"><a href="#L-142"><span class="linenos">142</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_id_var</span><span class="p">()</span> +</span><span id="L-143"><a href="#L-143"><span class="linenos">143</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_match</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">BETWEEN</span><span class="p">)</span> </span><span id="L-144"><a href="#L-144"><span class="linenos">144</span></a> -</span><span id="L-145"><a href="#L-145"><span class="linenos">145</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">RangeN</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">this</span><span class="p">,</span> <span class="n">expressions</span><span class="o">=</span><span class="n">expressions</span><span class="p">,</span> <span class="n">each</span><span class="o">=</span><span class="n">each</span><span class="p">)</span> -</span><span id="L-146"><a href="#L-146"><span class="linenos">146</span></a> -</span><span id="L-147"><a href="#L-147"><span class="linenos">147</span></a> <span class="k">class</span> <span class="nc">Generator</span><span class="p">(</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="p">):</span> -</span><span id="L-148"><a href="#L-148"><span class="linenos">148</span></a> <span class="n">JOIN_HINTS</span> <span class="o">=</span> <span class="kc">False</span> -</span><span id="L-149"><a href="#L-149"><span class="linenos">149</span></a> <span class="n">TABLE_HINTS</span> <span class="o">=</span> <span class="kc">False</span> -</span><span id="L-150"><a href="#L-150"><span class="linenos">150</span></a> <span class="n">QUERY_HINTS</span> <span class="o">=</span> <span class="kc">False</span> -</span><span id="L-151"><a href="#L-151"><span class="linenos">151</span></a> -</span><span id="L-152"><a href="#L-152"><span class="linenos">152</span></a> <span class="n">TYPE_MAPPING</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-153"><a href="#L-153"><span class="linenos">153</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TYPE_MAPPING</span><span class="p">,</span> -</span><span id="L-154"><a href="#L-154"><span class="linenos">154</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">GEOMETRY</span><span class="p">:</span> <span class="s2">"ST_GEOMETRY"</span><span class="p">,</span> -</span><span id="L-155"><a href="#L-155"><span class="linenos">155</span></a> <span class="p">}</span> -</span><span id="L-156"><a href="#L-156"><span class="linenos">156</span></a> -</span><span id="L-157"><a href="#L-157"><span class="linenos">157</span></a> <span class="n">PROPERTIES_LOCATION</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-158"><a href="#L-158"><span class="linenos">158</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">PROPERTIES_LOCATION</span><span class="p">,</span> -</span><span id="L-159"><a href="#L-159"><span class="linenos">159</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">OnCommitProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_INDEX</span><span class="p">,</span> -</span><span id="L-160"><a href="#L-160"><span class="linenos">160</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_EXPRESSION</span><span class="p">,</span> -</span><span id="L-161"><a href="#L-161"><span class="linenos">161</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StabilityProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_CREATE</span><span class="p">,</span> -</span><span id="L-162"><a href="#L-162"><span class="linenos">162</span></a> <span class="p">}</span> -</span><span id="L-163"><a href="#L-163"><span class="linenos">163</span></a> -</span><span id="L-164"><a href="#L-164"><span class="linenos">164</span></a> <span class="n">TRANSFORMS</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-165"><a href="#L-165"><span class="linenos">165</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TRANSFORMS</span><span class="p">,</span> -</span><span id="L-166"><a href="#L-166"><span class="linenos">166</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Max</span><span class="p">:</span> <span class="n">max_or_greatest</span><span class="p">,</span> -</span><span id="L-167"><a href="#L-167"><span class="linenos">167</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Min</span><span class="p">:</span> <span class="n">min_or_least</span><span class="p">,</span> -</span><span id="L-168"><a href="#L-168"><span class="linenos">168</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Select</span><span class="p">:</span> <span class="n">transforms</span><span class="o">.</span><span class="n">preprocess</span><span class="p">([</span><span class="n">transforms</span><span class="o">.</span><span class="n">eliminate_distinct_on</span><span class="p">]),</span> -</span><span id="L-169"><a href="#L-169"><span class="linenos">169</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StrToDate</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">"CAST(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2"> AS DATE FORMAT </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">format_time</span><span class="p">(</span><span class="n">e</span><span class="p">)</span><span class="si">}</span><span class="s2">)"</span><span class="p">,</span> -</span><span id="L-170"><a href="#L-170"><span class="linenos">170</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ToChar</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">function_fallback_sql</span><span class="p">(</span><span class="n">e</span><span class="p">),</span> -</span><span id="L-171"><a href="#L-171"><span class="linenos">171</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Use</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">"DATABASE </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span> -</span><span id="L-172"><a href="#L-172"><span class="linenos">172</span></a> <span class="p">}</span> -</span><span id="L-173"><a href="#L-173"><span class="linenos">173</span></a> -</span><span id="L-174"><a href="#L-174"><span class="linenos">174</span></a> <span class="k">def</span> <span class="nf">partitionedbyproperty_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-175"><a href="#L-175"><span class="linenos">175</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"PARTITION BY </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span> +</span><span id="L-145"><a href="#L-145"><span class="linenos">145</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_csv</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_conjunction</span><span class="p">)</span> +</span><span id="L-146"><a href="#L-146"><span class="linenos">146</span></a> <span class="n">each</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match_text_seq</span><span class="p">(</span><span class="s2">"EACH"</span><span class="p">)</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_conjunction</span><span class="p">()</span> +</span><span id="L-147"><a href="#L-147"><span class="linenos">147</span></a> +</span><span id="L-148"><a href="#L-148"><span class="linenos">148</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">RangeN</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">this</span><span class="p">,</span> <span class="n">expressions</span><span class="o">=</span><span class="n">expressions</span><span class="p">,</span> <span class="n">each</span><span class="o">=</span><span class="n">each</span><span class="p">)</span> +</span><span id="L-149"><a href="#L-149"><span class="linenos">149</span></a> +</span><span id="L-150"><a href="#L-150"><span class="linenos">150</span></a> <span class="k">class</span> <span class="nc">Generator</span><span class="p">(</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="p">):</span> +</span><span id="L-151"><a href="#L-151"><span class="linenos">151</span></a> <span class="n">JOIN_HINTS</span> <span class="o">=</span> <span class="kc">False</span> +</span><span id="L-152"><a href="#L-152"><span class="linenos">152</span></a> <span class="n">TABLE_HINTS</span> <span class="o">=</span> <span class="kc">False</span> +</span><span id="L-153"><a href="#L-153"><span class="linenos">153</span></a> <span class="n">QUERY_HINTS</span> <span class="o">=</span> <span class="kc">False</span> +</span><span id="L-154"><a href="#L-154"><span class="linenos">154</span></a> +</span><span id="L-155"><a href="#L-155"><span class="linenos">155</span></a> <span class="n">TYPE_MAPPING</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-156"><a href="#L-156"><span class="linenos">156</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TYPE_MAPPING</span><span class="p">,</span> +</span><span id="L-157"><a href="#L-157"><span class="linenos">157</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">GEOMETRY</span><span class="p">:</span> <span class="s2">"ST_GEOMETRY"</span><span class="p">,</span> +</span><span id="L-158"><a href="#L-158"><span class="linenos">158</span></a> <span class="p">}</span> +</span><span id="L-159"><a href="#L-159"><span class="linenos">159</span></a> +</span><span id="L-160"><a href="#L-160"><span class="linenos">160</span></a> <span class="n">PROPERTIES_LOCATION</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-161"><a href="#L-161"><span class="linenos">161</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">PROPERTIES_LOCATION</span><span class="p">,</span> +</span><span id="L-162"><a href="#L-162"><span class="linenos">162</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">OnCommitProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_INDEX</span><span class="p">,</span> +</span><span id="L-163"><a href="#L-163"><span class="linenos">163</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_EXPRESSION</span><span class="p">,</span> +</span><span id="L-164"><a href="#L-164"><span class="linenos">164</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StabilityProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_CREATE</span><span class="p">,</span> +</span><span id="L-165"><a href="#L-165"><span class="linenos">165</span></a> <span class="p">}</span> +</span><span id="L-166"><a href="#L-166"><span class="linenos">166</span></a> +</span><span id="L-167"><a href="#L-167"><span class="linenos">167</span></a> <span class="n">TRANSFORMS</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-168"><a href="#L-168"><span class="linenos">168</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TRANSFORMS</span><span class="p">,</span> +</span><span id="L-169"><a href="#L-169"><span class="linenos">169</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Max</span><span class="p">:</span> <span class="n">max_or_greatest</span><span class="p">,</span> +</span><span id="L-170"><a href="#L-170"><span class="linenos">170</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Min</span><span class="p">:</span> <span class="n">min_or_least</span><span class="p">,</span> +</span><span id="L-171"><a href="#L-171"><span class="linenos">171</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Select</span><span class="p">:</span> <span class="n">transforms</span><span class="o">.</span><span class="n">preprocess</span><span class="p">([</span><span class="n">transforms</span><span class="o">.</span><span class="n">eliminate_distinct_on</span><span class="p">]),</span> +</span><span id="L-172"><a href="#L-172"><span class="linenos">172</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StrToDate</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">"CAST(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2"> AS DATE FORMAT </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">format_time</span><span class="p">(</span><span class="n">e</span><span class="p">)</span><span class="si">}</span><span class="s2">)"</span><span class="p">,</span> +</span><span id="L-173"><a href="#L-173"><span class="linenos">173</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ToChar</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">function_fallback_sql</span><span class="p">(</span><span class="n">e</span><span class="p">),</span> +</span><span id="L-174"><a href="#L-174"><span class="linenos">174</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Use</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">"DATABASE </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span> +</span><span id="L-175"><a href="#L-175"><span class="linenos">175</span></a> <span class="p">}</span> </span><span id="L-176"><a href="#L-176"><span class="linenos">176</span></a> -</span><span id="L-177"><a href="#L-177"><span class="linenos">177</span></a> <span class="c1"># FROM before SET in Teradata UPDATE syntax</span> -</span><span id="L-178"><a href="#L-178"><span class="linenos">178</span></a> <span class="c1"># https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/Teradata-VantageTM-SQL-Data-Manipulation-Language-17.20/Statement-Syntax/UPDATE/UPDATE-Syntax-Basic-Form-FROM-Clause</span> -</span><span id="L-179"><a href="#L-179"><span class="linenos">179</span></a> <span class="k">def</span> <span class="nf">update_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Update</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-180"><a href="#L-180"><span class="linenos">180</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> -</span><span id="L-181"><a href="#L-181"><span class="linenos">181</span></a> <span class="n">from_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"from"</span><span class="p">)</span> -</span><span id="L-182"><a href="#L-182"><span class="linenos">182</span></a> <span class="n">set_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">flat</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> -</span><span id="L-183"><a href="#L-183"><span class="linenos">183</span></a> <span class="n">where_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"where"</span><span class="p">)</span> -</span><span id="L-184"><a href="#L-184"><span class="linenos">184</span></a> <span class="n">sql</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"UPDATE </span><span class="si">{</span><span class="n">this</span><span class="si">}{</span><span class="n">from_sql</span><span class="si">}</span><span class="s2"> SET </span><span class="si">{</span><span class="n">set_sql</span><span class="si">}{</span><span class="n">where_sql</span><span class="si">}</span><span class="s2">"</span> -</span><span id="L-185"><a href="#L-185"><span class="linenos">185</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">prepend_ctes</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">sql</span><span class="p">)</span> -</span><span id="L-186"><a href="#L-186"><span class="linenos">186</span></a> -</span><span id="L-187"><a href="#L-187"><span class="linenos">187</span></a> <span class="k">def</span> <span class="nf">mod_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Mod</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-188"><a href="#L-188"><span class="linenos">188</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">binary</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"MOD"</span><span class="p">)</span> -</span><span id="L-189"><a href="#L-189"><span class="linenos">189</span></a> -</span><span id="L-190"><a href="#L-190"><span class="linenos">190</span></a> <span class="k">def</span> <span class="nf">datatype_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-191"><a href="#L-191"><span class="linenos">191</span></a> <span class="n">type_sql</span> <span class="o">=</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">datatype_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> -</span><span id="L-192"><a href="#L-192"><span class="linenos">192</span></a> <span class="n">prefix_sql</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"prefix"</span><span class="p">)</span> -</span><span id="L-193"><a href="#L-193"><span class="linenos">193</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"SYSUDTLIB.</span><span class="si">{</span><span class="n">type_sql</span><span class="si">}</span><span class="s2">"</span> <span class="k">if</span> <span class="n">prefix_sql</span> <span class="k">else</span> <span class="n">type_sql</span> +</span><span id="L-177"><a href="#L-177"><span class="linenos">177</span></a> <span class="k">def</span> <span class="nf">tablesample_sql</span><span class="p">(</span> +</span><span id="L-178"><a href="#L-178"><span class="linenos">178</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">TableSample</span><span class="p">,</span> <span class="n">seed_prefix</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"SEED"</span><span class="p">,</span> <span class="n">sep</span><span class="o">=</span><span class="s2">" AS "</span> +</span><span id="L-179"><a href="#L-179"><span class="linenos">179</span></a> <span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-180"><a href="#L-180"><span class="linenos">180</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2"> SAMPLE </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span> +</span><span id="L-181"><a href="#L-181"><span class="linenos">181</span></a> +</span><span id="L-182"><a href="#L-182"><span class="linenos">182</span></a> <span class="k">def</span> <span class="nf">partitionedbyproperty_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-183"><a href="#L-183"><span class="linenos">183</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"PARTITION BY </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span> +</span><span id="L-184"><a href="#L-184"><span class="linenos">184</span></a> +</span><span id="L-185"><a href="#L-185"><span class="linenos">185</span></a> <span class="c1"># FROM before SET in Teradata UPDATE syntax</span> +</span><span id="L-186"><a href="#L-186"><span class="linenos">186</span></a> <span class="c1"># https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/Teradata-VantageTM-SQL-Data-Manipulation-Language-17.20/Statement-Syntax/UPDATE/UPDATE-Syntax-Basic-Form-FROM-Clause</span> +</span><span id="L-187"><a href="#L-187"><span class="linenos">187</span></a> <span class="k">def</span> <span class="nf">update_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Update</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-188"><a href="#L-188"><span class="linenos">188</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> +</span><span id="L-189"><a href="#L-189"><span class="linenos">189</span></a> <span class="n">from_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"from"</span><span class="p">)</span> +</span><span id="L-190"><a href="#L-190"><span class="linenos">190</span></a> <span class="n">set_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">flat</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="L-191"><a href="#L-191"><span class="linenos">191</span></a> <span class="n">where_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"where"</span><span class="p">)</span> +</span><span id="L-192"><a href="#L-192"><span class="linenos">192</span></a> <span class="n">sql</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"UPDATE </span><span class="si">{</span><span class="n">this</span><span class="si">}{</span><span class="n">from_sql</span><span class="si">}</span><span class="s2"> SET </span><span class="si">{</span><span class="n">set_sql</span><span class="si">}{</span><span class="n">where_sql</span><span class="si">}</span><span class="s2">"</span> +</span><span id="L-193"><a href="#L-193"><span class="linenos">193</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">prepend_ctes</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">sql</span><span class="p">)</span> </span><span id="L-194"><a href="#L-194"><span class="linenos">194</span></a> -</span><span id="L-195"><a href="#L-195"><span class="linenos">195</span></a> <span class="k">def</span> <span class="nf">rangen_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">RangeN</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-196"><a href="#L-196"><span class="linenos">196</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> -</span><span id="L-197"><a href="#L-197"><span class="linenos">197</span></a> <span class="n">expressions_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> -</span><span id="L-198"><a href="#L-198"><span class="linenos">198</span></a> <span class="n">each_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"each"</span><span class="p">)</span> -</span><span id="L-199"><a href="#L-199"><span class="linenos">199</span></a> <span class="n">each_sql</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">" EACH </span><span class="si">{</span><span class="n">each_sql</span><span class="si">}</span><span class="s2">"</span> <span class="k">if</span> <span class="n">each_sql</span> <span class="k">else</span> <span class="s2">""</span> -</span><span id="L-200"><a href="#L-200"><span class="linenos">200</span></a> -</span><span id="L-201"><a href="#L-201"><span class="linenos">201</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"RANGE_N(</span><span class="si">{</span><span class="n">this</span><span class="si">}</span><span class="s2"> BETWEEN </span><span class="si">{</span><span class="n">expressions_sql</span><span class="si">}{</span><span class="n">each_sql</span><span class="si">}</span><span class="s2">)"</span> +</span><span id="L-195"><a href="#L-195"><span class="linenos">195</span></a> <span class="k">def</span> <span class="nf">mod_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Mod</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-196"><a href="#L-196"><span class="linenos">196</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">binary</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"MOD"</span><span class="p">)</span> +</span><span id="L-197"><a href="#L-197"><span class="linenos">197</span></a> +</span><span id="L-198"><a href="#L-198"><span class="linenos">198</span></a> <span class="k">def</span> <span class="nf">datatype_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-199"><a href="#L-199"><span class="linenos">199</span></a> <span class="n">type_sql</span> <span class="o">=</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">datatype_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> +</span><span id="L-200"><a href="#L-200"><span class="linenos">200</span></a> <span class="n">prefix_sql</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"prefix"</span><span class="p">)</span> +</span><span id="L-201"><a href="#L-201"><span class="linenos">201</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"SYSUDTLIB.</span><span class="si">{</span><span class="n">type_sql</span><span class="si">}</span><span class="s2">"</span> <span class="k">if</span> <span class="n">prefix_sql</span> <span class="k">else</span> <span class="n">type_sql</span> </span><span id="L-202"><a href="#L-202"><span class="linenos">202</span></a> -</span><span id="L-203"><a href="#L-203"><span class="linenos">203</span></a> <span class="k">def</span> <span class="nf">createable_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Create</span><span class="p">,</span> <span class="n">locations</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">DefaultDict</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-204"><a href="#L-204"><span class="linenos">204</span></a> <span class="n">kind</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> -</span><span id="L-205"><a href="#L-205"><span class="linenos">205</span></a> <span class="k">if</span> <span class="n">kind</span> <span class="o">==</span> <span class="s2">"TABLE"</span> <span class="ow">and</span> <span class="n">locations</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_NAME</span><span class="p">):</span> -</span><span id="L-206"><a href="#L-206"><span class="linenos">206</span></a> <span class="n">this_name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> -</span><span id="L-207"><a href="#L-207"><span class="linenos">207</span></a> <span class="n">this_properties</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">properties</span><span class="p">(</span> -</span><span id="L-208"><a href="#L-208"><span class="linenos">208</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="n">locations</span><span class="p">[</span><span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_NAME</span><span class="p">]),</span> -</span><span id="L-209"><a href="#L-209"><span class="linenos">209</span></a> <span class="n">wrapped</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> -</span><span id="L-210"><a href="#L-210"><span class="linenos">210</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">","</span><span class="p">,</span> -</span><span id="L-211"><a href="#L-211"><span class="linenos">211</span></a> <span class="p">)</span> -</span><span id="L-212"><a href="#L-212"><span class="linenos">212</span></a> <span class="n">this_schema</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">schema_columns_sql</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">this</span><span class="p">)</span> -</span><span id="L-213"><a href="#L-213"><span class="linenos">213</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">this_name</span><span class="si">}{</span><span class="n">this_properties</span><span class="si">}{</span><span class="bp">self</span><span class="o">.</span><span class="n">sep</span><span class="p">()</span><span class="si">}{</span><span class="n">this_schema</span><span class="si">}</span><span class="s2">"</span> -</span><span id="L-214"><a href="#L-214"><span class="linenos">214</span></a> -</span><span id="L-215"><a href="#L-215"><span class="linenos">215</span></a> <span class="k">return</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">createable_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">locations</span><span class="p">)</span> +</span><span id="L-203"><a href="#L-203"><span class="linenos">203</span></a> <span class="k">def</span> <span class="nf">rangen_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">RangeN</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-204"><a href="#L-204"><span class="linenos">204</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> +</span><span id="L-205"><a href="#L-205"><span class="linenos">205</span></a> <span class="n">expressions_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> +</span><span id="L-206"><a href="#L-206"><span class="linenos">206</span></a> <span class="n">each_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"each"</span><span class="p">)</span> +</span><span id="L-207"><a href="#L-207"><span class="linenos">207</span></a> <span class="n">each_sql</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">" EACH </span><span class="si">{</span><span class="n">each_sql</span><span class="si">}</span><span class="s2">"</span> <span class="k">if</span> <span class="n">each_sql</span> <span class="k">else</span> <span class="s2">""</span> +</span><span id="L-208"><a href="#L-208"><span class="linenos">208</span></a> +</span><span id="L-209"><a href="#L-209"><span class="linenos">209</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"RANGE_N(</span><span class="si">{</span><span class="n">this</span><span class="si">}</span><span class="s2"> BETWEEN </span><span class="si">{</span><span class="n">expressions_sql</span><span class="si">}{</span><span class="n">each_sql</span><span class="si">}</span><span class="s2">)"</span> +</span><span id="L-210"><a href="#L-210"><span class="linenos">210</span></a> +</span><span id="L-211"><a href="#L-211"><span class="linenos">211</span></a> <span class="k">def</span> <span class="nf">createable_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Create</span><span class="p">,</span> <span class="n">locations</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">DefaultDict</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-212"><a href="#L-212"><span class="linenos">212</span></a> <span class="n">kind</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> +</span><span id="L-213"><a href="#L-213"><span class="linenos">213</span></a> <span class="k">if</span> <span class="n">kind</span> <span class="o">==</span> <span class="s2">"TABLE"</span> <span class="ow">and</span> <span class="n">locations</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_NAME</span><span class="p">):</span> +</span><span id="L-214"><a href="#L-214"><span class="linenos">214</span></a> <span class="n">this_name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> +</span><span id="L-215"><a href="#L-215"><span class="linenos">215</span></a> <span class="n">this_properties</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">properties</span><span class="p">(</span> +</span><span id="L-216"><a href="#L-216"><span class="linenos">216</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="n">locations</span><span class="p">[</span><span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_NAME</span><span class="p">]),</span> +</span><span id="L-217"><a href="#L-217"><span class="linenos">217</span></a> <span class="n">wrapped</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> +</span><span id="L-218"><a href="#L-218"><span class="linenos">218</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">","</span><span class="p">,</span> +</span><span id="L-219"><a href="#L-219"><span class="linenos">219</span></a> <span class="p">)</span> +</span><span id="L-220"><a href="#L-220"><span class="linenos">220</span></a> <span class="n">this_schema</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">schema_columns_sql</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">this</span><span class="p">)</span> +</span><span id="L-221"><a href="#L-221"><span class="linenos">221</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">this_name</span><span class="si">}{</span><span class="n">this_properties</span><span class="si">}{</span><span class="bp">self</span><span class="o">.</span><span class="n">sep</span><span class="p">()</span><span class="si">}{</span><span class="n">this_schema</span><span class="si">}</span><span class="s2">"</span> +</span><span id="L-222"><a href="#L-222"><span class="linenos">222</span></a> +</span><span id="L-223"><a href="#L-223"><span class="linenos">223</span></a> <span class="k">return</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">createable_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">locations</span><span class="p">)</span> </span></pre></div> @@ -516,174 +530,182 @@ </span><span id="Teradata-46"><a href="#Teradata-46"><span class="linenos"> 46</span></a> <span class="s2">"MOD"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">MOD</span><span class="p">,</span> </span><span id="Teradata-47"><a href="#Teradata-47"><span class="linenos"> 47</span></a> <span class="s2">"NE"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">NEQ</span><span class="p">,</span> </span><span id="Teradata-48"><a href="#Teradata-48"><span class="linenos"> 48</span></a> <span class="s2">"NOT="</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">NEQ</span><span class="p">,</span> -</span><span id="Teradata-49"><a href="#Teradata-49"><span class="linenos"> 49</span></a> <span class="s2">"SEL"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">SELECT</span><span class="p">,</span> -</span><span id="Teradata-50"><a href="#Teradata-50"><span class="linenos"> 50</span></a> <span class="s2">"ST_GEOMETRY"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">GEOMETRY</span><span class="p">,</span> -</span><span id="Teradata-51"><a href="#Teradata-51"><span class="linenos"> 51</span></a> <span class="s2">"TOP"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">TOP</span><span class="p">,</span> -</span><span id="Teradata-52"><a href="#Teradata-52"><span class="linenos"> 52</span></a> <span class="p">}</span> -</span><span id="Teradata-53"><a href="#Teradata-53"><span class="linenos"> 53</span></a> -</span><span id="Teradata-54"><a href="#Teradata-54"><span class="linenos"> 54</span></a> <span class="c1"># Teradata does not support % as a modulo operator</span> -</span><span id="Teradata-55"><a href="#Teradata-55"><span class="linenos"> 55</span></a> <span class="n">SINGLE_TOKENS</span> <span class="o">=</span> <span class="p">{</span><span class="o">**</span><span class="n">tokens</span><span class="o">.</span><span class="n">Tokenizer</span><span class="o">.</span><span class="n">SINGLE_TOKENS</span><span class="p">}</span> -</span><span id="Teradata-56"><a href="#Teradata-56"><span class="linenos"> 56</span></a> <span class="n">SINGLE_TOKENS</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">"%"</span><span class="p">)</span> -</span><span id="Teradata-57"><a href="#Teradata-57"><span class="linenos"> 57</span></a> -</span><span id="Teradata-58"><a href="#Teradata-58"><span class="linenos"> 58</span></a> <span class="k">class</span> <span class="nc">Parser</span><span class="p">(</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="p">):</span> -</span><span id="Teradata-59"><a href="#Teradata-59"><span class="linenos"> 59</span></a> <span class="n">CHARSET_TRANSLATORS</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Teradata-60"><a href="#Teradata-60"><span class="linenos"> 60</span></a> <span class="s2">"GRAPHIC_TO_KANJISJIS"</span><span class="p">,</span> -</span><span id="Teradata-61"><a href="#Teradata-61"><span class="linenos"> 61</span></a> <span class="s2">"GRAPHIC_TO_LATIN"</span><span class="p">,</span> -</span><span id="Teradata-62"><a href="#Teradata-62"><span class="linenos"> 62</span></a> <span class="s2">"GRAPHIC_TO_UNICODE"</span><span class="p">,</span> -</span><span id="Teradata-63"><a href="#Teradata-63"><span class="linenos"> 63</span></a> <span class="s2">"GRAPHIC_TO_UNICODE_PadSpace"</span><span class="p">,</span> -</span><span id="Teradata-64"><a href="#Teradata-64"><span class="linenos"> 64</span></a> <span class="s2">"KANJI1_KanjiEBCDIC_TO_UNICODE"</span><span class="p">,</span> -</span><span id="Teradata-65"><a href="#Teradata-65"><span class="linenos"> 65</span></a> <span class="s2">"KANJI1_KanjiEUC_TO_UNICODE"</span><span class="p">,</span> -</span><span id="Teradata-66"><a href="#Teradata-66"><span class="linenos"> 66</span></a> <span class="s2">"KANJI1_KANJISJIS_TO_UNICODE"</span><span class="p">,</span> -</span><span id="Teradata-67"><a href="#Teradata-67"><span class="linenos"> 67</span></a> <span class="s2">"KANJI1_SBC_TO_UNICODE"</span><span class="p">,</span> -</span><span id="Teradata-68"><a href="#Teradata-68"><span class="linenos"> 68</span></a> <span class="s2">"KANJISJIS_TO_GRAPHIC"</span><span class="p">,</span> -</span><span id="Teradata-69"><a href="#Teradata-69"><span class="linenos"> 69</span></a> <span class="s2">"KANJISJIS_TO_LATIN"</span><span class="p">,</span> -</span><span id="Teradata-70"><a href="#Teradata-70"><span class="linenos"> 70</span></a> <span class="s2">"KANJISJIS_TO_UNICODE"</span><span class="p">,</span> -</span><span id="Teradata-71"><a href="#Teradata-71"><span class="linenos"> 71</span></a> <span class="s2">"LATIN_TO_GRAPHIC"</span><span class="p">,</span> -</span><span id="Teradata-72"><a href="#Teradata-72"><span class="linenos"> 72</span></a> <span class="s2">"LATIN_TO_KANJISJIS"</span><span class="p">,</span> -</span><span id="Teradata-73"><a href="#Teradata-73"><span class="linenos"> 73</span></a> <span class="s2">"LATIN_TO_UNICODE"</span><span class="p">,</span> -</span><span id="Teradata-74"><a href="#Teradata-74"><span class="linenos"> 74</span></a> <span class="s2">"LOCALE_TO_UNICODE"</span><span class="p">,</span> -</span><span id="Teradata-75"><a href="#Teradata-75"><span class="linenos"> 75</span></a> <span class="s2">"UNICODE_TO_GRAPHIC"</span><span class="p">,</span> -</span><span id="Teradata-76"><a href="#Teradata-76"><span class="linenos"> 76</span></a> <span class="s2">"UNICODE_TO_GRAPHIC_PadGraphic"</span><span class="p">,</span> -</span><span id="Teradata-77"><a href="#Teradata-77"><span class="linenos"> 77</span></a> <span class="s2">"UNICODE_TO_GRAPHIC_VarGraphic"</span><span class="p">,</span> -</span><span id="Teradata-78"><a href="#Teradata-78"><span class="linenos"> 78</span></a> <span class="s2">"UNICODE_TO_KANJI1_KanjiEBCDIC"</span><span class="p">,</span> -</span><span id="Teradata-79"><a href="#Teradata-79"><span class="linenos"> 79</span></a> <span class="s2">"UNICODE_TO_KANJI1_KanjiEUC"</span><span class="p">,</span> -</span><span id="Teradata-80"><a href="#Teradata-80"><span class="linenos"> 80</span></a> <span class="s2">"UNICODE_TO_KANJI1_KANJISJIS"</span><span class="p">,</span> -</span><span id="Teradata-81"><a href="#Teradata-81"><span class="linenos"> 81</span></a> <span class="s2">"UNICODE_TO_KANJI1_SBC"</span><span class="p">,</span> -</span><span id="Teradata-82"><a href="#Teradata-82"><span class="linenos"> 82</span></a> <span class="s2">"UNICODE_TO_KANJISJIS"</span><span class="p">,</span> -</span><span id="Teradata-83"><a href="#Teradata-83"><span class="linenos"> 83</span></a> <span class="s2">"UNICODE_TO_LATIN"</span><span class="p">,</span> -</span><span id="Teradata-84"><a href="#Teradata-84"><span class="linenos"> 84</span></a> <span class="s2">"UNICODE_TO_LOCALE"</span><span class="p">,</span> -</span><span id="Teradata-85"><a href="#Teradata-85"><span class="linenos"> 85</span></a> <span class="s2">"UNICODE_TO_UNICODE_FoldSpace"</span><span class="p">,</span> -</span><span id="Teradata-86"><a href="#Teradata-86"><span class="linenos"> 86</span></a> <span class="s2">"UNICODE_TO_UNICODE_Fullwidth"</span><span class="p">,</span> -</span><span id="Teradata-87"><a href="#Teradata-87"><span class="linenos"> 87</span></a> <span class="s2">"UNICODE_TO_UNICODE_Halfwidth"</span><span class="p">,</span> -</span><span id="Teradata-88"><a href="#Teradata-88"><span class="linenos"> 88</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFC"</span><span class="p">,</span> -</span><span id="Teradata-89"><a href="#Teradata-89"><span class="linenos"> 89</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFD"</span><span class="p">,</span> -</span><span id="Teradata-90"><a href="#Teradata-90"><span class="linenos"> 90</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFKC"</span><span class="p">,</span> -</span><span id="Teradata-91"><a href="#Teradata-91"><span class="linenos"> 91</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFKD"</span><span class="p">,</span> -</span><span id="Teradata-92"><a href="#Teradata-92"><span class="linenos"> 92</span></a> <span class="p">}</span> -</span><span id="Teradata-93"><a href="#Teradata-93"><span class="linenos"> 93</span></a> -</span><span id="Teradata-94"><a href="#Teradata-94"><span class="linenos"> 94</span></a> <span class="n">FUNC_TOKENS</span> <span class="o">=</span> <span class="p">{</span><span class="o">*</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNC_TOKENS</span><span class="p">}</span> -</span><span id="Teradata-95"><a href="#Teradata-95"><span class="linenos"> 95</span></a> <span class="n">FUNC_TOKENS</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">REPLACE</span><span class="p">)</span> +</span><span id="Teradata-49"><a href="#Teradata-49"><span class="linenos"> 49</span></a> <span class="s2">"SAMPLE"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">TABLE_SAMPLE</span><span class="p">,</span> +</span><span id="Teradata-50"><a href="#Teradata-50"><span class="linenos"> 50</span></a> <span class="s2">"SEL"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">SELECT</span><span class="p">,</span> +</span><span id="Teradata-51"><a href="#Teradata-51"><span class="linenos"> 51</span></a> <span class="s2">"ST_GEOMETRY"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">GEOMETRY</span><span class="p">,</span> +</span><span id="Teradata-52"><a href="#Teradata-52"><span class="linenos"> 52</span></a> <span class="s2">"TOP"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">TOP</span><span class="p">,</span> +</span><span id="Teradata-53"><a href="#Teradata-53"><span class="linenos"> 53</span></a> <span class="p">}</span> +</span><span id="Teradata-54"><a href="#Teradata-54"><span class="linenos"> 54</span></a> +</span><span id="Teradata-55"><a href="#Teradata-55"><span class="linenos"> 55</span></a> <span class="c1"># Teradata does not support % as a modulo operator</span> +</span><span id="Teradata-56"><a href="#Teradata-56"><span class="linenos"> 56</span></a> <span class="n">SINGLE_TOKENS</span> <span class="o">=</span> <span class="p">{</span><span class="o">**</span><span class="n">tokens</span><span class="o">.</span><span class="n">Tokenizer</span><span class="o">.</span><span class="n">SINGLE_TOKENS</span><span class="p">}</span> +</span><span id="Teradata-57"><a href="#Teradata-57"><span class="linenos"> 57</span></a> <span class="n">SINGLE_TOKENS</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">"%"</span><span class="p">)</span> +</span><span id="Teradata-58"><a href="#Teradata-58"><span class="linenos"> 58</span></a> +</span><span id="Teradata-59"><a href="#Teradata-59"><span class="linenos"> 59</span></a> <span class="k">class</span> <span class="nc">Parser</span><span class="p">(</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="p">):</span> +</span><span id="Teradata-60"><a href="#Teradata-60"><span class="linenos"> 60</span></a> <span class="n">TABLESAMPLE_CSV</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="Teradata-61"><a href="#Teradata-61"><span class="linenos"> 61</span></a> +</span><span id="Teradata-62"><a href="#Teradata-62"><span class="linenos"> 62</span></a> <span class="n">CHARSET_TRANSLATORS</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Teradata-63"><a href="#Teradata-63"><span class="linenos"> 63</span></a> <span class="s2">"GRAPHIC_TO_KANJISJIS"</span><span class="p">,</span> +</span><span id="Teradata-64"><a href="#Teradata-64"><span class="linenos"> 64</span></a> <span class="s2">"GRAPHIC_TO_LATIN"</span><span class="p">,</span> +</span><span id="Teradata-65"><a href="#Teradata-65"><span class="linenos"> 65</span></a> <span class="s2">"GRAPHIC_TO_UNICODE"</span><span class="p">,</span> +</span><span id="Teradata-66"><a href="#Teradata-66"><span class="linenos"> 66</span></a> <span class="s2">"GRAPHIC_TO_UNICODE_PadSpace"</span><span class="p">,</span> +</span><span id="Teradata-67"><a href="#Teradata-67"><span class="linenos"> 67</span></a> <span class="s2">"KANJI1_KanjiEBCDIC_TO_UNICODE"</span><span class="p">,</span> +</span><span id="Teradata-68"><a href="#Teradata-68"><span class="linenos"> 68</span></a> <span class="s2">"KANJI1_KanjiEUC_TO_UNICODE"</span><span class="p">,</span> +</span><span id="Teradata-69"><a href="#Teradata-69"><span class="linenos"> 69</span></a> <span class="s2">"KANJI1_KANJISJIS_TO_UNICODE"</span><span class="p">,</span> +</span><span id="Teradata-70"><a href="#Teradata-70"><span class="linenos"> 70</span></a> <span class="s2">"KANJI1_SBC_TO_UNICODE"</span><span class="p">,</span> +</span><span id="Teradata-71"><a href="#Teradata-71"><span class="linenos"> 71</span></a> <span class="s2">"KANJISJIS_TO_GRAPHIC"</span><span class="p">,</span> +</span><span id="Teradata-72"><a href="#Teradata-72"><span class="linenos"> 72</span></a> <span class="s2">"KANJISJIS_TO_LATIN"</span><span class="p">,</span> +</span><span id="Teradata-73"><a href="#Teradata-73"><span class="linenos"> 73</span></a> <span class="s2">"KANJISJIS_TO_UNICODE"</span><span class="p">,</span> +</span><span id="Teradata-74"><a href="#Teradata-74"><span class="linenos"> 74</span></a> <span class="s2">"LATIN_TO_GRAPHIC"</span><span class="p">,</span> +</span><span id="Teradata-75"><a href="#Teradata-75"><span class="linenos"> 75</span></a> <span class="s2">"LATIN_TO_KANJISJIS"</span><span class="p">,</span> +</span><span id="Teradata-76"><a href="#Teradata-76"><span class="linenos"> 76</span></a> <span class="s2">"LATIN_TO_UNICODE"</span><span class="p">,</span> +</span><span id="Teradata-77"><a href="#Teradata-77"><span class="linenos"> 77</span></a> <span class="s2">"LOCALE_TO_UNICODE"</span><span class="p">,</span> +</span><span id="Teradata-78"><a href="#Teradata-78"><span class="linenos"> 78</span></a> <span class="s2">"UNICODE_TO_GRAPHIC"</span><span class="p">,</span> +</span><span id="Teradata-79"><a href="#Teradata-79"><span class="linenos"> 79</span></a> <span class="s2">"UNICODE_TO_GRAPHIC_PadGraphic"</span><span class="p">,</span> +</span><span id="Teradata-80"><a href="#Teradata-80"><span class="linenos"> 80</span></a> <span class="s2">"UNICODE_TO_GRAPHIC_VarGraphic"</span><span class="p">,</span> +</span><span id="Teradata-81"><a href="#Teradata-81"><span class="linenos"> 81</span></a> <span class="s2">"UNICODE_TO_KANJI1_KanjiEBCDIC"</span><span class="p">,</span> +</span><span id="Teradata-82"><a href="#Teradata-82"><span class="linenos"> 82</span></a> <span class="s2">"UNICODE_TO_KANJI1_KanjiEUC"</span><span class="p">,</span> +</span><span id="Teradata-83"><a href="#Teradata-83"><span class="linenos"> 83</span></a> <span class="s2">"UNICODE_TO_KANJI1_KANJISJIS"</span><span class="p">,</span> +</span><span id="Teradata-84"><a href="#Teradata-84"><span class="linenos"> 84</span></a> <span class="s2">"UNICODE_TO_KANJI1_SBC"</span><span class="p">,</span> +</span><span id="Teradata-85"><a href="#Teradata-85"><span class="linenos"> 85</span></a> <span class="s2">"UNICODE_TO_KANJISJIS"</span><span class="p">,</span> +</span><span id="Teradata-86"><a href="#Teradata-86"><span class="linenos"> 86</span></a> <span class="s2">"UNICODE_TO_LATIN"</span><span class="p">,</span> +</span><span id="Teradata-87"><a href="#Teradata-87"><span class="linenos"> 87</span></a> <span class="s2">"UNICODE_TO_LOCALE"</span><span class="p">,</span> +</span><span id="Teradata-88"><a href="#Teradata-88"><span class="linenos"> 88</span></a> <span class="s2">"UNICODE_TO_UNICODE_FoldSpace"</span><span class="p">,</span> +</span><span id="Teradata-89"><a href="#Teradata-89"><span class="linenos"> 89</span></a> <span class="s2">"UNICODE_TO_UNICODE_Fullwidth"</span><span class="p">,</span> +</span><span id="Teradata-90"><a href="#Teradata-90"><span class="linenos"> 90</span></a> <span class="s2">"UNICODE_TO_UNICODE_Halfwidth"</span><span class="p">,</span> +</span><span id="Teradata-91"><a href="#Teradata-91"><span class="linenos"> 91</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFC"</span><span class="p">,</span> +</span><span id="Teradata-92"><a href="#Teradata-92"><span class="linenos"> 92</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFD"</span><span class="p">,</span> +</span><span id="Teradata-93"><a href="#Teradata-93"><span class="linenos"> 93</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFKC"</span><span class="p">,</span> +</span><span id="Teradata-94"><a href="#Teradata-94"><span class="linenos"> 94</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFKD"</span><span class="p">,</span> +</span><span id="Teradata-95"><a href="#Teradata-95"><span class="linenos"> 95</span></a> <span class="p">}</span> </span><span id="Teradata-96"><a href="#Teradata-96"><span class="linenos"> 96</span></a> -</span><span id="Teradata-97"><a href="#Teradata-97"><span class="linenos"> 97</span></a> <span class="n">STATEMENT_PARSERS</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Teradata-98"><a href="#Teradata-98"><span class="linenos"> 98</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">STATEMENT_PARSERS</span><span class="p">,</span> -</span><span id="Teradata-99"><a href="#Teradata-99"><span class="linenos"> 99</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">DATABASE</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span> -</span><span id="Teradata-100"><a href="#Teradata-100"><span class="linenos">100</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Use</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_table</span><span class="p">(</span><span class="n">schema</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> -</span><span id="Teradata-101"><a href="#Teradata-101"><span class="linenos">101</span></a> <span class="p">),</span> -</span><span id="Teradata-102"><a href="#Teradata-102"><span class="linenos">102</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">REPLACE</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_create</span><span class="p">(),</span> -</span><span id="Teradata-103"><a href="#Teradata-103"><span class="linenos">103</span></a> <span class="p">}</span> -</span><span id="Teradata-104"><a href="#Teradata-104"><span class="linenos">104</span></a> -</span><span id="Teradata-105"><a href="#Teradata-105"><span class="linenos">105</span></a> <span class="n">FUNCTION_PARSERS</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Teradata-106"><a href="#Teradata-106"><span class="linenos">106</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNCTION_PARSERS</span><span class="p">,</span> -</span><span id="Teradata-107"><a href="#Teradata-107"><span class="linenos">107</span></a> <span class="s2">"RANGE_N"</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_rangen</span><span class="p">(),</span> -</span><span id="Teradata-108"><a href="#Teradata-108"><span class="linenos">108</span></a> <span class="s2">"TRANSLATE"</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_translate</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">STRICT_CAST</span><span class="p">),</span> -</span><span id="Teradata-109"><a href="#Teradata-109"><span class="linenos">109</span></a> <span class="p">}</span> -</span><span id="Teradata-110"><a href="#Teradata-110"><span class="linenos">110</span></a> -</span><span id="Teradata-111"><a href="#Teradata-111"><span class="linenos">111</span></a> <span class="k">def</span> <span class="nf">_parse_translate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">strict</span><span class="p">:</span> <span class="nb">bool</span><span class="p">)</span> <span class="o">-></span> <span class="n">exp</span><span class="o">.</span><span class="n">Expression</span><span class="p">:</span> -</span><span id="Teradata-112"><a href="#Teradata-112"><span class="linenos">112</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_conjunction</span><span class="p">()</span> +</span><span id="Teradata-97"><a href="#Teradata-97"><span class="linenos"> 97</span></a> <span class="n">FUNC_TOKENS</span> <span class="o">=</span> <span class="p">{</span><span class="o">*</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNC_TOKENS</span><span class="p">}</span> +</span><span id="Teradata-98"><a href="#Teradata-98"><span class="linenos"> 98</span></a> <span class="n">FUNC_TOKENS</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">REPLACE</span><span class="p">)</span> +</span><span id="Teradata-99"><a href="#Teradata-99"><span class="linenos"> 99</span></a> +</span><span id="Teradata-100"><a href="#Teradata-100"><span class="linenos">100</span></a> <span class="n">STATEMENT_PARSERS</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Teradata-101"><a href="#Teradata-101"><span class="linenos">101</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">STATEMENT_PARSERS</span><span class="p">,</span> +</span><span id="Teradata-102"><a href="#Teradata-102"><span class="linenos">102</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">DATABASE</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span> +</span><span id="Teradata-103"><a href="#Teradata-103"><span class="linenos">103</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Use</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_table</span><span class="p">(</span><span class="n">schema</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> +</span><span id="Teradata-104"><a href="#Teradata-104"><span class="linenos">104</span></a> <span class="p">),</span> +</span><span id="Teradata-105"><a href="#Teradata-105"><span class="linenos">105</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">REPLACE</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_create</span><span class="p">(),</span> +</span><span id="Teradata-106"><a href="#Teradata-106"><span class="linenos">106</span></a> <span class="p">}</span> +</span><span id="Teradata-107"><a href="#Teradata-107"><span class="linenos">107</span></a> +</span><span id="Teradata-108"><a href="#Teradata-108"><span class="linenos">108</span></a> <span class="n">FUNCTION_PARSERS</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Teradata-109"><a href="#Teradata-109"><span class="linenos">109</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNCTION_PARSERS</span><span class="p">,</span> +</span><span id="Teradata-110"><a href="#Teradata-110"><span class="linenos">110</span></a> <span class="s2">"RANGE_N"</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_rangen</span><span class="p">(),</span> +</span><span id="Teradata-111"><a href="#Teradata-111"><span class="linenos">111</span></a> <span class="s2">"TRANSLATE"</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_translate</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">STRICT_CAST</span><span class="p">),</span> +</span><span id="Teradata-112"><a href="#Teradata-112"><span class="linenos">112</span></a> <span class="p">}</span> </span><span id="Teradata-113"><a href="#Teradata-113"><span class="linenos">113</span></a> -</span><span id="Teradata-114"><a href="#Teradata-114"><span class="linenos">114</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">USING</span><span class="p">):</span> -</span><span id="Teradata-115"><a href="#Teradata-115"><span class="linenos">115</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">raise_error</span><span class="p">(</span><span class="s2">"Expected USING in TRANSLATE"</span><span class="p">)</span> +</span><span id="Teradata-114"><a href="#Teradata-114"><span class="linenos">114</span></a> <span class="k">def</span> <span class="nf">_parse_translate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">strict</span><span class="p">:</span> <span class="nb">bool</span><span class="p">)</span> <span class="o">-></span> <span class="n">exp</span><span class="o">.</span><span class="n">Expression</span><span class="p">:</span> +</span><span id="Teradata-115"><a href="#Teradata-115"><span class="linenos">115</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_conjunction</span><span class="p">()</span> </span><span id="Teradata-116"><a href="#Teradata-116"><span class="linenos">116</span></a> -</span><span id="Teradata-117"><a href="#Teradata-117"><span class="linenos">117</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match_texts</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">CHARSET_TRANSLATORS</span><span class="p">):</span> -</span><span id="Teradata-118"><a href="#Teradata-118"><span class="linenos">118</span></a> <span class="n">charset_split</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_prev</span><span class="o">.</span><span class="n">text</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"_TO_"</span><span class="p">)</span> -</span><span id="Teradata-119"><a href="#Teradata-119"><span class="linenos">119</span></a> <span class="n">to</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">CharacterSet</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">charset_split</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span> -</span><span id="Teradata-120"><a href="#Teradata-120"><span class="linenos">120</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="Teradata-121"><a href="#Teradata-121"><span class="linenos">121</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">raise_error</span><span class="p">(</span><span class="s2">"Expected a character set translator after USING in TRANSLATE"</span><span class="p">)</span> -</span><span id="Teradata-122"><a href="#Teradata-122"><span class="linenos">122</span></a> -</span><span id="Teradata-123"><a href="#Teradata-123"><span class="linenos">123</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Cast</span> <span class="k">if</span> <span class="n">strict</span> <span class="k">else</span> <span class="n">exp</span><span class="o">.</span><span class="n">TryCast</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">this</span><span class="p">,</span> <span class="n">to</span><span class="o">=</span><span class="n">to</span><span class="p">)</span> -</span><span id="Teradata-124"><a href="#Teradata-124"><span class="linenos">124</span></a> -</span><span id="Teradata-125"><a href="#Teradata-125"><span class="linenos">125</span></a> <span class="c1"># FROM before SET in Teradata UPDATE syntax</span> -</span><span id="Teradata-126"><a href="#Teradata-126"><span class="linenos">126</span></a> <span class="c1"># https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/Teradata-VantageTM-SQL-Data-Manipulation-Language-17.20/Statement-Syntax/UPDATE/UPDATE-Syntax-Basic-Form-FROM-Clause</span> -</span><span id="Teradata-127"><a href="#Teradata-127"><span class="linenos">127</span></a> <span class="k">def</span> <span class="nf">_parse_update</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">exp</span><span class="o">.</span><span class="n">Update</span><span class="p">:</span> -</span><span id="Teradata-128"><a href="#Teradata-128"><span class="linenos">128</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span> -</span><span id="Teradata-129"><a href="#Teradata-129"><span class="linenos">129</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Update</span><span class="p">,</span> -</span><span id="Teradata-130"><a href="#Teradata-130"><span class="linenos">130</span></a> <span class="o">**</span><span class="p">{</span> <span class="c1"># type: ignore</span> -</span><span id="Teradata-131"><a href="#Teradata-131"><span class="linenos">131</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_table</span><span class="p">(</span><span class="n">alias_tokens</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">UPDATE_ALIAS_TOKENS</span><span class="p">),</span> -</span><span id="Teradata-132"><a href="#Teradata-132"><span class="linenos">132</span></a> <span class="s2">"from"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_from</span><span class="p">(</span><span class="n">joins</span><span class="o">=</span><span class="kc">True</span><span class="p">),</span> -</span><span id="Teradata-133"><a href="#Teradata-133"><span class="linenos">133</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">SET</span><span class="p">)</span> -</span><span id="Teradata-134"><a href="#Teradata-134"><span class="linenos">134</span></a> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_csv</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_equality</span><span class="p">),</span> -</span><span id="Teradata-135"><a href="#Teradata-135"><span class="linenos">135</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_where</span><span class="p">(),</span> -</span><span id="Teradata-136"><a href="#Teradata-136"><span class="linenos">136</span></a> <span class="p">},</span> -</span><span id="Teradata-137"><a href="#Teradata-137"><span class="linenos">137</span></a> <span class="p">)</span> -</span><span id="Teradata-138"><a href="#Teradata-138"><span class="linenos">138</span></a> -</span><span id="Teradata-139"><a href="#Teradata-139"><span class="linenos">139</span></a> <span class="k">def</span> <span class="nf">_parse_rangen</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Teradata-140"><a href="#Teradata-140"><span class="linenos">140</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_id_var</span><span class="p">()</span> -</span><span id="Teradata-141"><a href="#Teradata-141"><span class="linenos">141</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_match</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">BETWEEN</span><span class="p">)</span> -</span><span id="Teradata-142"><a href="#Teradata-142"><span class="linenos">142</span></a> -</span><span id="Teradata-143"><a href="#Teradata-143"><span class="linenos">143</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_csv</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_conjunction</span><span class="p">)</span> -</span><span id="Teradata-144"><a href="#Teradata-144"><span class="linenos">144</span></a> <span class="n">each</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match_text_seq</span><span class="p">(</span><span class="s2">"EACH"</span><span class="p">)</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_conjunction</span><span class="p">()</span> +</span><span id="Teradata-117"><a href="#Teradata-117"><span class="linenos">117</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">USING</span><span class="p">):</span> +</span><span id="Teradata-118"><a href="#Teradata-118"><span class="linenos">118</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">raise_error</span><span class="p">(</span><span class="s2">"Expected USING in TRANSLATE"</span><span class="p">)</span> +</span><span id="Teradata-119"><a href="#Teradata-119"><span class="linenos">119</span></a> +</span><span id="Teradata-120"><a href="#Teradata-120"><span class="linenos">120</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match_texts</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">CHARSET_TRANSLATORS</span><span class="p">):</span> +</span><span id="Teradata-121"><a href="#Teradata-121"><span class="linenos">121</span></a> <span class="n">charset_split</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_prev</span><span class="o">.</span><span class="n">text</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"_TO_"</span><span class="p">)</span> +</span><span id="Teradata-122"><a href="#Teradata-122"><span class="linenos">122</span></a> <span class="n">to</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">CharacterSet</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">charset_split</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span> +</span><span id="Teradata-123"><a href="#Teradata-123"><span class="linenos">123</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="Teradata-124"><a href="#Teradata-124"><span class="linenos">124</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">raise_error</span><span class="p">(</span><span class="s2">"Expected a character set translator after USING in TRANSLATE"</span><span class="p">)</span> +</span><span id="Teradata-125"><a href="#Teradata-125"><span class="linenos">125</span></a> +</span><span id="Teradata-126"><a href="#Teradata-126"><span class="linenos">126</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Cast</span> <span class="k">if</span> <span class="n">strict</span> <span class="k">else</span> <span class="n">exp</span><span class="o">.</span><span class="n">TryCast</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">this</span><span class="p">,</span> <span class="n">to</span><span class="o">=</span><span class="n">to</span><span class="p">)</span> +</span><span id="Teradata-127"><a href="#Teradata-127"><span class="linenos">127</span></a> +</span><span id="Teradata-128"><a href="#Teradata-128"><span class="linenos">128</span></a> <span class="c1"># FROM before SET in Teradata UPDATE syntax</span> +</span><span id="Teradata-129"><a href="#Teradata-129"><span class="linenos">129</span></a> <span class="c1"># https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/Teradata-VantageTM-SQL-Data-Manipulation-Language-17.20/Statement-Syntax/UPDATE/UPDATE-Syntax-Basic-Form-FROM-Clause</span> +</span><span id="Teradata-130"><a href="#Teradata-130"><span class="linenos">130</span></a> <span class="k">def</span> <span class="nf">_parse_update</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">exp</span><span class="o">.</span><span class="n">Update</span><span class="p">:</span> +</span><span id="Teradata-131"><a href="#Teradata-131"><span class="linenos">131</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span> +</span><span id="Teradata-132"><a href="#Teradata-132"><span class="linenos">132</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Update</span><span class="p">,</span> +</span><span id="Teradata-133"><a href="#Teradata-133"><span class="linenos">133</span></a> <span class="o">**</span><span class="p">{</span> <span class="c1"># type: ignore</span> +</span><span id="Teradata-134"><a href="#Teradata-134"><span class="linenos">134</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_table</span><span class="p">(</span><span class="n">alias_tokens</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">UPDATE_ALIAS_TOKENS</span><span class="p">),</span> +</span><span id="Teradata-135"><a href="#Teradata-135"><span class="linenos">135</span></a> <span class="s2">"from"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_from</span><span class="p">(</span><span class="n">joins</span><span class="o">=</span><span class="kc">True</span><span class="p">),</span> +</span><span id="Teradata-136"><a href="#Teradata-136"><span class="linenos">136</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">SET</span><span class="p">)</span> +</span><span id="Teradata-137"><a href="#Teradata-137"><span class="linenos">137</span></a> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_csv</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_equality</span><span class="p">),</span> +</span><span id="Teradata-138"><a href="#Teradata-138"><span class="linenos">138</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_where</span><span class="p">(),</span> +</span><span id="Teradata-139"><a href="#Teradata-139"><span class="linenos">139</span></a> <span class="p">},</span> +</span><span id="Teradata-140"><a href="#Teradata-140"><span class="linenos">140</span></a> <span class="p">)</span> +</span><span id="Teradata-141"><a href="#Teradata-141"><span class="linenos">141</span></a> +</span><span id="Teradata-142"><a href="#Teradata-142"><span class="linenos">142</span></a> <span class="k">def</span> <span class="nf">_parse_rangen</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Teradata-143"><a href="#Teradata-143"><span class="linenos">143</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_id_var</span><span class="p">()</span> +</span><span id="Teradata-144"><a href="#Teradata-144"><span class="linenos">144</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_match</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">BETWEEN</span><span class="p">)</span> </span><span id="Teradata-145"><a href="#Teradata-145"><span class="linenos">145</span></a> -</span><span id="Teradata-146"><a href="#Teradata-146"><span class="linenos">146</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">RangeN</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">this</span><span class="p">,</span> <span class="n">expressions</span><span class="o">=</span><span class="n">expressions</span><span class="p">,</span> <span class="n">each</span><span class="o">=</span><span class="n">each</span><span class="p">)</span> -</span><span id="Teradata-147"><a href="#Teradata-147"><span class="linenos">147</span></a> -</span><span id="Teradata-148"><a href="#Teradata-148"><span class="linenos">148</span></a> <span class="k">class</span> <span class="nc">Generator</span><span class="p">(</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="p">):</span> -</span><span id="Teradata-149"><a href="#Teradata-149"><span class="linenos">149</span></a> <span class="n">JOIN_HINTS</span> <span class="o">=</span> <span class="kc">False</span> -</span><span id="Teradata-150"><a href="#Teradata-150"><span class="linenos">150</span></a> <span class="n">TABLE_HINTS</span> <span class="o">=</span> <span class="kc">False</span> -</span><span id="Teradata-151"><a href="#Teradata-151"><span class="linenos">151</span></a> <span class="n">QUERY_HINTS</span> <span class="o">=</span> <span class="kc">False</span> -</span><span id="Teradata-152"><a href="#Teradata-152"><span class="linenos">152</span></a> -</span><span id="Teradata-153"><a href="#Teradata-153"><span class="linenos">153</span></a> <span class="n">TYPE_MAPPING</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Teradata-154"><a href="#Teradata-154"><span class="linenos">154</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TYPE_MAPPING</span><span class="p">,</span> -</span><span id="Teradata-155"><a href="#Teradata-155"><span class="linenos">155</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">GEOMETRY</span><span class="p">:</span> <span class="s2">"ST_GEOMETRY"</span><span class="p">,</span> -</span><span id="Teradata-156"><a href="#Teradata-156"><span class="linenos">156</span></a> <span class="p">}</span> -</span><span id="Teradata-157"><a href="#Teradata-157"><span class="linenos">157</span></a> -</span><span id="Teradata-158"><a href="#Teradata-158"><span class="linenos">158</span></a> <span class="n">PROPERTIES_LOCATION</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Teradata-159"><a href="#Teradata-159"><span class="linenos">159</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">PROPERTIES_LOCATION</span><span class="p">,</span> -</span><span id="Teradata-160"><a href="#Teradata-160"><span class="linenos">160</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">OnCommitProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_INDEX</span><span class="p">,</span> -</span><span id="Teradata-161"><a href="#Teradata-161"><span class="linenos">161</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_EXPRESSION</span><span class="p">,</span> -</span><span id="Teradata-162"><a href="#Teradata-162"><span class="linenos">162</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StabilityProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_CREATE</span><span class="p">,</span> -</span><span id="Teradata-163"><a href="#Teradata-163"><span class="linenos">163</span></a> <span class="p">}</span> -</span><span id="Teradata-164"><a href="#Teradata-164"><span class="linenos">164</span></a> -</span><span id="Teradata-165"><a href="#Teradata-165"><span class="linenos">165</span></a> <span class="n">TRANSFORMS</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Teradata-166"><a href="#Teradata-166"><span class="linenos">166</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TRANSFORMS</span><span class="p">,</span> -</span><span id="Teradata-167"><a href="#Teradata-167"><span class="linenos">167</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Max</span><span class="p">:</span> <span class="n">max_or_greatest</span><span class="p">,</span> -</span><span id="Teradata-168"><a href="#Teradata-168"><span class="linenos">168</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Min</span><span class="p">:</span> <span class="n">min_or_least</span><span class="p">,</span> -</span><span id="Teradata-169"><a href="#Teradata-169"><span class="linenos">169</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Select</span><span class="p">:</span> <span class="n">transforms</span><span class="o">.</span><span class="n">preprocess</span><span class="p">([</span><span class="n">transforms</span><span class="o">.</span><span class="n">eliminate_distinct_on</span><span class="p">]),</span> -</span><span id="Teradata-170"><a href="#Teradata-170"><span class="linenos">170</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StrToDate</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">"CAST(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2"> AS DATE FORMAT </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">format_time</span><span class="p">(</span><span class="n">e</span><span class="p">)</span><span class="si">}</span><span class="s2">)"</span><span class="p">,</span> -</span><span id="Teradata-171"><a href="#Teradata-171"><span class="linenos">171</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ToChar</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">function_fallback_sql</span><span class="p">(</span><span class="n">e</span><span class="p">),</span> -</span><span id="Teradata-172"><a href="#Teradata-172"><span class="linenos">172</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Use</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">"DATABASE </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span> -</span><span id="Teradata-173"><a href="#Teradata-173"><span class="linenos">173</span></a> <span class="p">}</span> -</span><span id="Teradata-174"><a href="#Teradata-174"><span class="linenos">174</span></a> -</span><span id="Teradata-175"><a href="#Teradata-175"><span class="linenos">175</span></a> <span class="k">def</span> <span class="nf">partitionedbyproperty_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Teradata-176"><a href="#Teradata-176"><span class="linenos">176</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"PARTITION BY </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span> +</span><span id="Teradata-146"><a href="#Teradata-146"><span class="linenos">146</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_csv</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_conjunction</span><span class="p">)</span> +</span><span id="Teradata-147"><a href="#Teradata-147"><span class="linenos">147</span></a> <span class="n">each</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match_text_seq</span><span class="p">(</span><span class="s2">"EACH"</span><span class="p">)</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_conjunction</span><span class="p">()</span> +</span><span id="Teradata-148"><a href="#Teradata-148"><span class="linenos">148</span></a> +</span><span id="Teradata-149"><a href="#Teradata-149"><span class="linenos">149</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">RangeN</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">this</span><span class="p">,</span> <span class="n">expressions</span><span class="o">=</span><span class="n">expressions</span><span class="p">,</span> <span class="n">each</span><span class="o">=</span><span class="n">each</span><span class="p">)</span> +</span><span id="Teradata-150"><a href="#Teradata-150"><span class="linenos">150</span></a> +</span><span id="Teradata-151"><a href="#Teradata-151"><span class="linenos">151</span></a> <span class="k">class</span> <span class="nc">Generator</span><span class="p">(</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="p">):</span> +</span><span id="Teradata-152"><a href="#Teradata-152"><span class="linenos">152</span></a> <span class="n">JOIN_HINTS</span> <span class="o">=</span> <span class="kc">False</span> +</span><span id="Teradata-153"><a href="#Teradata-153"><span class="linenos">153</span></a> <span class="n">TABLE_HINTS</span> <span class="o">=</span> <span class="kc">False</span> +</span><span id="Teradata-154"><a href="#Teradata-154"><span class="linenos">154</span></a> <span class="n">QUERY_HINTS</span> <span class="o">=</span> <span class="kc">False</span> +</span><span id="Teradata-155"><a href="#Teradata-155"><span class="linenos">155</span></a> +</span><span id="Teradata-156"><a href="#Teradata-156"><span class="linenos">156</span></a> <span class="n">TYPE_MAPPING</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Teradata-157"><a href="#Teradata-157"><span class="linenos">157</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TYPE_MAPPING</span><span class="p">,</span> +</span><span id="Teradata-158"><a href="#Teradata-158"><span class="linenos">158</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">GEOMETRY</span><span class="p">:</span> <span class="s2">"ST_GEOMETRY"</span><span class="p">,</span> +</span><span id="Teradata-159"><a href="#Teradata-159"><span class="linenos">159</span></a> <span class="p">}</span> +</span><span id="Teradata-160"><a href="#Teradata-160"><span class="linenos">160</span></a> +</span><span id="Teradata-161"><a href="#Teradata-161"><span class="linenos">161</span></a> <span class="n">PROPERTIES_LOCATION</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Teradata-162"><a href="#Teradata-162"><span class="linenos">162</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">PROPERTIES_LOCATION</span><span class="p">,</span> +</span><span id="Teradata-163"><a href="#Teradata-163"><span class="linenos">163</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">OnCommitProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_INDEX</span><span class="p">,</span> +</span><span id="Teradata-164"><a href="#Teradata-164"><span class="linenos">164</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_EXPRESSION</span><span class="p">,</span> +</span><span id="Teradata-165"><a href="#Teradata-165"><span class="linenos">165</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StabilityProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_CREATE</span><span class="p">,</span> +</span><span id="Teradata-166"><a href="#Teradata-166"><span class="linenos">166</span></a> <span class="p">}</span> +</span><span id="Teradata-167"><a href="#Teradata-167"><span class="linenos">167</span></a> +</span><span id="Teradata-168"><a href="#Teradata-168"><span class="linenos">168</span></a> <span class="n">TRANSFORMS</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Teradata-169"><a href="#Teradata-169"><span class="linenos">169</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TRANSFORMS</span><span class="p">,</span> +</span><span id="Teradata-170"><a href="#Teradata-170"><span class="linenos">170</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Max</span><span class="p">:</span> <span class="n">max_or_greatest</span><span class="p">,</span> +</span><span id="Teradata-171"><a href="#Teradata-171"><span class="linenos">171</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Min</span><span class="p">:</span> <span class="n">min_or_least</span><span class="p">,</span> +</span><span id="Teradata-172"><a href="#Teradata-172"><span class="linenos">172</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Select</span><span class="p">:</span> <span class="n">transforms</span><span class="o">.</span><span class="n">preprocess</span><span class="p">([</span><span class="n">transforms</span><span class="o">.</span><span class="n">eliminate_distinct_on</span><span class="p">]),</span> +</span><span id="Teradata-173"><a href="#Teradata-173"><span class="linenos">173</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StrToDate</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">"CAST(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2"> AS DATE FORMAT </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">format_time</span><span class="p">(</span><span class="n">e</span><span class="p">)</span><span class="si">}</span><span class="s2">)"</span><span class="p">,</span> +</span><span id="Teradata-174"><a href="#Teradata-174"><span class="linenos">174</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ToChar</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">function_fallback_sql</span><span class="p">(</span><span class="n">e</span><span class="p">),</span> +</span><span id="Teradata-175"><a href="#Teradata-175"><span class="linenos">175</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Use</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">"DATABASE </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span> +</span><span id="Teradata-176"><a href="#Teradata-176"><span class="linenos">176</span></a> <span class="p">}</span> </span><span id="Teradata-177"><a href="#Teradata-177"><span class="linenos">177</span></a> -</span><span id="Teradata-178"><a href="#Teradata-178"><span class="linenos">178</span></a> <span class="c1"># FROM before SET in Teradata UPDATE syntax</span> -</span><span id="Teradata-179"><a href="#Teradata-179"><span class="linenos">179</span></a> <span class="c1"># https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/Teradata-VantageTM-SQL-Data-Manipulation-Language-17.20/Statement-Syntax/UPDATE/UPDATE-Syntax-Basic-Form-FROM-Clause</span> -</span><span id="Teradata-180"><a href="#Teradata-180"><span class="linenos">180</span></a> <span class="k">def</span> <span class="nf">update_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Update</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Teradata-181"><a href="#Teradata-181"><span class="linenos">181</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> -</span><span id="Teradata-182"><a href="#Teradata-182"><span class="linenos">182</span></a> <span class="n">from_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"from"</span><span class="p">)</span> -</span><span id="Teradata-183"><a href="#Teradata-183"><span class="linenos">183</span></a> <span class="n">set_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">flat</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> -</span><span id="Teradata-184"><a href="#Teradata-184"><span class="linenos">184</span></a> <span class="n">where_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"where"</span><span class="p">)</span> -</span><span id="Teradata-185"><a href="#Teradata-185"><span class="linenos">185</span></a> <span class="n">sql</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"UPDATE </span><span class="si">{</span><span class="n">this</span><span class="si">}{</span><span class="n">from_sql</span><span class="si">}</span><span class="s2"> SET </span><span class="si">{</span><span class="n">set_sql</span><span class="si">}{</span><span class="n">where_sql</span><span class="si">}</span><span class="s2">"</span> -</span><span id="Teradata-186"><a href="#Teradata-186"><span class="linenos">186</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">prepend_ctes</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">sql</span><span class="p">)</span> -</span><span id="Teradata-187"><a href="#Teradata-187"><span class="linenos">187</span></a> -</span><span id="Teradata-188"><a href="#Teradata-188"><span class="linenos">188</span></a> <span class="k">def</span> <span class="nf">mod_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Mod</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Teradata-189"><a href="#Teradata-189"><span class="linenos">189</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">binary</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"MOD"</span><span class="p">)</span> -</span><span id="Teradata-190"><a href="#Teradata-190"><span class="linenos">190</span></a> -</span><span id="Teradata-191"><a href="#Teradata-191"><span class="linenos">191</span></a> <span class="k">def</span> <span class="nf">datatype_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Teradata-192"><a href="#Teradata-192"><span class="linenos">192</span></a> <span class="n">type_sql</span> <span class="o">=</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">datatype_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> -</span><span id="Teradata-193"><a href="#Teradata-193"><span class="linenos">193</span></a> <span class="n">prefix_sql</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"prefix"</span><span class="p">)</span> -</span><span id="Teradata-194"><a href="#Teradata-194"><span class="linenos">194</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"SYSUDTLIB.</span><span class="si">{</span><span class="n">type_sql</span><span class="si">}</span><span class="s2">"</span> <span class="k">if</span> <span class="n">prefix_sql</span> <span class="k">else</span> <span class="n">type_sql</span> +</span><span id="Teradata-178"><a href="#Teradata-178"><span class="linenos">178</span></a> <span class="k">def</span> <span class="nf">tablesample_sql</span><span class="p">(</span> +</span><span id="Teradata-179"><a href="#Teradata-179"><span class="linenos">179</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">TableSample</span><span class="p">,</span> <span class="n">seed_prefix</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"SEED"</span><span class="p">,</span> <span class="n">sep</span><span class="o">=</span><span class="s2">" AS "</span> +</span><span id="Teradata-180"><a href="#Teradata-180"><span class="linenos">180</span></a> <span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Teradata-181"><a href="#Teradata-181"><span class="linenos">181</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2"> SAMPLE </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span> +</span><span id="Teradata-182"><a href="#Teradata-182"><span class="linenos">182</span></a> +</span><span id="Teradata-183"><a href="#Teradata-183"><span class="linenos">183</span></a> <span class="k">def</span> <span class="nf">partitionedbyproperty_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Teradata-184"><a href="#Teradata-184"><span class="linenos">184</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"PARTITION BY </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span> +</span><span id="Teradata-185"><a href="#Teradata-185"><span class="linenos">185</span></a> +</span><span id="Teradata-186"><a href="#Teradata-186"><span class="linenos">186</span></a> <span class="c1"># FROM before SET in Teradata UPDATE syntax</span> +</span><span id="Teradata-187"><a href="#Teradata-187"><span class="linenos">187</span></a> <span class="c1"># https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/Teradata-VantageTM-SQL-Data-Manipulation-Language-17.20/Statement-Syntax/UPDATE/UPDATE-Syntax-Basic-Form-FROM-Clause</span> +</span><span id="Teradata-188"><a href="#Teradata-188"><span class="linenos">188</span></a> <span class="k">def</span> <span class="nf">update_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Update</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Teradata-189"><a href="#Teradata-189"><span class="linenos">189</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> +</span><span id="Teradata-190"><a href="#Teradata-190"><span class="linenos">190</span></a> <span class="n">from_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"from"</span><span class="p">)</span> +</span><span id="Teradata-191"><a href="#Teradata-191"><span class="linenos">191</span></a> <span class="n">set_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">flat</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="Teradata-192"><a href="#Teradata-192"><span class="linenos">192</span></a> <span class="n">where_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"where"</span><span class="p">)</span> +</span><span id="Teradata-193"><a href="#Teradata-193"><span class="linenos">193</span></a> <span class="n">sql</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"UPDATE </span><span class="si">{</span><span class="n">this</span><span class="si">}{</span><span class="n">from_sql</span><span class="si">}</span><span class="s2"> SET </span><span class="si">{</span><span class="n">set_sql</span><span class="si">}{</span><span class="n">where_sql</span><span class="si">}</span><span class="s2">"</span> +</span><span id="Teradata-194"><a href="#Teradata-194"><span class="linenos">194</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">prepend_ctes</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">sql</span><span class="p">)</span> </span><span id="Teradata-195"><a href="#Teradata-195"><span class="linenos">195</span></a> -</span><span id="Teradata-196"><a href="#Teradata-196"><span class="linenos">196</span></a> <span class="k">def</span> <span class="nf">rangen_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">RangeN</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Teradata-197"><a href="#Teradata-197"><span class="linenos">197</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> -</span><span id="Teradata-198"><a href="#Teradata-198"><span class="linenos">198</span></a> <span class="n">expressions_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> -</span><span id="Teradata-199"><a href="#Teradata-199"><span class="linenos">199</span></a> <span class="n">each_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"each"</span><span class="p">)</span> -</span><span id="Teradata-200"><a href="#Teradata-200"><span class="linenos">200</span></a> <span class="n">each_sql</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">" EACH </span><span class="si">{</span><span class="n">each_sql</span><span class="si">}</span><span class="s2">"</span> <span class="k">if</span> <span class="n">each_sql</span> <span class="k">else</span> <span class="s2">""</span> -</span><span id="Teradata-201"><a href="#Teradata-201"><span class="linenos">201</span></a> -</span><span id="Teradata-202"><a href="#Teradata-202"><span class="linenos">202</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"RANGE_N(</span><span class="si">{</span><span class="n">this</span><span class="si">}</span><span class="s2"> BETWEEN </span><span class="si">{</span><span class="n">expressions_sql</span><span class="si">}{</span><span class="n">each_sql</span><span class="si">}</span><span class="s2">)"</span> +</span><span id="Teradata-196"><a href="#Teradata-196"><span class="linenos">196</span></a> <span class="k">def</span> <span class="nf">mod_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Mod</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Teradata-197"><a href="#Teradata-197"><span class="linenos">197</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">binary</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"MOD"</span><span class="p">)</span> +</span><span id="Teradata-198"><a href="#Teradata-198"><span class="linenos">198</span></a> +</span><span id="Teradata-199"><a href="#Teradata-199"><span class="linenos">199</span></a> <span class="k">def</span> <span class="nf">datatype_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Teradata-200"><a href="#Teradata-200"><span class="linenos">200</span></a> <span class="n">type_sql</span> <span class="o">=</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">datatype_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> +</span><span id="Teradata-201"><a href="#Teradata-201"><span class="linenos">201</span></a> <span class="n">prefix_sql</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"prefix"</span><span class="p">)</span> +</span><span id="Teradata-202"><a href="#Teradata-202"><span class="linenos">202</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"SYSUDTLIB.</span><span class="si">{</span><span class="n">type_sql</span><span class="si">}</span><span class="s2">"</span> <span class="k">if</span> <span class="n">prefix_sql</span> <span class="k">else</span> <span class="n">type_sql</span> </span><span id="Teradata-203"><a href="#Teradata-203"><span class="linenos">203</span></a> -</span><span id="Teradata-204"><a href="#Teradata-204"><span class="linenos">204</span></a> <span class="k">def</span> <span class="nf">createable_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Create</span><span class="p">,</span> <span class="n">locations</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">DefaultDict</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Teradata-205"><a href="#Teradata-205"><span class="linenos">205</span></a> <span class="n">kind</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> -</span><span id="Teradata-206"><a href="#Teradata-206"><span class="linenos">206</span></a> <span class="k">if</span> <span class="n">kind</span> <span class="o">==</span> <span class="s2">"TABLE"</span> <span class="ow">and</span> <span class="n">locations</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_NAME</span><span class="p">):</span> -</span><span id="Teradata-207"><a href="#Teradata-207"><span class="linenos">207</span></a> <span class="n">this_name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> -</span><span id="Teradata-208"><a href="#Teradata-208"><span class="linenos">208</span></a> <span class="n">this_properties</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">properties</span><span class="p">(</span> -</span><span id="Teradata-209"><a href="#Teradata-209"><span class="linenos">209</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="n">locations</span><span class="p">[</span><span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_NAME</span><span class="p">]),</span> -</span><span id="Teradata-210"><a href="#Teradata-210"><span class="linenos">210</span></a> <span class="n">wrapped</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> -</span><span id="Teradata-211"><a href="#Teradata-211"><span class="linenos">211</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">","</span><span class="p">,</span> -</span><span id="Teradata-212"><a href="#Teradata-212"><span class="linenos">212</span></a> <span class="p">)</span> -</span><span id="Teradata-213"><a href="#Teradata-213"><span class="linenos">213</span></a> <span class="n">this_schema</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">schema_columns_sql</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">this</span><span class="p">)</span> -</span><span id="Teradata-214"><a href="#Teradata-214"><span class="linenos">214</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">this_name</span><span class="si">}{</span><span class="n">this_properties</span><span class="si">}{</span><span class="bp">self</span><span class="o">.</span><span class="n">sep</span><span class="p">()</span><span class="si">}{</span><span class="n">this_schema</span><span class="si">}</span><span class="s2">"</span> -</span><span id="Teradata-215"><a href="#Teradata-215"><span class="linenos">215</span></a> -</span><span id="Teradata-216"><a href="#Teradata-216"><span class="linenos">216</span></a> <span class="k">return</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">createable_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">locations</span><span class="p">)</span> +</span><span id="Teradata-204"><a href="#Teradata-204"><span class="linenos">204</span></a> <span class="k">def</span> <span class="nf">rangen_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">RangeN</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Teradata-205"><a href="#Teradata-205"><span class="linenos">205</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> +</span><span id="Teradata-206"><a href="#Teradata-206"><span class="linenos">206</span></a> <span class="n">expressions_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> +</span><span id="Teradata-207"><a href="#Teradata-207"><span class="linenos">207</span></a> <span class="n">each_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"each"</span><span class="p">)</span> +</span><span id="Teradata-208"><a href="#Teradata-208"><span class="linenos">208</span></a> <span class="n">each_sql</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">" EACH </span><span class="si">{</span><span class="n">each_sql</span><span class="si">}</span><span class="s2">"</span> <span class="k">if</span> <span class="n">each_sql</span> <span class="k">else</span> <span class="s2">""</span> +</span><span id="Teradata-209"><a href="#Teradata-209"><span class="linenos">209</span></a> +</span><span id="Teradata-210"><a href="#Teradata-210"><span class="linenos">210</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"RANGE_N(</span><span class="si">{</span><span class="n">this</span><span class="si">}</span><span class="s2"> BETWEEN </span><span class="si">{</span><span class="n">expressions_sql</span><span class="si">}{</span><span class="n">each_sql</span><span class="si">}</span><span class="s2">)"</span> +</span><span id="Teradata-211"><a href="#Teradata-211"><span class="linenos">211</span></a> +</span><span id="Teradata-212"><a href="#Teradata-212"><span class="linenos">212</span></a> <span class="k">def</span> <span class="nf">createable_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Create</span><span class="p">,</span> <span class="n">locations</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">DefaultDict</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Teradata-213"><a href="#Teradata-213"><span class="linenos">213</span></a> <span class="n">kind</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> +</span><span id="Teradata-214"><a href="#Teradata-214"><span class="linenos">214</span></a> <span class="k">if</span> <span class="n">kind</span> <span class="o">==</span> <span class="s2">"TABLE"</span> <span class="ow">and</span> <span class="n">locations</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_NAME</span><span class="p">):</span> +</span><span id="Teradata-215"><a href="#Teradata-215"><span class="linenos">215</span></a> <span class="n">this_name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> +</span><span id="Teradata-216"><a href="#Teradata-216"><span class="linenos">216</span></a> <span class="n">this_properties</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">properties</span><span class="p">(</span> +</span><span id="Teradata-217"><a href="#Teradata-217"><span class="linenos">217</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="n">locations</span><span class="p">[</span><span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_NAME</span><span class="p">]),</span> +</span><span id="Teradata-218"><a href="#Teradata-218"><span class="linenos">218</span></a> <span class="n">wrapped</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> +</span><span id="Teradata-219"><a href="#Teradata-219"><span class="linenos">219</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">","</span><span class="p">,</span> +</span><span id="Teradata-220"><a href="#Teradata-220"><span class="linenos">220</span></a> <span class="p">)</span> +</span><span id="Teradata-221"><a href="#Teradata-221"><span class="linenos">221</span></a> <span class="n">this_schema</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">schema_columns_sql</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">this</span><span class="p">)</span> +</span><span id="Teradata-222"><a href="#Teradata-222"><span class="linenos">222</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">this_name</span><span class="si">}{</span><span class="n">this_properties</span><span class="si">}{</span><span class="bp">self</span><span class="o">.</span><span class="n">sep</span><span class="p">()</span><span class="si">}{</span><span class="n">this_schema</span><span class="si">}</span><span class="s2">"</span> +</span><span id="Teradata-223"><a href="#Teradata-223"><span class="linenos">223</span></a> +</span><span id="Teradata-224"><a href="#Teradata-224"><span class="linenos">224</span></a> <span class="k">return</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">createable_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">locations</span><span class="p">)</span> </span></pre></div> @@ -705,7 +727,7 @@ <div id="Teradata.tokenizer_class" class="classattr"> <div class="attr variable"> <span class="name">tokenizer_class</span> = -<span class="default_value"><class '<a href="#Teradata.Tokenizer">sqlglot.dialects.teradata.Teradata.Tokenizer</a>'></span> +<span class="default_value"><class '<a href="#Teradata.Tokenizer">Teradata.Tokenizer</a>'></span> </div> @@ -717,7 +739,7 @@ <div id="Teradata.parser_class" class="classattr"> <div class="attr variable"> <span class="name">parser_class</span> = -<span class="default_value"><class '<a href="#Teradata.Parser">sqlglot.dialects.teradata.Teradata.Parser</a>'></span> +<span class="default_value"><class '<a href="#Teradata.Parser">Teradata.Parser</a>'></span> </div> @@ -729,7 +751,7 @@ <div id="Teradata.generator_class" class="classattr"> <div class="attr variable"> <span class="name">generator_class</span> = -<span class="default_value"><class '<a href="#Teradata.Generator">sqlglot.dialects.teradata.Teradata.Generator</a>'></span> +<span class="default_value"><class '<a href="#Teradata.Generator">Teradata.Generator</a>'></span> </div> @@ -974,14 +996,15 @@ </span><span id="Teradata.Tokenizer-46"><a href="#Teradata.Tokenizer-46"><span class="linenos">46</span></a> <span class="s2">"MOD"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">MOD</span><span class="p">,</span> </span><span id="Teradata.Tokenizer-47"><a href="#Teradata.Tokenizer-47"><span class="linenos">47</span></a> <span class="s2">"NE"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">NEQ</span><span class="p">,</span> </span><span id="Teradata.Tokenizer-48"><a href="#Teradata.Tokenizer-48"><span class="linenos">48</span></a> <span class="s2">"NOT="</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">NEQ</span><span class="p">,</span> -</span><span id="Teradata.Tokenizer-49"><a href="#Teradata.Tokenizer-49"><span class="linenos">49</span></a> <span class="s2">"SEL"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">SELECT</span><span class="p">,</span> -</span><span id="Teradata.Tokenizer-50"><a href="#Teradata.Tokenizer-50"><span class="linenos">50</span></a> <span class="s2">"ST_GEOMETRY"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">GEOMETRY</span><span class="p">,</span> -</span><span id="Teradata.Tokenizer-51"><a href="#Teradata.Tokenizer-51"><span class="linenos">51</span></a> <span class="s2">"TOP"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">TOP</span><span class="p">,</span> -</span><span id="Teradata.Tokenizer-52"><a href="#Teradata.Tokenizer-52"><span class="linenos">52</span></a> <span class="p">}</span> -</span><span id="Teradata.Tokenizer-53"><a href="#Teradata.Tokenizer-53"><span class="linenos">53</span></a> -</span><span id="Teradata.Tokenizer-54"><a href="#Teradata.Tokenizer-54"><span class="linenos">54</span></a> <span class="c1"># Teradata does not support % as a modulo operator</span> -</span><span id="Teradata.Tokenizer-55"><a href="#Teradata.Tokenizer-55"><span class="linenos">55</span></a> <span class="n">SINGLE_TOKENS</span> <span class="o">=</span> <span class="p">{</span><span class="o">**</span><span class="n">tokens</span><span class="o">.</span><span class="n">Tokenizer</span><span class="o">.</span><span class="n">SINGLE_TOKENS</span><span class="p">}</span> -</span><span id="Teradata.Tokenizer-56"><a href="#Teradata.Tokenizer-56"><span class="linenos">56</span></a> <span class="n">SINGLE_TOKENS</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">"%"</span><span class="p">)</span> +</span><span id="Teradata.Tokenizer-49"><a href="#Teradata.Tokenizer-49"><span class="linenos">49</span></a> <span class="s2">"SAMPLE"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">TABLE_SAMPLE</span><span class="p">,</span> +</span><span id="Teradata.Tokenizer-50"><a href="#Teradata.Tokenizer-50"><span class="linenos">50</span></a> <span class="s2">"SEL"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">SELECT</span><span class="p">,</span> +</span><span id="Teradata.Tokenizer-51"><a href="#Teradata.Tokenizer-51"><span class="linenos">51</span></a> <span class="s2">"ST_GEOMETRY"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">GEOMETRY</span><span class="p">,</span> +</span><span id="Teradata.Tokenizer-52"><a href="#Teradata.Tokenizer-52"><span class="linenos">52</span></a> <span class="s2">"TOP"</span><span class="p">:</span> <span class="n">TokenType</span><span class="o">.</span><span class="n">TOP</span><span class="p">,</span> +</span><span id="Teradata.Tokenizer-53"><a href="#Teradata.Tokenizer-53"><span class="linenos">53</span></a> <span class="p">}</span> +</span><span id="Teradata.Tokenizer-54"><a href="#Teradata.Tokenizer-54"><span class="linenos">54</span></a> +</span><span id="Teradata.Tokenizer-55"><a href="#Teradata.Tokenizer-55"><span class="linenos">55</span></a> <span class="c1"># Teradata does not support % as a modulo operator</span> +</span><span id="Teradata.Tokenizer-56"><a href="#Teradata.Tokenizer-56"><span class="linenos">56</span></a> <span class="n">SINGLE_TOKENS</span> <span class="o">=</span> <span class="p">{</span><span class="o">**</span><span class="n">tokens</span><span class="o">.</span><span class="n">Tokenizer</span><span class="o">.</span><span class="n">SINGLE_TOKENS</span><span class="p">}</span> +</span><span id="Teradata.Tokenizer-57"><a href="#Teradata.Tokenizer-57"><span class="linenos">57</span></a> <span class="n">SINGLE_TOKENS</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">"%"</span><span class="p">)</span> </span></pre></div> @@ -991,7 +1014,7 @@ <div class="attr variable"> <span class="name">KEYWORDS</span> = <input id="Teradata.Tokenizer.KEYWORDS-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> - <label class="view-value-button pdoc-button" for="Teradata.Tokenizer.KEYWORDS-view-value"></label><span class="default_value">{'{%': <TokenType.BLOCK_START: 'BLOCK_START'>, '{%+': <TokenType.BLOCK_START: 'BLOCK_START'>, '{%-': <TokenType.BLOCK_START: 'BLOCK_START'>, '%}': <TokenType.BLOCK_END: 'BLOCK_END'>, '+%}': <TokenType.BLOCK_END: 'BLOCK_END'>, '-%}': <TokenType.BLOCK_END: 'BLOCK_END'>, '{{+': <TokenType.BLOCK_START: 'BLOCK_START'>, '{{-': <TokenType.BLOCK_START: 'BLOCK_START'>, '+}}': <TokenType.BLOCK_END: 'BLOCK_END'>, '-}}': <TokenType.BLOCK_END: 'BLOCK_END'>, '/*+': <TokenType.HINT: 'HINT'>, '==': <TokenType.EQ: 'EQ'>, '::': <TokenType.DCOLON: 'DCOLON'>, '||': <TokenType.DPIPE: 'DPIPE'>, '>=': <TokenType.GTE: 'GTE'>, '<=': <TokenType.LTE: 'LTE'>, '<>': <TokenType.NEQ: 'NEQ'>, '!=': <TokenType.NEQ: 'NEQ'>, '<=>': <TokenType.NULLSAFE_EQ: 'NULLSAFE_EQ'>, '->': <TokenType.ARROW: 'ARROW'>, '->>': <TokenType.DARROW: 'DARROW'>, '=>': <TokenType.FARROW: 'FARROW'>, '#>': <TokenType.HASH_ARROW: 'HASH_ARROW'>, '#>>': <TokenType.DHASH_ARROW: 'DHASH_ARROW'>, '<->': <TokenType.LR_ARROW: 'LR_ARROW'>, '&&': <TokenType.DAMP: 'DAMP'>, '??': <TokenType.DQMARK: 'DQMARK'>, 'ALL': <TokenType.ALL: 'ALL'>, 'ALWAYS': <TokenType.ALWAYS: 'ALWAYS'>, 'AND': <TokenType.AND: 'AND'>, 'ANTI': <TokenType.ANTI: 'ANTI'>, 'ANY': <TokenType.ANY: 'ANY'>, 'ASC': <TokenType.ASC: 'ASC'>, 'AS': <TokenType.ALIAS: 'ALIAS'>, 'ASOF': <TokenType.ASOF: 'ASOF'>, 'AUTOINCREMENT': <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, 'AUTO_INCREMENT': <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, 'BEGIN': <TokenType.BEGIN: 'BEGIN'>, 'BETWEEN': <TokenType.BETWEEN: 'BETWEEN'>, 'CACHE': <TokenType.CACHE: 'CACHE'>, 'UNCACHE': <TokenType.UNCACHE: 'UNCACHE'>, 'CASE': <TokenType.CASE: 'CASE'>, 'CHARACTER SET': <TokenType.CHARACTER_SET: 'CHARACTER_SET'>, 'CLUSTER BY': <TokenType.CLUSTER_BY: 'CLUSTER_BY'>, 'COLLATE': <TokenType.COLLATE: 'COLLATE'>, 'COLUMN': <TokenType.COLUMN: 'COLUMN'>, 'COMMIT': <TokenType.COMMIT: 'COMMIT'>, 'CONNECT BY': <TokenType.CONNECT_BY: 'CONNECT_BY'>, 'CONSTRAINT': <TokenType.CONSTRAINT: 'CONSTRAINT'>, 'CREATE': <TokenType.CREATE: 'CREATE'>, 'CROSS': <TokenType.CROSS: 'CROSS'>, 'CUBE': <TokenType.CUBE: 'CUBE'>, 'CURRENT_DATE': <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, 'CURRENT_TIME': <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, 'CURRENT_TIMESTAMP': <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, 'CURRENT_USER': <TokenType.CURRENT_USER: 'CURRENT_USER'>, 'DATABASE': <TokenType.DATABASE: 'DATABASE'>, 'DEFAULT': <TokenType.DEFAULT: 'DEFAULT'>, 'DELETE': <TokenType.DELETE: 'DELETE'>, 'DESC': <TokenType.DESC: 'DESC'>, 'DESCRIBE': <TokenType.DESCRIBE: 'DESCRIBE'>, 'DISTINCT': <TokenType.DISTINCT: 'DISTINCT'>, 'DISTRIBUTE BY': <TokenType.DISTRIBUTE_BY: 'DISTRIBUTE_BY'>, 'DIV': <TokenType.DIV: 'DIV'>, 'DROP': <TokenType.DROP: 'DROP'>, 'ELSE': <TokenType.ELSE: 'ELSE'>, 'END': <TokenType.END: 'END'>, 'ESCAPE': <TokenType.ESCAPE: 'ESCAPE'>, 'EXCEPT': <TokenType.EXCEPT: 'EXCEPT'>, 'EXECUTE': <TokenType.EXECUTE: 'EXECUTE'>, 'EXISTS': <TokenType.EXISTS: 'EXISTS'>, 'FALSE': <TokenType.FALSE: 'FALSE'>, 'FETCH': <TokenType.FETCH: 'FETCH'>, 'FILTER': <TokenType.FILTER: 'FILTER'>, 'FIRST': <TokenType.FIRST: 'FIRST'>, 'FULL': <TokenType.FULL: 'FULL'>, 'FUNCTION': <TokenType.FUNCTION: 'FUNCTION'>, 'FOR': <TokenType.FOR: 'FOR'>, 'FOREIGN KEY': <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, 'FORMAT': <TokenType.FORMAT: 'FORMAT'>, 'FROM': <TokenType.FROM: 'FROM'>, 'GEOGRAPHY': <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, 'GEOMETRY': <TokenType.GEOMETRY: 'GEOMETRY'>, 'GLOB': <TokenType.GLOB: 'GLOB'>, 'GROUP BY': <TokenType.GROUP_BY: 'GROUP_BY'>, 'GROUPING SETS': <TokenType.GROUPING_SETS: 'GROUPING_SETS'>, 'HAVING': <TokenType.HAVING: 'HAVING'>, 'ILIKE': <TokenType.ILIKE: 'ILIKE'>, 'IN': <TokenType.IN: 'IN'>, 'INDEX': <TokenType.INDEX: 'INDEX'>, 'INET': <TokenType.INET: 'INET'>, 'INNER': <TokenType.INNER: 'INNER'>, 'INSERT': <TokenType.INSERT: 'INSERT'>, 'INTERVAL': <TokenType.INTERVAL: 'INTERVAL'>, 'INTERSECT': <TokenType.INTERSECT: 'INTERSECT'>, 'INTO': <TokenType.INTO: 'INTO'>, 'IS': <TokenType.IS: 'IS'>, 'ISNULL': <TokenType.ISNULL: 'ISNULL'>, 'JOIN': <TokenType.JOIN: 'JOIN'>, 'KEEP': <TokenType.KEEP: 'KEEP'>, 'LATERAL': <TokenType.LATERAL: 'LATERAL'>, 'LEFT': <TokenType.LEFT: 'LEFT'>, 'LIKE': <TokenType.LIKE: 'LIKE'>, 'LIMIT': <TokenType.LIMIT: 'LIMIT'>, 'LOAD': <TokenType.LOAD: 'LOAD'>, 'LOCK': <TokenType.LOCK: 'LOCK'>, 'MERGE': <TokenType.MERGE: 'MERGE'>, 'NATURAL': <TokenType.NATURAL: 'NATURAL'>, 'NEXT': <TokenType.NEXT: 'NEXT'>, 'NOT': <TokenType.NOT: 'NOT'>, 'NOTNULL': <TokenType.NOTNULL: 'NOTNULL'>, 'NULL': <TokenType.NULL: 'NULL'>, 'OBJECT': <TokenType.OBJECT: 'OBJECT'>, 'OFFSET': <TokenType.OFFSET: 'OFFSET'>, 'ON': <TokenType.ON: 'ON'>, 'OR': <TokenType.OR: 'OR'>, 'XOR': <TokenType.XOR: 'XOR'>, 'ORDER BY': <TokenType.ORDER_BY: 'ORDER_BY'>, 'ORDINALITY': <TokenType.ORDINALITY: 'ORDINALITY'>, 'OUTER': <TokenType.OUTER: 'OUTER'>, 'OVER': <TokenType.OVER: 'OVER'>, 'OVERLAPS': <TokenType.OVERLAPS: 'OVERLAPS'>, 'OVERWRITE': <TokenType.OVERWRITE: 'OVERWRITE'>, 'PARTITION': <TokenType.PARTITION: 'PARTITION'>, 'PARTITION BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PARTITIONED BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PARTITIONED_BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PERCENT': <TokenType.PERCENT: 'PERCENT'>, 'PIVOT': <TokenType.PIVOT: 'PIVOT'>, 'PRAGMA': <TokenType.PRAGMA: 'PRAGMA'>, 'PRIMARY KEY': <TokenType.PRIMARY_KEY: 'PRIMARY_KEY'>, 'PROCEDURE': <TokenType.PROCEDURE: 'PROCEDURE'>, 'QUALIFY': <TokenType.QUALIFY: 'QUALIFY'>, 'RANGE': <TokenType.RANGE: 'RANGE'>, 'RECURSIVE': <TokenType.RECURSIVE: 'RECURSIVE'>, 'REGEXP': <TokenType.RLIKE: 'RLIKE'>, 'REPLACE': <TokenType.REPLACE: 'REPLACE'>, 'RETURNING': <TokenType.RETURNING: 'RETURNING'>, 'REFERENCES': <TokenType.REFERENCES: 'REFERENCES'>, 'RIGHT': <TokenType.RIGHT: 'RIGHT'>, 'RLIKE': <TokenType.RLIKE: 'RLIKE'>, 'ROLLBACK': <TokenType.ROLLBACK: 'ROLLBACK'>, 'ROLLUP': <TokenType.ROLLUP: 'ROLLUP'>, 'ROW': <TokenType.ROW: 'ROW'>, 'ROWS': <TokenType.ROWS: 'ROWS'>, 'SCHEMA': <TokenType.SCHEMA: 'SCHEMA'>, 'SELECT': <TokenType.SELECT: 'SELECT'>, 'SEMI': <TokenType.SEMI: 'SEMI'>, 'SET': <TokenType.SET: 'SET'>, 'SETTINGS': <TokenType.SETTINGS: 'SETTINGS'>, 'SHOW': <TokenType.SHOW: 'SHOW'>, 'SIMILAR TO': <TokenType.SIMILAR_TO: 'SIMILAR_TO'>, 'SOME': <TokenType.SOME: 'SOME'>, 'SORT BY': <TokenType.SORT_BY: 'SORT_BY'>, 'START WITH': <TokenType.START_WITH: 'START_WITH'>, 'TABLE': <TokenType.TABLE: 'TABLE'>, 'TABLESAMPLE': <TokenType.TABLE_SAMPLE: 'TABLE_SAMPLE'>, 'TEMP': <TokenType.TEMPORARY: 'TEMPORARY'>, 'TEMPORARY': <TokenType.TEMPORARY: 'TEMPORARY'>, 'THEN': <TokenType.THEN: 'THEN'>, 'TRUE': <TokenType.TRUE: 'TRUE'>, 'UNION': <TokenType.UNION: 'UNION'>, 'UNKNOWN': <TokenType.UNKNOWN: 'UNKNOWN'>, 'UNNEST': <TokenType.UNNEST: 'UNNEST'>, 'UNPIVOT': <TokenType.UNPIVOT: 'UNPIVOT'>, 'UPDATE': <TokenType.UPDATE: 'UPDATE'>, 'USE': <TokenType.USE: 'USE'>, 'USING': <TokenType.USING: 'USING'>, 'UUID': <TokenType.UUID: 'UUID'>, 'VALUES': <TokenType.VALUES: 'VALUES'>, 'VIEW': <TokenType.VIEW: 'VIEW'>, 'VOLATILE': <TokenType.VOLATILE: 'VOLATILE'>, 'WHEN': <TokenType.WHEN: 'WHEN'>, 'WHERE': <TokenType.WHERE: 'WHERE'>, 'WINDOW': <TokenType.WINDOW: 'WINDOW'>, 'WITH': <TokenType.WITH: 'WITH'>, 'APPLY': <TokenType.APPLY: 'APPLY'>, 'ARRAY': <TokenType.ARRAY: 'ARRAY'>, 'BIT': <TokenType.BIT: 'BIT'>, 'BOOL': <TokenType.BOOLEAN: 'BOOLEAN'>, 'BOOLEAN': <TokenType.BOOLEAN: 'BOOLEAN'>, 'BYTE': <TokenType.TINYINT: 'TINYINT'>, 'TINYINT': <TokenType.TINYINT: 'TINYINT'>, 'SHORT': <TokenType.SMALLINT: 'SMALLINT'>, 'SMALLINT': <TokenType.SMALLINT: 'SMALLINT'>, 'INT128': <TokenType.INT128: 'INT128'>, 'INT2': <TokenType.SMALLINT: 'SMALLINT'>, 'INTEGER': <TokenType.INT: 'INT'>, 'INT': <TokenType.INT: 'INT'>, 'INT4': <TokenType.INT: 'INT'>, 'LONG': <TokenType.BIGINT: 'BIGINT'>, 'BIGINT': <TokenType.BIGINT: 'BIGINT'>, 'INT8': <TokenType.BIGINT: 'BIGINT'>, 'DEC': <TokenType.DECIMAL: 'DECIMAL'>, 'DECIMAL': <TokenType.DECIMAL: 'DECIMAL'>, 'BIGDECIMAL': <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, 'BIGNUMERIC': <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, 'MAP': <TokenType.MAP: 'MAP'>, 'NULLABLE': <TokenType.NULLABLE: 'NULLABLE'>, 'NUMBER': <TokenType.DECIMAL: 'DECIMAL'>, 'NUMERIC': <TokenType.DECIMAL: 'DECIMAL'>, 'FIXED': <TokenType.DECIMAL: 'DECIMAL'>, 'REAL': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT4': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT8': <TokenType.DOUBLE: 'DOUBLE'>, 'DOUBLE': <TokenType.DOUBLE: 'DOUBLE'>, 'DOUBLE PRECISION': <TokenType.DOUBLE: 'DOUBLE'>, 'JSON': <TokenType.JSON: 'JSON'>, 'CHAR': <TokenType.CHAR: 'CHAR'>, 'CHARACTER': <TokenType.CHAR: 'CHAR'>, 'NCHAR': <TokenType.NCHAR: 'NCHAR'>, 'VARCHAR': <TokenType.VARCHAR: 'VARCHAR'>, 'VARCHAR2': <TokenType.VARCHAR: 'VARCHAR'>, 'NVARCHAR': <TokenType.NVARCHAR: 'NVARCHAR'>, 'NVARCHAR2': <TokenType.NVARCHAR: 'NVARCHAR'>, 'STR': <TokenType.TEXT: 'TEXT'>, 'STRING': <TokenType.TEXT: 'TEXT'>, 'TEXT': <TokenType.TEXT: 'TEXT'>, 'CLOB': <TokenType.TEXT: 'TEXT'>, 'LONGVARCHAR': <TokenType.TEXT: 'TEXT'>, 'BINARY': <TokenType.BINARY: 'BINARY'>, 'BLOB': <TokenType.VARBINARY: 'VARBINARY'>, 'BYTEA': <TokenType.VARBINARY: 'VARBINARY'>, 'VARBINARY': <TokenType.VARBINARY: 'VARBINARY'>, 'TIME': <TokenType.TIME: 'TIME'>, 'TIMETZ': <TokenType.TIMETZ: 'TIMETZ'>, 'TIMESTAMP': <TokenType.TIMESTAMP: 'TIMESTAMP'>, 'TIMESTAMPTZ': <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, 'TIMESTAMPLTZ': <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, 'DATE': <TokenType.DATE: 'DATE'>, 'DATETIME': <TokenType.DATETIME: 'DATETIME'>, 'INT4RANGE': <TokenType.INT4RANGE: 'INT4RANGE'>, 'INT4MULTIRANGE': <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, 'INT8RANGE': <TokenType.INT8RANGE: 'INT8RANGE'>, 'INT8MULTIRANGE': <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, 'NUMRANGE': <TokenType.NUMRANGE: 'NUMRANGE'>, 'NUMMULTIRANGE': <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, 'TSRANGE': <TokenType.TSRANGE: 'TSRANGE'>, 'TSMULTIRANGE': <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, 'TSTZRANGE': <TokenType.TSTZRANGE: 'TSTZRANGE'>, 'TSTZMULTIRANGE': <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, 'DATERANGE': <TokenType.DATERANGE: 'DATERANGE'>, 'DATEMULTIRANGE': <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, 'UNIQUE': <TokenType.UNIQUE: 'UNIQUE'>, 'STRUCT': <TokenType.STRUCT: 'STRUCT'>, 'VARIANT': <TokenType.VARIANT: 'VARIANT'>, 'ALTER': <TokenType.ALTER: 'ALTER'>, 'ANALYZE': <TokenType.COMMAND: 'COMMAND'>, 'CALL': <TokenType.COMMAND: 'COMMAND'>, 'COMMENT': <TokenType.COMMENT: 'COMMENT'>, 'COPY': <TokenType.COMMAND: 'COMMAND'>, 'EXPLAIN': <TokenType.COMMAND: 'COMMAND'>, 'GRANT': <TokenType.COMMAND: 'COMMAND'>, 'OPTIMIZE': <TokenType.COMMAND: 'COMMAND'>, 'PREPARE': <TokenType.COMMAND: 'COMMAND'>, 'TRUNCATE': <TokenType.COMMAND: 'COMMAND'>, 'VACUUM': <TokenType.COMMAND: 'COMMAND'>, 'USER-DEFINED': <TokenType.USERDEFINED: 'USERDEFINED'>, 'FOR VERSION': <TokenType.VERSION_SNAPSHOT: 'VERSION_SNAPSHOT'>, 'FOR TIMESTAMP': <TokenType.TIMESTAMP_SNAPSHOT: 'TIMESTAMP_SNAPSHOT'>, '^=': <TokenType.NEQ: 'NEQ'>, 'BYTEINT': <TokenType.SMALLINT: 'SMALLINT'>, 'COLLECT': <TokenType.COMMAND: 'COMMAND'>, 'GE': <TokenType.GTE: 'GTE'>, 'GT': <TokenType.GT: 'GT'>, 'HELP': <TokenType.COMMAND: 'COMMAND'>, 'INS': <TokenType.INSERT: 'INSERT'>, 'LE': <TokenType.LTE: 'LTE'>, 'LT': <TokenType.LT: 'LT'>, 'MOD': <TokenType.MOD: 'MOD'>, 'NE': <TokenType.NEQ: 'NEQ'>, 'NOT=': <TokenType.NEQ: 'NEQ'>, 'SEL': <TokenType.SELECT: 'SELECT'>, 'ST_GEOMETRY': <TokenType.GEOMETRY: 'GEOMETRY'>, 'TOP': <TokenType.TOP: 'TOP'>}</span> + <label class="view-value-button pdoc-button" for="Teradata.Tokenizer.KEYWORDS-view-value"></label><span class="default_value">{'{%': <TokenType.BLOCK_START: 'BLOCK_START'>, '{%+': <TokenType.BLOCK_START: 'BLOCK_START'>, '{%-': <TokenType.BLOCK_START: 'BLOCK_START'>, '%}': <TokenType.BLOCK_END: 'BLOCK_END'>, '+%}': <TokenType.BLOCK_END: 'BLOCK_END'>, '-%}': <TokenType.BLOCK_END: 'BLOCK_END'>, '{{+': <TokenType.BLOCK_START: 'BLOCK_START'>, '{{-': <TokenType.BLOCK_START: 'BLOCK_START'>, '+}}': <TokenType.BLOCK_END: 'BLOCK_END'>, '-}}': <TokenType.BLOCK_END: 'BLOCK_END'>, '/*+': <TokenType.HINT: 'HINT'>, '==': <TokenType.EQ: 'EQ'>, '::': <TokenType.DCOLON: 'DCOLON'>, '||': <TokenType.DPIPE: 'DPIPE'>, '>=': <TokenType.GTE: 'GTE'>, '<=': <TokenType.LTE: 'LTE'>, '<>': <TokenType.NEQ: 'NEQ'>, '!=': <TokenType.NEQ: 'NEQ'>, '<=>': <TokenType.NULLSAFE_EQ: 'NULLSAFE_EQ'>, '->': <TokenType.ARROW: 'ARROW'>, '->>': <TokenType.DARROW: 'DARROW'>, '=>': <TokenType.FARROW: 'FARROW'>, '#>': <TokenType.HASH_ARROW: 'HASH_ARROW'>, '#>>': <TokenType.DHASH_ARROW: 'DHASH_ARROW'>, '<->': <TokenType.LR_ARROW: 'LR_ARROW'>, '&&': <TokenType.DAMP: 'DAMP'>, '??': <TokenType.DQMARK: 'DQMARK'>, 'ALL': <TokenType.ALL: 'ALL'>, 'ALWAYS': <TokenType.ALWAYS: 'ALWAYS'>, 'AND': <TokenType.AND: 'AND'>, 'ANTI': <TokenType.ANTI: 'ANTI'>, 'ANY': <TokenType.ANY: 'ANY'>, 'ASC': <TokenType.ASC: 'ASC'>, 'AS': <TokenType.ALIAS: 'ALIAS'>, 'ASOF': <TokenType.ASOF: 'ASOF'>, 'AUTOINCREMENT': <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, 'AUTO_INCREMENT': <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, 'BEGIN': <TokenType.BEGIN: 'BEGIN'>, 'BETWEEN': <TokenType.BETWEEN: 'BETWEEN'>, 'CACHE': <TokenType.CACHE: 'CACHE'>, 'UNCACHE': <TokenType.UNCACHE: 'UNCACHE'>, 'CASE': <TokenType.CASE: 'CASE'>, 'CHARACTER SET': <TokenType.CHARACTER_SET: 'CHARACTER_SET'>, 'CLUSTER BY': <TokenType.CLUSTER_BY: 'CLUSTER_BY'>, 'COLLATE': <TokenType.COLLATE: 'COLLATE'>, 'COLUMN': <TokenType.COLUMN: 'COLUMN'>, 'COMMIT': <TokenType.COMMIT: 'COMMIT'>, 'CONNECT BY': <TokenType.CONNECT_BY: 'CONNECT_BY'>, 'CONSTRAINT': <TokenType.CONSTRAINT: 'CONSTRAINT'>, 'CREATE': <TokenType.CREATE: 'CREATE'>, 'CROSS': <TokenType.CROSS: 'CROSS'>, 'CUBE': <TokenType.CUBE: 'CUBE'>, 'CURRENT_DATE': <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, 'CURRENT_TIME': <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, 'CURRENT_TIMESTAMP': <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, 'CURRENT_USER': <TokenType.CURRENT_USER: 'CURRENT_USER'>, 'DATABASE': <TokenType.DATABASE: 'DATABASE'>, 'DEFAULT': <TokenType.DEFAULT: 'DEFAULT'>, 'DELETE': <TokenType.DELETE: 'DELETE'>, 'DESC': <TokenType.DESC: 'DESC'>, 'DESCRIBE': <TokenType.DESCRIBE: 'DESCRIBE'>, 'DISTINCT': <TokenType.DISTINCT: 'DISTINCT'>, 'DISTRIBUTE BY': <TokenType.DISTRIBUTE_BY: 'DISTRIBUTE_BY'>, 'DIV': <TokenType.DIV: 'DIV'>, 'DROP': <TokenType.DROP: 'DROP'>, 'ELSE': <TokenType.ELSE: 'ELSE'>, 'END': <TokenType.END: 'END'>, 'ESCAPE': <TokenType.ESCAPE: 'ESCAPE'>, 'EXCEPT': <TokenType.EXCEPT: 'EXCEPT'>, 'EXECUTE': <TokenType.EXECUTE: 'EXECUTE'>, 'EXISTS': <TokenType.EXISTS: 'EXISTS'>, 'FALSE': <TokenType.FALSE: 'FALSE'>, 'FETCH': <TokenType.FETCH: 'FETCH'>, 'FILTER': <TokenType.FILTER: 'FILTER'>, 'FIRST': <TokenType.FIRST: 'FIRST'>, 'FULL': <TokenType.FULL: 'FULL'>, 'FUNCTION': <TokenType.FUNCTION: 'FUNCTION'>, 'FOR': <TokenType.FOR: 'FOR'>, 'FOREIGN KEY': <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, 'FORMAT': <TokenType.FORMAT: 'FORMAT'>, 'FROM': <TokenType.FROM: 'FROM'>, 'GEOGRAPHY': <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, 'GEOMETRY': <TokenType.GEOMETRY: 'GEOMETRY'>, 'GLOB': <TokenType.GLOB: 'GLOB'>, 'GROUP BY': <TokenType.GROUP_BY: 'GROUP_BY'>, 'GROUPING SETS': <TokenType.GROUPING_SETS: 'GROUPING_SETS'>, 'HAVING': <TokenType.HAVING: 'HAVING'>, 'ILIKE': <TokenType.ILIKE: 'ILIKE'>, 'IN': <TokenType.IN: 'IN'>, 'INDEX': <TokenType.INDEX: 'INDEX'>, 'INET': <TokenType.INET: 'INET'>, 'INNER': <TokenType.INNER: 'INNER'>, 'INSERT': <TokenType.INSERT: 'INSERT'>, 'INTERVAL': <TokenType.INTERVAL: 'INTERVAL'>, 'INTERSECT': <TokenType.INTERSECT: 'INTERSECT'>, 'INTO': <TokenType.INTO: 'INTO'>, 'IS': <TokenType.IS: 'IS'>, 'ISNULL': <TokenType.ISNULL: 'ISNULL'>, 'JOIN': <TokenType.JOIN: 'JOIN'>, 'KEEP': <TokenType.KEEP: 'KEEP'>, 'LATERAL': <TokenType.LATERAL: 'LATERAL'>, 'LEFT': <TokenType.LEFT: 'LEFT'>, 'LIKE': <TokenType.LIKE: 'LIKE'>, 'LIMIT': <TokenType.LIMIT: 'LIMIT'>, 'LOAD': <TokenType.LOAD: 'LOAD'>, 'LOCK': <TokenType.LOCK: 'LOCK'>, 'MERGE': <TokenType.MERGE: 'MERGE'>, 'NATURAL': <TokenType.NATURAL: 'NATURAL'>, 'NEXT': <TokenType.NEXT: 'NEXT'>, 'NOT': <TokenType.NOT: 'NOT'>, 'NOTNULL': <TokenType.NOTNULL: 'NOTNULL'>, 'NULL': <TokenType.NULL: 'NULL'>, 'OBJECT': <TokenType.OBJECT: 'OBJECT'>, 'OFFSET': <TokenType.OFFSET: 'OFFSET'>, 'ON': <TokenType.ON: 'ON'>, 'OR': <TokenType.OR: 'OR'>, 'XOR': <TokenType.XOR: 'XOR'>, 'ORDER BY': <TokenType.ORDER_BY: 'ORDER_BY'>, 'ORDINALITY': <TokenType.ORDINALITY: 'ORDINALITY'>, 'OUTER': <TokenType.OUTER: 'OUTER'>, 'OVER': <TokenType.OVER: 'OVER'>, 'OVERLAPS': <TokenType.OVERLAPS: 'OVERLAPS'>, 'OVERWRITE': <TokenType.OVERWRITE: 'OVERWRITE'>, 'PARTITION': <TokenType.PARTITION: 'PARTITION'>, 'PARTITION BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PARTITIONED BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PARTITIONED_BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PERCENT': <TokenType.PERCENT: 'PERCENT'>, 'PIVOT': <TokenType.PIVOT: 'PIVOT'>, 'PRAGMA': <TokenType.PRAGMA: 'PRAGMA'>, 'PRIMARY KEY': <TokenType.PRIMARY_KEY: 'PRIMARY_KEY'>, 'PROCEDURE': <TokenType.PROCEDURE: 'PROCEDURE'>, 'QUALIFY': <TokenType.QUALIFY: 'QUALIFY'>, 'RANGE': <TokenType.RANGE: 'RANGE'>, 'RECURSIVE': <TokenType.RECURSIVE: 'RECURSIVE'>, 'REGEXP': <TokenType.RLIKE: 'RLIKE'>, 'REPLACE': <TokenType.REPLACE: 'REPLACE'>, 'RETURNING': <TokenType.RETURNING: 'RETURNING'>, 'REFERENCES': <TokenType.REFERENCES: 'REFERENCES'>, 'RIGHT': <TokenType.RIGHT: 'RIGHT'>, 'RLIKE': <TokenType.RLIKE: 'RLIKE'>, 'ROLLBACK': <TokenType.ROLLBACK: 'ROLLBACK'>, 'ROLLUP': <TokenType.ROLLUP: 'ROLLUP'>, 'ROW': <TokenType.ROW: 'ROW'>, 'ROWS': <TokenType.ROWS: 'ROWS'>, 'SCHEMA': <TokenType.SCHEMA: 'SCHEMA'>, 'SELECT': <TokenType.SELECT: 'SELECT'>, 'SEMI': <TokenType.SEMI: 'SEMI'>, 'SET': <TokenType.SET: 'SET'>, 'SETTINGS': <TokenType.SETTINGS: 'SETTINGS'>, 'SHOW': <TokenType.SHOW: 'SHOW'>, 'SIMILAR TO': <TokenType.SIMILAR_TO: 'SIMILAR_TO'>, 'SOME': <TokenType.SOME: 'SOME'>, 'SORT BY': <TokenType.SORT_BY: 'SORT_BY'>, 'START WITH': <TokenType.START_WITH: 'START_WITH'>, 'TABLE': <TokenType.TABLE: 'TABLE'>, 'TABLESAMPLE': <TokenType.TABLE_SAMPLE: 'TABLE_SAMPLE'>, 'TEMP': <TokenType.TEMPORARY: 'TEMPORARY'>, 'TEMPORARY': <TokenType.TEMPORARY: 'TEMPORARY'>, 'THEN': <TokenType.THEN: 'THEN'>, 'TRUE': <TokenType.TRUE: 'TRUE'>, 'UNION': <TokenType.UNION: 'UNION'>, 'UNKNOWN': <TokenType.UNKNOWN: 'UNKNOWN'>, 'UNNEST': <TokenType.UNNEST: 'UNNEST'>, 'UNPIVOT': <TokenType.UNPIVOT: 'UNPIVOT'>, 'UPDATE': <TokenType.UPDATE: 'UPDATE'>, 'USE': <TokenType.USE: 'USE'>, 'USING': <TokenType.USING: 'USING'>, 'UUID': <TokenType.UUID: 'UUID'>, 'VALUES': <TokenType.VALUES: 'VALUES'>, 'VIEW': <TokenType.VIEW: 'VIEW'>, 'VOLATILE': <TokenType.VOLATILE: 'VOLATILE'>, 'WHEN': <TokenType.WHEN: 'WHEN'>, 'WHERE': <TokenType.WHERE: 'WHERE'>, 'WINDOW': <TokenType.WINDOW: 'WINDOW'>, 'WITH': <TokenType.WITH: 'WITH'>, 'APPLY': <TokenType.APPLY: 'APPLY'>, 'ARRAY': <TokenType.ARRAY: 'ARRAY'>, 'BIT': <TokenType.BIT: 'BIT'>, 'BOOL': <TokenType.BOOLEAN: 'BOOLEAN'>, 'BOOLEAN': <TokenType.BOOLEAN: 'BOOLEAN'>, 'BYTE': <TokenType.TINYINT: 'TINYINT'>, 'MEDIUMINT': <TokenType.MEDIUMINT: 'MEDIUMINT'>, 'TINYINT': <TokenType.TINYINT: 'TINYINT'>, 'SHORT': <TokenType.SMALLINT: 'SMALLINT'>, 'SMALLINT': <TokenType.SMALLINT: 'SMALLINT'>, 'INT128': <TokenType.INT128: 'INT128'>, 'INT2': <TokenType.SMALLINT: 'SMALLINT'>, 'INTEGER': <TokenType.INT: 'INT'>, 'INT': <TokenType.INT: 'INT'>, 'INT4': <TokenType.INT: 'INT'>, 'LONG': <TokenType.BIGINT: 'BIGINT'>, 'BIGINT': <TokenType.BIGINT: 'BIGINT'>, 'INT8': <TokenType.BIGINT: 'BIGINT'>, 'DEC': <TokenType.DECIMAL: 'DECIMAL'>, 'DECIMAL': <TokenType.DECIMAL: 'DECIMAL'>, 'BIGDECIMAL': <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, 'BIGNUMERIC': <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, 'MAP': <TokenType.MAP: 'MAP'>, 'NULLABLE': <TokenType.NULLABLE: 'NULLABLE'>, 'NUMBER': <TokenType.DECIMAL: 'DECIMAL'>, 'NUMERIC': <TokenType.DECIMAL: 'DECIMAL'>, 'FIXED': <TokenType.DECIMAL: 'DECIMAL'>, 'REAL': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT4': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT8': <TokenType.DOUBLE: 'DOUBLE'>, 'DOUBLE': <TokenType.DOUBLE: 'DOUBLE'>, 'DOUBLE PRECISION': <TokenType.DOUBLE: 'DOUBLE'>, 'JSON': <TokenType.JSON: 'JSON'>, 'CHAR': <TokenType.CHAR: 'CHAR'>, 'CHARACTER': <TokenType.CHAR: 'CHAR'>, 'NCHAR': <TokenType.NCHAR: 'NCHAR'>, 'VARCHAR': <TokenType.VARCHAR: 'VARCHAR'>, 'VARCHAR2': <TokenType.VARCHAR: 'VARCHAR'>, 'NVARCHAR': <TokenType.NVARCHAR: 'NVARCHAR'>, 'NVARCHAR2': <TokenType.NVARCHAR: 'NVARCHAR'>, 'STR': <TokenType.TEXT: 'TEXT'>, 'STRING': <TokenType.TEXT: 'TEXT'>, 'TEXT': <TokenType.TEXT: 'TEXT'>, 'LONGTEXT': <TokenType.LONGTEXT: 'LONGTEXT'>, 'MEDIUMTEXT': <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, 'TINYTEXT': <TokenType.TINYTEXT: 'TINYTEXT'>, 'CLOB': <TokenType.TEXT: 'TEXT'>, 'LONGVARCHAR': <TokenType.TEXT: 'TEXT'>, 'BINARY': <TokenType.BINARY: 'BINARY'>, 'BLOB': <TokenType.VARBINARY: 'VARBINARY'>, 'LONGBLOB': <TokenType.LONGBLOB: 'LONGBLOB'>, 'MEDIUMBLOB': <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, 'TINYBLOB': <TokenType.TINYBLOB: 'TINYBLOB'>, 'BYTEA': <TokenType.VARBINARY: 'VARBINARY'>, 'VARBINARY': <TokenType.VARBINARY: 'VARBINARY'>, 'TIME': <TokenType.TIME: 'TIME'>, 'TIMETZ': <TokenType.TIMETZ: 'TIMETZ'>, 'TIMESTAMP': <TokenType.TIMESTAMP: 'TIMESTAMP'>, 'TIMESTAMPTZ': <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, 'TIMESTAMPLTZ': <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, 'DATE': <TokenType.DATE: 'DATE'>, 'DATETIME': <TokenType.DATETIME: 'DATETIME'>, 'INT4RANGE': <TokenType.INT4RANGE: 'INT4RANGE'>, 'INT4MULTIRANGE': <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, 'INT8RANGE': <TokenType.INT8RANGE: 'INT8RANGE'>, 'INT8MULTIRANGE': <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, 'NUMRANGE': <TokenType.NUMRANGE: 'NUMRANGE'>, 'NUMMULTIRANGE': <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, 'TSRANGE': <TokenType.TSRANGE: 'TSRANGE'>, 'TSMULTIRANGE': <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, 'TSTZRANGE': <TokenType.TSTZRANGE: 'TSTZRANGE'>, 'TSTZMULTIRANGE': <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, 'DATERANGE': <TokenType.DATERANGE: 'DATERANGE'>, 'DATEMULTIRANGE': <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, 'UNIQUE': <TokenType.UNIQUE: 'UNIQUE'>, 'STRUCT': <TokenType.STRUCT: 'STRUCT'>, 'VARIANT': <TokenType.VARIANT: 'VARIANT'>, 'ALTER': <TokenType.ALTER: 'ALTER'>, 'ANALYZE': <TokenType.COMMAND: 'COMMAND'>, 'CALL': <TokenType.COMMAND: 'COMMAND'>, 'COMMENT': <TokenType.COMMENT: 'COMMENT'>, 'COPY': <TokenType.COMMAND: 'COMMAND'>, 'EXPLAIN': <TokenType.COMMAND: 'COMMAND'>, 'GRANT': <TokenType.COMMAND: 'COMMAND'>, 'OPTIMIZE': <TokenType.COMMAND: 'COMMAND'>, 'PREPARE': <TokenType.COMMAND: 'COMMAND'>, 'TRUNCATE': <TokenType.COMMAND: 'COMMAND'>, 'VACUUM': <TokenType.COMMAND: 'COMMAND'>, 'USER-DEFINED': <TokenType.USERDEFINED: 'USERDEFINED'>, 'FOR VERSION': <TokenType.VERSION_SNAPSHOT: 'VERSION_SNAPSHOT'>, 'FOR TIMESTAMP': <TokenType.TIMESTAMP_SNAPSHOT: 'TIMESTAMP_SNAPSHOT'>, '^=': <TokenType.NEQ: 'NEQ'>, 'BYTEINT': <TokenType.SMALLINT: 'SMALLINT'>, 'COLLECT': <TokenType.COMMAND: 'COMMAND'>, 'GE': <TokenType.GTE: 'GTE'>, 'GT': <TokenType.GT: 'GT'>, 'HELP': <TokenType.COMMAND: 'COMMAND'>, 'INS': <TokenType.INSERT: 'INSERT'>, 'LE': <TokenType.LTE: 'LTE'>, 'LT': <TokenType.LT: 'LT'>, 'MOD': <TokenType.MOD: 'MOD'>, 'NE': <TokenType.NEQ: 'NEQ'>, 'NOT=': <TokenType.NEQ: 'NEQ'>, 'SAMPLE': <TokenType.TABLE_SAMPLE: 'TABLE_SAMPLE'>, 'SEL': <TokenType.SELECT: 'SELECT'>, 'ST_GEOMETRY': <TokenType.GEOMETRY: 'GEOMETRY'>, 'TOP': <TokenType.TOP: 'TOP'>}</span> </div> @@ -1055,95 +1078,97 @@ </div> <a class="headerlink" href="#Teradata.Parser"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Teradata.Parser-58"><a href="#Teradata.Parser-58"><span class="linenos"> 58</span></a> <span class="k">class</span> <span class="nc">Parser</span><span class="p">(</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="p">):</span> -</span><span id="Teradata.Parser-59"><a href="#Teradata.Parser-59"><span class="linenos"> 59</span></a> <span class="n">CHARSET_TRANSLATORS</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Teradata.Parser-60"><a href="#Teradata.Parser-60"><span class="linenos"> 60</span></a> <span class="s2">"GRAPHIC_TO_KANJISJIS"</span><span class="p">,</span> -</span><span id="Teradata.Parser-61"><a href="#Teradata.Parser-61"><span class="linenos"> 61</span></a> <span class="s2">"GRAPHIC_TO_LATIN"</span><span class="p">,</span> -</span><span id="Teradata.Parser-62"><a href="#Teradata.Parser-62"><span class="linenos"> 62</span></a> <span class="s2">"GRAPHIC_TO_UNICODE"</span><span class="p">,</span> -</span><span id="Teradata.Parser-63"><a href="#Teradata.Parser-63"><span class="linenos"> 63</span></a> <span class="s2">"GRAPHIC_TO_UNICODE_PadSpace"</span><span class="p">,</span> -</span><span id="Teradata.Parser-64"><a href="#Teradata.Parser-64"><span class="linenos"> 64</span></a> <span class="s2">"KANJI1_KanjiEBCDIC_TO_UNICODE"</span><span class="p">,</span> -</span><span id="Teradata.Parser-65"><a href="#Teradata.Parser-65"><span class="linenos"> 65</span></a> <span class="s2">"KANJI1_KanjiEUC_TO_UNICODE"</span><span class="p">,</span> -</span><span id="Teradata.Parser-66"><a href="#Teradata.Parser-66"><span class="linenos"> 66</span></a> <span class="s2">"KANJI1_KANJISJIS_TO_UNICODE"</span><span class="p">,</span> -</span><span id="Teradata.Parser-67"><a href="#Teradata.Parser-67"><span class="linenos"> 67</span></a> <span class="s2">"KANJI1_SBC_TO_UNICODE"</span><span class="p">,</span> -</span><span id="Teradata.Parser-68"><a href="#Teradata.Parser-68"><span class="linenos"> 68</span></a> <span class="s2">"KANJISJIS_TO_GRAPHIC"</span><span class="p">,</span> -</span><span id="Teradata.Parser-69"><a href="#Teradata.Parser-69"><span class="linenos"> 69</span></a> <span class="s2">"KANJISJIS_TO_LATIN"</span><span class="p">,</span> -</span><span id="Teradata.Parser-70"><a href="#Teradata.Parser-70"><span class="linenos"> 70</span></a> <span class="s2">"KANJISJIS_TO_UNICODE"</span><span class="p">,</span> -</span><span id="Teradata.Parser-71"><a href="#Teradata.Parser-71"><span class="linenos"> 71</span></a> <span class="s2">"LATIN_TO_GRAPHIC"</span><span class="p">,</span> -</span><span id="Teradata.Parser-72"><a href="#Teradata.Parser-72"><span class="linenos"> 72</span></a> <span class="s2">"LATIN_TO_KANJISJIS"</span><span class="p">,</span> -</span><span id="Teradata.Parser-73"><a href="#Teradata.Parser-73"><span class="linenos"> 73</span></a> <span class="s2">"LATIN_TO_UNICODE"</span><span class="p">,</span> -</span><span id="Teradata.Parser-74"><a href="#Teradata.Parser-74"><span class="linenos"> 74</span></a> <span class="s2">"LOCALE_TO_UNICODE"</span><span class="p">,</span> -</span><span id="Teradata.Parser-75"><a href="#Teradata.Parser-75"><span class="linenos"> 75</span></a> <span class="s2">"UNICODE_TO_GRAPHIC"</span><span class="p">,</span> -</span><span id="Teradata.Parser-76"><a href="#Teradata.Parser-76"><span class="linenos"> 76</span></a> <span class="s2">"UNICODE_TO_GRAPHIC_PadGraphic"</span><span class="p">,</span> -</span><span id="Teradata.Parser-77"><a href="#Teradata.Parser-77"><span class="linenos"> 77</span></a> <span class="s2">"UNICODE_TO_GRAPHIC_VarGraphic"</span><span class="p">,</span> -</span><span id="Teradata.Parser-78"><a href="#Teradata.Parser-78"><span class="linenos"> 78</span></a> <span class="s2">"UNICODE_TO_KANJI1_KanjiEBCDIC"</span><span class="p">,</span> -</span><span id="Teradata.Parser-79"><a href="#Teradata.Parser-79"><span class="linenos"> 79</span></a> <span class="s2">"UNICODE_TO_KANJI1_KanjiEUC"</span><span class="p">,</span> -</span><span id="Teradata.Parser-80"><a href="#Teradata.Parser-80"><span class="linenos"> 80</span></a> <span class="s2">"UNICODE_TO_KANJI1_KANJISJIS"</span><span class="p">,</span> -</span><span id="Teradata.Parser-81"><a href="#Teradata.Parser-81"><span class="linenos"> 81</span></a> <span class="s2">"UNICODE_TO_KANJI1_SBC"</span><span class="p">,</span> -</span><span id="Teradata.Parser-82"><a href="#Teradata.Parser-82"><span class="linenos"> 82</span></a> <span class="s2">"UNICODE_TO_KANJISJIS"</span><span class="p">,</span> -</span><span id="Teradata.Parser-83"><a href="#Teradata.Parser-83"><span class="linenos"> 83</span></a> <span class="s2">"UNICODE_TO_LATIN"</span><span class="p">,</span> -</span><span id="Teradata.Parser-84"><a href="#Teradata.Parser-84"><span class="linenos"> 84</span></a> <span class="s2">"UNICODE_TO_LOCALE"</span><span class="p">,</span> -</span><span id="Teradata.Parser-85"><a href="#Teradata.Parser-85"><span class="linenos"> 85</span></a> <span class="s2">"UNICODE_TO_UNICODE_FoldSpace"</span><span class="p">,</span> -</span><span id="Teradata.Parser-86"><a href="#Teradata.Parser-86"><span class="linenos"> 86</span></a> <span class="s2">"UNICODE_TO_UNICODE_Fullwidth"</span><span class="p">,</span> -</span><span id="Teradata.Parser-87"><a href="#Teradata.Parser-87"><span class="linenos"> 87</span></a> <span class="s2">"UNICODE_TO_UNICODE_Halfwidth"</span><span class="p">,</span> -</span><span id="Teradata.Parser-88"><a href="#Teradata.Parser-88"><span class="linenos"> 88</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFC"</span><span class="p">,</span> -</span><span id="Teradata.Parser-89"><a href="#Teradata.Parser-89"><span class="linenos"> 89</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFD"</span><span class="p">,</span> -</span><span id="Teradata.Parser-90"><a href="#Teradata.Parser-90"><span class="linenos"> 90</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFKC"</span><span class="p">,</span> -</span><span id="Teradata.Parser-91"><a href="#Teradata.Parser-91"><span class="linenos"> 91</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFKD"</span><span class="p">,</span> -</span><span id="Teradata.Parser-92"><a href="#Teradata.Parser-92"><span class="linenos"> 92</span></a> <span class="p">}</span> -</span><span id="Teradata.Parser-93"><a href="#Teradata.Parser-93"><span class="linenos"> 93</span></a> -</span><span id="Teradata.Parser-94"><a href="#Teradata.Parser-94"><span class="linenos"> 94</span></a> <span class="n">FUNC_TOKENS</span> <span class="o">=</span> <span class="p">{</span><span class="o">*</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNC_TOKENS</span><span class="p">}</span> -</span><span id="Teradata.Parser-95"><a href="#Teradata.Parser-95"><span class="linenos"> 95</span></a> <span class="n">FUNC_TOKENS</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">REPLACE</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Teradata.Parser-59"><a href="#Teradata.Parser-59"><span class="linenos"> 59</span></a> <span class="k">class</span> <span class="nc">Parser</span><span class="p">(</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="p">):</span> +</span><span id="Teradata.Parser-60"><a href="#Teradata.Parser-60"><span class="linenos"> 60</span></a> <span class="n">TABLESAMPLE_CSV</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="Teradata.Parser-61"><a href="#Teradata.Parser-61"><span class="linenos"> 61</span></a> +</span><span id="Teradata.Parser-62"><a href="#Teradata.Parser-62"><span class="linenos"> 62</span></a> <span class="n">CHARSET_TRANSLATORS</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Teradata.Parser-63"><a href="#Teradata.Parser-63"><span class="linenos"> 63</span></a> <span class="s2">"GRAPHIC_TO_KANJISJIS"</span><span class="p">,</span> +</span><span id="Teradata.Parser-64"><a href="#Teradata.Parser-64"><span class="linenos"> 64</span></a> <span class="s2">"GRAPHIC_TO_LATIN"</span><span class="p">,</span> +</span><span id="Teradata.Parser-65"><a href="#Teradata.Parser-65"><span class="linenos"> 65</span></a> <span class="s2">"GRAPHIC_TO_UNICODE"</span><span class="p">,</span> +</span><span id="Teradata.Parser-66"><a href="#Teradata.Parser-66"><span class="linenos"> 66</span></a> <span class="s2">"GRAPHIC_TO_UNICODE_PadSpace"</span><span class="p">,</span> +</span><span id="Teradata.Parser-67"><a href="#Teradata.Parser-67"><span class="linenos"> 67</span></a> <span class="s2">"KANJI1_KanjiEBCDIC_TO_UNICODE"</span><span class="p">,</span> +</span><span id="Teradata.Parser-68"><a href="#Teradata.Parser-68"><span class="linenos"> 68</span></a> <span class="s2">"KANJI1_KanjiEUC_TO_UNICODE"</span><span class="p">,</span> +</span><span id="Teradata.Parser-69"><a href="#Teradata.Parser-69"><span class="linenos"> 69</span></a> <span class="s2">"KANJI1_KANJISJIS_TO_UNICODE"</span><span class="p">,</span> +</span><span id="Teradata.Parser-70"><a href="#Teradata.Parser-70"><span class="linenos"> 70</span></a> <span class="s2">"KANJI1_SBC_TO_UNICODE"</span><span class="p">,</span> +</span><span id="Teradata.Parser-71"><a href="#Teradata.Parser-71"><span class="linenos"> 71</span></a> <span class="s2">"KANJISJIS_TO_GRAPHIC"</span><span class="p">,</span> +</span><span id="Teradata.Parser-72"><a href="#Teradata.Parser-72"><span class="linenos"> 72</span></a> <span class="s2">"KANJISJIS_TO_LATIN"</span><span class="p">,</span> +</span><span id="Teradata.Parser-73"><a href="#Teradata.Parser-73"><span class="linenos"> 73</span></a> <span class="s2">"KANJISJIS_TO_UNICODE"</span><span class="p">,</span> +</span><span id="Teradata.Parser-74"><a href="#Teradata.Parser-74"><span class="linenos"> 74</span></a> <span class="s2">"LATIN_TO_GRAPHIC"</span><span class="p">,</span> +</span><span id="Teradata.Parser-75"><a href="#Teradata.Parser-75"><span class="linenos"> 75</span></a> <span class="s2">"LATIN_TO_KANJISJIS"</span><span class="p">,</span> +</span><span id="Teradata.Parser-76"><a href="#Teradata.Parser-76"><span class="linenos"> 76</span></a> <span class="s2">"LATIN_TO_UNICODE"</span><span class="p">,</span> +</span><span id="Teradata.Parser-77"><a href="#Teradata.Parser-77"><span class="linenos"> 77</span></a> <span class="s2">"LOCALE_TO_UNICODE"</span><span class="p">,</span> +</span><span id="Teradata.Parser-78"><a href="#Teradata.Parser-78"><span class="linenos"> 78</span></a> <span class="s2">"UNICODE_TO_GRAPHIC"</span><span class="p">,</span> +</span><span id="Teradata.Parser-79"><a href="#Teradata.Parser-79"><span class="linenos"> 79</span></a> <span class="s2">"UNICODE_TO_GRAPHIC_PadGraphic"</span><span class="p">,</span> +</span><span id="Teradata.Parser-80"><a href="#Teradata.Parser-80"><span class="linenos"> 80</span></a> <span class="s2">"UNICODE_TO_GRAPHIC_VarGraphic"</span><span class="p">,</span> +</span><span id="Teradata.Parser-81"><a href="#Teradata.Parser-81"><span class="linenos"> 81</span></a> <span class="s2">"UNICODE_TO_KANJI1_KanjiEBCDIC"</span><span class="p">,</span> +</span><span id="Teradata.Parser-82"><a href="#Teradata.Parser-82"><span class="linenos"> 82</span></a> <span class="s2">"UNICODE_TO_KANJI1_KanjiEUC"</span><span class="p">,</span> +</span><span id="Teradata.Parser-83"><a href="#Teradata.Parser-83"><span class="linenos"> 83</span></a> <span class="s2">"UNICODE_TO_KANJI1_KANJISJIS"</span><span class="p">,</span> +</span><span id="Teradata.Parser-84"><a href="#Teradata.Parser-84"><span class="linenos"> 84</span></a> <span class="s2">"UNICODE_TO_KANJI1_SBC"</span><span class="p">,</span> +</span><span id="Teradata.Parser-85"><a href="#Teradata.Parser-85"><span class="linenos"> 85</span></a> <span class="s2">"UNICODE_TO_KANJISJIS"</span><span class="p">,</span> +</span><span id="Teradata.Parser-86"><a href="#Teradata.Parser-86"><span class="linenos"> 86</span></a> <span class="s2">"UNICODE_TO_LATIN"</span><span class="p">,</span> +</span><span id="Teradata.Parser-87"><a href="#Teradata.Parser-87"><span class="linenos"> 87</span></a> <span class="s2">"UNICODE_TO_LOCALE"</span><span class="p">,</span> +</span><span id="Teradata.Parser-88"><a href="#Teradata.Parser-88"><span class="linenos"> 88</span></a> <span class="s2">"UNICODE_TO_UNICODE_FoldSpace"</span><span class="p">,</span> +</span><span id="Teradata.Parser-89"><a href="#Teradata.Parser-89"><span class="linenos"> 89</span></a> <span class="s2">"UNICODE_TO_UNICODE_Fullwidth"</span><span class="p">,</span> +</span><span id="Teradata.Parser-90"><a href="#Teradata.Parser-90"><span class="linenos"> 90</span></a> <span class="s2">"UNICODE_TO_UNICODE_Halfwidth"</span><span class="p">,</span> +</span><span id="Teradata.Parser-91"><a href="#Teradata.Parser-91"><span class="linenos"> 91</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFC"</span><span class="p">,</span> +</span><span id="Teradata.Parser-92"><a href="#Teradata.Parser-92"><span class="linenos"> 92</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFD"</span><span class="p">,</span> +</span><span id="Teradata.Parser-93"><a href="#Teradata.Parser-93"><span class="linenos"> 93</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFKC"</span><span class="p">,</span> +</span><span id="Teradata.Parser-94"><a href="#Teradata.Parser-94"><span class="linenos"> 94</span></a> <span class="s2">"UNICODE_TO_UNICODE_NFKD"</span><span class="p">,</span> +</span><span id="Teradata.Parser-95"><a href="#Teradata.Parser-95"><span class="linenos"> 95</span></a> <span class="p">}</span> </span><span id="Teradata.Parser-96"><a href="#Teradata.Parser-96"><span class="linenos"> 96</span></a> -</span><span id="Teradata.Parser-97"><a href="#Teradata.Parser-97"><span class="linenos"> 97</span></a> <span class="n">STATEMENT_PARSERS</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Teradata.Parser-98"><a href="#Teradata.Parser-98"><span class="linenos"> 98</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">STATEMENT_PARSERS</span><span class="p">,</span> -</span><span id="Teradata.Parser-99"><a href="#Teradata.Parser-99"><span class="linenos"> 99</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">DATABASE</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span> -</span><span id="Teradata.Parser-100"><a href="#Teradata.Parser-100"><span class="linenos">100</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Use</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_table</span><span class="p">(</span><span class="n">schema</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> -</span><span id="Teradata.Parser-101"><a href="#Teradata.Parser-101"><span class="linenos">101</span></a> <span class="p">),</span> -</span><span id="Teradata.Parser-102"><a href="#Teradata.Parser-102"><span class="linenos">102</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">REPLACE</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_create</span><span class="p">(),</span> -</span><span id="Teradata.Parser-103"><a href="#Teradata.Parser-103"><span class="linenos">103</span></a> <span class="p">}</span> -</span><span id="Teradata.Parser-104"><a href="#Teradata.Parser-104"><span class="linenos">104</span></a> -</span><span id="Teradata.Parser-105"><a href="#Teradata.Parser-105"><span class="linenos">105</span></a> <span class="n">FUNCTION_PARSERS</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Teradata.Parser-106"><a href="#Teradata.Parser-106"><span class="linenos">106</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNCTION_PARSERS</span><span class="p">,</span> -</span><span id="Teradata.Parser-107"><a href="#Teradata.Parser-107"><span class="linenos">107</span></a> <span class="s2">"RANGE_N"</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_rangen</span><span class="p">(),</span> -</span><span id="Teradata.Parser-108"><a href="#Teradata.Parser-108"><span class="linenos">108</span></a> <span class="s2">"TRANSLATE"</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_translate</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">STRICT_CAST</span><span class="p">),</span> -</span><span id="Teradata.Parser-109"><a href="#Teradata.Parser-109"><span class="linenos">109</span></a> <span class="p">}</span> -</span><span id="Teradata.Parser-110"><a href="#Teradata.Parser-110"><span class="linenos">110</span></a> -</span><span id="Teradata.Parser-111"><a href="#Teradata.Parser-111"><span class="linenos">111</span></a> <span class="k">def</span> <span class="nf">_parse_translate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">strict</span><span class="p">:</span> <span class="nb">bool</span><span class="p">)</span> <span class="o">-></span> <span class="n">exp</span><span class="o">.</span><span class="n">Expression</span><span class="p">:</span> -</span><span id="Teradata.Parser-112"><a href="#Teradata.Parser-112"><span class="linenos">112</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_conjunction</span><span class="p">()</span> +</span><span id="Teradata.Parser-97"><a href="#Teradata.Parser-97"><span class="linenos"> 97</span></a> <span class="n">FUNC_TOKENS</span> <span class="o">=</span> <span class="p">{</span><span class="o">*</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNC_TOKENS</span><span class="p">}</span> +</span><span id="Teradata.Parser-98"><a href="#Teradata.Parser-98"><span class="linenos"> 98</span></a> <span class="n">FUNC_TOKENS</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">REPLACE</span><span class="p">)</span> +</span><span id="Teradata.Parser-99"><a href="#Teradata.Parser-99"><span class="linenos"> 99</span></a> +</span><span id="Teradata.Parser-100"><a href="#Teradata.Parser-100"><span class="linenos">100</span></a> <span class="n">STATEMENT_PARSERS</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Teradata.Parser-101"><a href="#Teradata.Parser-101"><span class="linenos">101</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">STATEMENT_PARSERS</span><span class="p">,</span> +</span><span id="Teradata.Parser-102"><a href="#Teradata.Parser-102"><span class="linenos">102</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">DATABASE</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span> +</span><span id="Teradata.Parser-103"><a href="#Teradata.Parser-103"><span class="linenos">103</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Use</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_table</span><span class="p">(</span><span class="n">schema</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> +</span><span id="Teradata.Parser-104"><a href="#Teradata.Parser-104"><span class="linenos">104</span></a> <span class="p">),</span> +</span><span id="Teradata.Parser-105"><a href="#Teradata.Parser-105"><span class="linenos">105</span></a> <span class="n">TokenType</span><span class="o">.</span><span class="n">REPLACE</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_create</span><span class="p">(),</span> +</span><span id="Teradata.Parser-106"><a href="#Teradata.Parser-106"><span class="linenos">106</span></a> <span class="p">}</span> +</span><span id="Teradata.Parser-107"><a href="#Teradata.Parser-107"><span class="linenos">107</span></a> +</span><span id="Teradata.Parser-108"><a href="#Teradata.Parser-108"><span class="linenos">108</span></a> <span class="n">FUNCTION_PARSERS</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Teradata.Parser-109"><a href="#Teradata.Parser-109"><span class="linenos">109</span></a> <span class="o">**</span><span class="n">parser</span><span class="o">.</span><span class="n">Parser</span><span class="o">.</span><span class="n">FUNCTION_PARSERS</span><span class="p">,</span> +</span><span id="Teradata.Parser-110"><a href="#Teradata.Parser-110"><span class="linenos">110</span></a> <span class="s2">"RANGE_N"</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_rangen</span><span class="p">(),</span> +</span><span id="Teradata.Parser-111"><a href="#Teradata.Parser-111"><span class="linenos">111</span></a> <span class="s2">"TRANSLATE"</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_translate</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">STRICT_CAST</span><span class="p">),</span> +</span><span id="Teradata.Parser-112"><a href="#Teradata.Parser-112"><span class="linenos">112</span></a> <span class="p">}</span> </span><span id="Teradata.Parser-113"><a href="#Teradata.Parser-113"><span class="linenos">113</span></a> -</span><span id="Teradata.Parser-114"><a href="#Teradata.Parser-114"><span class="linenos">114</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">USING</span><span class="p">):</span> -</span><span id="Teradata.Parser-115"><a href="#Teradata.Parser-115"><span class="linenos">115</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">raise_error</span><span class="p">(</span><span class="s2">"Expected USING in TRANSLATE"</span><span class="p">)</span> +</span><span id="Teradata.Parser-114"><a href="#Teradata.Parser-114"><span class="linenos">114</span></a> <span class="k">def</span> <span class="nf">_parse_translate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">strict</span><span class="p">:</span> <span class="nb">bool</span><span class="p">)</span> <span class="o">-></span> <span class="n">exp</span><span class="o">.</span><span class="n">Expression</span><span class="p">:</span> +</span><span id="Teradata.Parser-115"><a href="#Teradata.Parser-115"><span class="linenos">115</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_conjunction</span><span class="p">()</span> </span><span id="Teradata.Parser-116"><a href="#Teradata.Parser-116"><span class="linenos">116</span></a> -</span><span id="Teradata.Parser-117"><a href="#Teradata.Parser-117"><span class="linenos">117</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match_texts</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">CHARSET_TRANSLATORS</span><span class="p">):</span> -</span><span id="Teradata.Parser-118"><a href="#Teradata.Parser-118"><span class="linenos">118</span></a> <span class="n">charset_split</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_prev</span><span class="o">.</span><span class="n">text</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"_TO_"</span><span class="p">)</span> -</span><span id="Teradata.Parser-119"><a href="#Teradata.Parser-119"><span class="linenos">119</span></a> <span class="n">to</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">CharacterSet</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">charset_split</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span> -</span><span id="Teradata.Parser-120"><a href="#Teradata.Parser-120"><span class="linenos">120</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="Teradata.Parser-121"><a href="#Teradata.Parser-121"><span class="linenos">121</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">raise_error</span><span class="p">(</span><span class="s2">"Expected a character set translator after USING in TRANSLATE"</span><span class="p">)</span> -</span><span id="Teradata.Parser-122"><a href="#Teradata.Parser-122"><span class="linenos">122</span></a> -</span><span id="Teradata.Parser-123"><a href="#Teradata.Parser-123"><span class="linenos">123</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Cast</span> <span class="k">if</span> <span class="n">strict</span> <span class="k">else</span> <span class="n">exp</span><span class="o">.</span><span class="n">TryCast</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">this</span><span class="p">,</span> <span class="n">to</span><span class="o">=</span><span class="n">to</span><span class="p">)</span> -</span><span id="Teradata.Parser-124"><a href="#Teradata.Parser-124"><span class="linenos">124</span></a> -</span><span id="Teradata.Parser-125"><a href="#Teradata.Parser-125"><span class="linenos">125</span></a> <span class="c1"># FROM before SET in Teradata UPDATE syntax</span> -</span><span id="Teradata.Parser-126"><a href="#Teradata.Parser-126"><span class="linenos">126</span></a> <span class="c1"># https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/Teradata-VantageTM-SQL-Data-Manipulation-Language-17.20/Statement-Syntax/UPDATE/UPDATE-Syntax-Basic-Form-FROM-Clause</span> -</span><span id="Teradata.Parser-127"><a href="#Teradata.Parser-127"><span class="linenos">127</span></a> <span class="k">def</span> <span class="nf">_parse_update</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">exp</span><span class="o">.</span><span class="n">Update</span><span class="p">:</span> -</span><span id="Teradata.Parser-128"><a href="#Teradata.Parser-128"><span class="linenos">128</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span> -</span><span id="Teradata.Parser-129"><a href="#Teradata.Parser-129"><span class="linenos">129</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Update</span><span class="p">,</span> -</span><span id="Teradata.Parser-130"><a href="#Teradata.Parser-130"><span class="linenos">130</span></a> <span class="o">**</span><span class="p">{</span> <span class="c1"># type: ignore</span> -</span><span id="Teradata.Parser-131"><a href="#Teradata.Parser-131"><span class="linenos">131</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_table</span><span class="p">(</span><span class="n">alias_tokens</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">UPDATE_ALIAS_TOKENS</span><span class="p">),</span> -</span><span id="Teradata.Parser-132"><a href="#Teradata.Parser-132"><span class="linenos">132</span></a> <span class="s2">"from"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_from</span><span class="p">(</span><span class="n">joins</span><span class="o">=</span><span class="kc">True</span><span class="p">),</span> -</span><span id="Teradata.Parser-133"><a href="#Teradata.Parser-133"><span class="linenos">133</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">SET</span><span class="p">)</span> -</span><span id="Teradata.Parser-134"><a href="#Teradata.Parser-134"><span class="linenos">134</span></a> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_csv</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_equality</span><span class="p">),</span> -</span><span id="Teradata.Parser-135"><a href="#Teradata.Parser-135"><span class="linenos">135</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_where</span><span class="p">(),</span> -</span><span id="Teradata.Parser-136"><a href="#Teradata.Parser-136"><span class="linenos">136</span></a> <span class="p">},</span> -</span><span id="Teradata.Parser-137"><a href="#Teradata.Parser-137"><span class="linenos">137</span></a> <span class="p">)</span> -</span><span id="Teradata.Parser-138"><a href="#Teradata.Parser-138"><span class="linenos">138</span></a> -</span><span id="Teradata.Parser-139"><a href="#Teradata.Parser-139"><span class="linenos">139</span></a> <span class="k">def</span> <span class="nf">_parse_rangen</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Teradata.Parser-140"><a href="#Teradata.Parser-140"><span class="linenos">140</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_id_var</span><span class="p">()</span> -</span><span id="Teradata.Parser-141"><a href="#Teradata.Parser-141"><span class="linenos">141</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_match</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">BETWEEN</span><span class="p">)</span> -</span><span id="Teradata.Parser-142"><a href="#Teradata.Parser-142"><span class="linenos">142</span></a> -</span><span id="Teradata.Parser-143"><a href="#Teradata.Parser-143"><span class="linenos">143</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_csv</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_conjunction</span><span class="p">)</span> -</span><span id="Teradata.Parser-144"><a href="#Teradata.Parser-144"><span class="linenos">144</span></a> <span class="n">each</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match_text_seq</span><span class="p">(</span><span class="s2">"EACH"</span><span class="p">)</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_conjunction</span><span class="p">()</span> +</span><span id="Teradata.Parser-117"><a href="#Teradata.Parser-117"><span class="linenos">117</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">USING</span><span class="p">):</span> +</span><span id="Teradata.Parser-118"><a href="#Teradata.Parser-118"><span class="linenos">118</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">raise_error</span><span class="p">(</span><span class="s2">"Expected USING in TRANSLATE"</span><span class="p">)</span> +</span><span id="Teradata.Parser-119"><a href="#Teradata.Parser-119"><span class="linenos">119</span></a> +</span><span id="Teradata.Parser-120"><a href="#Teradata.Parser-120"><span class="linenos">120</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match_texts</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">CHARSET_TRANSLATORS</span><span class="p">):</span> +</span><span id="Teradata.Parser-121"><a href="#Teradata.Parser-121"><span class="linenos">121</span></a> <span class="n">charset_split</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_prev</span><span class="o">.</span><span class="n">text</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"_TO_"</span><span class="p">)</span> +</span><span id="Teradata.Parser-122"><a href="#Teradata.Parser-122"><span class="linenos">122</span></a> <span class="n">to</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">CharacterSet</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">charset_split</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span> +</span><span id="Teradata.Parser-123"><a href="#Teradata.Parser-123"><span class="linenos">123</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="Teradata.Parser-124"><a href="#Teradata.Parser-124"><span class="linenos">124</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">raise_error</span><span class="p">(</span><span class="s2">"Expected a character set translator after USING in TRANSLATE"</span><span class="p">)</span> +</span><span id="Teradata.Parser-125"><a href="#Teradata.Parser-125"><span class="linenos">125</span></a> +</span><span id="Teradata.Parser-126"><a href="#Teradata.Parser-126"><span class="linenos">126</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Cast</span> <span class="k">if</span> <span class="n">strict</span> <span class="k">else</span> <span class="n">exp</span><span class="o">.</span><span class="n">TryCast</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">this</span><span class="p">,</span> <span class="n">to</span><span class="o">=</span><span class="n">to</span><span class="p">)</span> +</span><span id="Teradata.Parser-127"><a href="#Teradata.Parser-127"><span class="linenos">127</span></a> +</span><span id="Teradata.Parser-128"><a href="#Teradata.Parser-128"><span class="linenos">128</span></a> <span class="c1"># FROM before SET in Teradata UPDATE syntax</span> +</span><span id="Teradata.Parser-129"><a href="#Teradata.Parser-129"><span class="linenos">129</span></a> <span class="c1"># https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/Teradata-VantageTM-SQL-Data-Manipulation-Language-17.20/Statement-Syntax/UPDATE/UPDATE-Syntax-Basic-Form-FROM-Clause</span> +</span><span id="Teradata.Parser-130"><a href="#Teradata.Parser-130"><span class="linenos">130</span></a> <span class="k">def</span> <span class="nf">_parse_update</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">exp</span><span class="o">.</span><span class="n">Update</span><span class="p">:</span> +</span><span id="Teradata.Parser-131"><a href="#Teradata.Parser-131"><span class="linenos">131</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span> +</span><span id="Teradata.Parser-132"><a href="#Teradata.Parser-132"><span class="linenos">132</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Update</span><span class="p">,</span> +</span><span id="Teradata.Parser-133"><a href="#Teradata.Parser-133"><span class="linenos">133</span></a> <span class="o">**</span><span class="p">{</span> <span class="c1"># type: ignore</span> +</span><span id="Teradata.Parser-134"><a href="#Teradata.Parser-134"><span class="linenos">134</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_table</span><span class="p">(</span><span class="n">alias_tokens</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">UPDATE_ALIAS_TOKENS</span><span class="p">),</span> +</span><span id="Teradata.Parser-135"><a href="#Teradata.Parser-135"><span class="linenos">135</span></a> <span class="s2">"from"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_from</span><span class="p">(</span><span class="n">joins</span><span class="o">=</span><span class="kc">True</span><span class="p">),</span> +</span><span id="Teradata.Parser-136"><a href="#Teradata.Parser-136"><span class="linenos">136</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">SET</span><span class="p">)</span> +</span><span id="Teradata.Parser-137"><a href="#Teradata.Parser-137"><span class="linenos">137</span></a> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_csv</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_equality</span><span class="p">),</span> +</span><span id="Teradata.Parser-138"><a href="#Teradata.Parser-138"><span class="linenos">138</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_where</span><span class="p">(),</span> +</span><span id="Teradata.Parser-139"><a href="#Teradata.Parser-139"><span class="linenos">139</span></a> <span class="p">},</span> +</span><span id="Teradata.Parser-140"><a href="#Teradata.Parser-140"><span class="linenos">140</span></a> <span class="p">)</span> +</span><span id="Teradata.Parser-141"><a href="#Teradata.Parser-141"><span class="linenos">141</span></a> +</span><span id="Teradata.Parser-142"><a href="#Teradata.Parser-142"><span class="linenos">142</span></a> <span class="k">def</span> <span class="nf">_parse_rangen</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Teradata.Parser-143"><a href="#Teradata.Parser-143"><span class="linenos">143</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_id_var</span><span class="p">()</span> +</span><span id="Teradata.Parser-144"><a href="#Teradata.Parser-144"><span class="linenos">144</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_match</span><span class="p">(</span><span class="n">TokenType</span><span class="o">.</span><span class="n">BETWEEN</span><span class="p">)</span> </span><span id="Teradata.Parser-145"><a href="#Teradata.Parser-145"><span class="linenos">145</span></a> -</span><span id="Teradata.Parser-146"><a href="#Teradata.Parser-146"><span class="linenos">146</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">RangeN</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">this</span><span class="p">,</span> <span class="n">expressions</span><span class="o">=</span><span class="n">expressions</span><span class="p">,</span> <span class="n">each</span><span class="o">=</span><span class="n">each</span><span class="p">)</span> +</span><span id="Teradata.Parser-146"><a href="#Teradata.Parser-146"><span class="linenos">146</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_csv</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_parse_conjunction</span><span class="p">)</span> +</span><span id="Teradata.Parser-147"><a href="#Teradata.Parser-147"><span class="linenos">147</span></a> <span class="n">each</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_match_text_seq</span><span class="p">(</span><span class="s2">"EACH"</span><span class="p">)</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">_parse_conjunction</span><span class="p">()</span> +</span><span id="Teradata.Parser-148"><a href="#Teradata.Parser-148"><span class="linenos">148</span></a> +</span><span id="Teradata.Parser-149"><a href="#Teradata.Parser-149"><span class="linenos">149</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">RangeN</span><span class="p">,</span> <span class="n">this</span><span class="o">=</span><span class="n">this</span><span class="p">,</span> <span class="n">expressions</span><span class="o">=</span><span class="n">expressions</span><span class="p">,</span> <span class="n">each</span><span class="o">=</span><span class="n">each</span><span class="p">)</span> </span></pre></div> @@ -1164,11 +1189,23 @@ Default: 3</li> </div> + <div id="Teradata.Parser.TABLESAMPLE_CSV" class="classattr"> + <div class="attr variable"> + <span class="name">TABLESAMPLE_CSV</span> = +<span class="default_value">True</span> + + + </div> + <a class="headerlink" href="#Teradata.Parser.TABLESAMPLE_CSV"></a> + + + + </div> <div id="Teradata.Parser.CHARSET_TRANSLATORS" class="classattr"> <div class="attr variable"> <span class="name">CHARSET_TRANSLATORS</span> = <input id="Teradata.Parser.CHARSET_TRANSLATORS-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> - <label class="view-value-button pdoc-button" for="Teradata.Parser.CHARSET_TRANSLATORS-view-value"></label><span class="default_value">{'UNICODE_TO_GRAPHIC', 'UNICODE_TO_KANJI1_KANJISJIS', 'UNICODE_TO_UNICODE_NFC', 'KANJI1_KANJISJIS_TO_UNICODE', 'UNICODE_TO_GRAPHIC_VarGraphic', 'GRAPHIC_TO_KANJISJIS', 'LATIN_TO_UNICODE', 'UNICODE_TO_KANJI1_KanjiEBCDIC', 'UNICODE_TO_KANJISJIS', 'UNICODE_TO_LOCALE', 'KANJISJIS_TO_UNICODE', 'UNICODE_TO_UNICODE_NFD', 'UNICODE_TO_UNICODE_NFKD', 'KANJISJIS_TO_LATIN', 'KANJI1_KanjiEBCDIC_TO_UNICODE', 'UNICODE_TO_GRAPHIC_PadGraphic', 'UNICODE_TO_UNICODE_Fullwidth', 'LOCALE_TO_UNICODE', 'LATIN_TO_KANJISJIS', 'KANJI1_SBC_TO_UNICODE', 'UNICODE_TO_LATIN', 'UNICODE_TO_UNICODE_FoldSpace', 'GRAPHIC_TO_UNICODE_PadSpace', 'LATIN_TO_GRAPHIC', 'KANJISJIS_TO_GRAPHIC', 'UNICODE_TO_KANJI1_SBC', 'GRAPHIC_TO_UNICODE', 'GRAPHIC_TO_LATIN', 'UNICODE_TO_KANJI1_KanjiEUC', 'UNICODE_TO_UNICODE_Halfwidth', 'UNICODE_TO_UNICODE_NFKC', 'KANJI1_KanjiEUC_TO_UNICODE'}</span> + <label class="view-value-button pdoc-button" for="Teradata.Parser.CHARSET_TRANSLATORS-view-value"></label><span class="default_value">{'UNICODE_TO_KANJISJIS', 'LATIN_TO_UNICODE', 'KANJI1_KANJISJIS_TO_UNICODE', 'UNICODE_TO_UNICODE_NFKD', 'KANJI1_SBC_TO_UNICODE', 'UNICODE_TO_KANJI1_SBC', 'UNICODE_TO_UNICODE_NFD', 'UNICODE_TO_LATIN', 'KANJISJIS_TO_UNICODE', 'UNICODE_TO_UNICODE_Halfwidth', 'UNICODE_TO_UNICODE_Fullwidth', 'UNICODE_TO_KANJI1_KANJISJIS', 'GRAPHIC_TO_UNICODE_PadSpace', 'UNICODE_TO_UNICODE_FoldSpace', 'KANJI1_KanjiEBCDIC_TO_UNICODE', 'LATIN_TO_GRAPHIC', 'LOCALE_TO_UNICODE', 'KANJISJIS_TO_LATIN', 'UNICODE_TO_GRAPHIC', 'UNICODE_TO_LOCALE', 'GRAPHIC_TO_KANJISJIS', 'KANJISJIS_TO_GRAPHIC', 'LATIN_TO_KANJISJIS', 'KANJI1_KanjiEUC_TO_UNICODE', 'GRAPHIC_TO_LATIN', 'UNICODE_TO_KANJI1_KanjiEUC', 'UNICODE_TO_KANJI1_KanjiEBCDIC', 'UNICODE_TO_UNICODE_NFC', 'UNICODE_TO_GRAPHIC_VarGraphic', 'UNICODE_TO_UNICODE_NFKC', 'GRAPHIC_TO_UNICODE', 'UNICODE_TO_GRAPHIC_PadGraphic'}</span> </div> @@ -1181,7 +1218,7 @@ Default: 3</li> <div class="attr variable"> <span class="name">FUNC_TOKENS</span> = <input id="Teradata.Parser.FUNC_TOKENS-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> - <label class="view-value-button pdoc-button" for="Teradata.Parser.FUNC_TOKENS-view-value"></label><span class="default_value">{<TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.UINT128: 'UINT128'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.ROW: 'ROW'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.DATE: 'DATE'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.ENUM: 'ENUM'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.MERGE: 'MERGE'>, <TokenType.INDEX: 'INDEX'>, <TokenType.UINT256: 'UINT256'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.RLIKE: 'RLIKE'>, <TokenType.XML: 'XML'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.TEXT: 'TEXT'>, <TokenType.NESTED: 'NESTED'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.ANY: 'ANY'>, <TokenType.VAR: 'VAR'>, <TokenType.OFFSET: 'OFFSET'>, <TokenType.RIGHT: 'RIGHT'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.TIME: 'TIME'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.INSERT: 'INSERT'>, <TokenType.INT: 'INT'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.SUPER: 'SUPER'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.GLOB: 'GLOB'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.PRIMARY_KEY: 'PRIMARY_KEY'>, <TokenType.BINARY: 'BINARY'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.BIT: 'BIT'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.INT256: 'INT256'>, <TokenType.UNNEST: 'UNNEST'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.INET: 'INET'>, <TokenType.FORMAT: 'FORMAT'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.LIKE: 'LIKE'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.INT128: 'INT128'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.UUID: 'UUID'>, <TokenType.LEFT: 'LEFT'>, <TokenType.UINT: 'UINT'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.FIRST: 'FIRST'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.WINDOW: 'WINDOW'>, <TokenType.SOME: 'SOME'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.NULL: 'NULL'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.FILTER: 'FILTER'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.ALL: 'ALL'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.YEAR: 'YEAR'>, <TokenType.CHAR: 'CHAR'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.MONEY: 'MONEY'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.JSONB: 'JSONB'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.TABLE: 'TABLE'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.MAP: 'MAP'>, <TokenType.ILIKE: 'ILIKE'>, <TokenType.JSON: 'JSON'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.XOR: 'XOR'>, <TokenType.RANGE: 'RANGE'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.ENUM8: 'ENUM8'>}</span> + <label class="view-value-button pdoc-button" for="Teradata.Parser.FUNC_TOKENS-view-value"></label><span class="default_value">{<TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.UINT128: 'UINT128'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.CHAR: 'CHAR'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.RIGHT: 'RIGHT'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.XOR: 'XOR'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.INET: 'INET'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.ROW: 'ROW'>, <TokenType.YEAR: 'YEAR'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.MAP: 'MAP'>, <TokenType.ALL: 'ALL'>, <TokenType.FILTER: 'FILTER'>, <TokenType.FIRST: 'FIRST'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.INT256: 'INT256'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.ILIKE: 'ILIKE'>, <TokenType.INT: 'INT'>, <TokenType.OFFSET: 'OFFSET'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.UUID: 'UUID'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.JSON: 'JSON'>, <TokenType.UINT: 'UINT'>, <TokenType.FORMAT: 'FORMAT'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.INT128: 'INT128'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.RLIKE: 'RLIKE'>, <TokenType.UNNEST: 'UNNEST'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.INDEX: 'INDEX'>, <TokenType.WINDOW: 'WINDOW'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.TEXT: 'TEXT'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.UINT256: 'UINT256'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.MERGE: 'MERGE'>, <TokenType.VAR: 'VAR'>, <TokenType.GLOB: 'GLOB'>, <TokenType.SOME: 'SOME'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.ENUM: 'ENUM'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.JSONB: 'JSONB'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.LIKE: 'LIKE'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.LEFT: 'LEFT'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.TABLE: 'TABLE'>, <TokenType.RANGE: 'RANGE'>, <TokenType.SUPER: 'SUPER'>, <TokenType.DATE: 'DATE'>, <TokenType.NULL: 'NULL'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.ANY: 'ANY'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.NESTED: 'NESTED'>, <TokenType.XML: 'XML'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.INSERT: 'INSERT'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.TIME: 'TIME'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.MONEY: 'MONEY'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.BIT: 'BIT'>, <TokenType.BINARY: 'BINARY'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.PRIMARY_KEY: 'PRIMARY_KEY'>, <TokenType.SMALLINT: 'SMALLINT'>}</span> </div> @@ -1207,7 +1244,7 @@ Default: 3</li> <div class="attr variable"> <span class="name">FUNCTION_PARSERS</span> = <input id="Teradata.Parser.FUNCTION_PARSERS-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> - <label class="view-value-button pdoc-button" for="Teradata.Parser.FUNCTION_PARSERS-view-value"></label><span class="default_value">{'ANY_VALUE': <function Parser.<lambda>>, 'CAST': <function Parser.<lambda>>, 'CONCAT': <function Parser.<lambda>>, 'CONVERT': <function Parser.<lambda>>, 'DECODE': <function Parser.<lambda>>, 'EXTRACT': <function Parser.<lambda>>, 'JSON_OBJECT': <function Parser.<lambda>>, 'LOG': <function Parser.<lambda>>, 'MATCH': <function Parser.<lambda>>, 'OPENJSON': <function Parser.<lambda>>, 'POSITION': <function Parser.<lambda>>, 'SAFE_CAST': <function Parser.<lambda>>, 'STRING_AGG': <function Parser.<lambda>>, 'SUBSTRING': <function Parser.<lambda>>, 'TRIM': <function Parser.<lambda>>, 'TRY_CAST': <function Parser.<lambda>>, 'TRY_CONVERT': <function Parser.<lambda>>, 'RANGE_N': <function <a href="#Teradata.Parser">Teradata.Parser</a>.<lambda>>, 'TRANSLATE': <function <a href="#Teradata.Parser">Teradata.Parser</a>.<lambda>>}</span> + <label class="view-value-button pdoc-button" for="Teradata.Parser.FUNCTION_PARSERS-view-value"></label><span class="default_value">{'ANY_VALUE': <function Parser.<lambda>>, 'CAST': <function Parser.<lambda>>, 'CONCAT': <function Parser.<lambda>>, 'CONCAT_WS': <function Parser.<lambda>>, 'CONVERT': <function Parser.<lambda>>, 'DECODE': <function Parser.<lambda>>, 'EXTRACT': <function Parser.<lambda>>, 'JSON_OBJECT': <function Parser.<lambda>>, 'LOG': <function Parser.<lambda>>, 'MATCH': <function Parser.<lambda>>, 'OPENJSON': <function Parser.<lambda>>, 'POSITION': <function Parser.<lambda>>, 'SAFE_CAST': <function Parser.<lambda>>, 'STRING_AGG': <function Parser.<lambda>>, 'SUBSTRING': <function Parser.<lambda>>, 'TRIM': <function Parser.<lambda>>, 'TRY_CAST': <function Parser.<lambda>>, 'TRY_CONVERT': <function Parser.<lambda>>, 'RANGE_N': <function <a href="#Teradata.Parser">Teradata.Parser</a>.<lambda>>, 'TRANSLATE': <function <a href="#Teradata.Parser">Teradata.Parser</a>.<lambda>>}</span> </div> @@ -1219,7 +1256,7 @@ Default: 3</li> <div id="Teradata.Parser.TOKENIZER_CLASS" class="classattr"> <div class="attr variable"> <span class="name">TOKENIZER_CLASS</span><span class="annotation">: Type[<a href="../tokens.html#Tokenizer">sqlglot.tokens.Tokenizer</a>]</span> = -<span class="default_value"><class '<a href="#Teradata.Tokenizer">sqlglot.dialects.teradata.Teradata.Tokenizer</a>'></span> +<span class="default_value"><class '<a href="#Teradata.Tokenizer">Teradata.Tokenizer</a>'></span> </div> @@ -1302,6 +1339,7 @@ Default: 3</li> <dd id="Teradata.Parser.NESTED_TYPE_TOKENS" class="variable"><a href="../parser.html#Parser.NESTED_TYPE_TOKENS">NESTED_TYPE_TOKENS</a></dd> <dd id="Teradata.Parser.ENUM_TYPE_TOKENS" class="variable"><a href="../parser.html#Parser.ENUM_TYPE_TOKENS">ENUM_TYPE_TOKENS</a></dd> <dd id="Teradata.Parser.TYPE_TOKENS" class="variable"><a href="../parser.html#Parser.TYPE_TOKENS">TYPE_TOKENS</a></dd> + <dd id="Teradata.Parser.SIGNED_TO_UNSIGNED_TYPE_TOKEN" class="variable"><a href="../parser.html#Parser.SIGNED_TO_UNSIGNED_TYPE_TOKEN">SIGNED_TO_UNSIGNED_TYPE_TOKEN</a></dd> <dd id="Teradata.Parser.SUBQUERY_PREDICATES" class="variable"><a href="../parser.html#Parser.SUBQUERY_PREDICATES">SUBQUERY_PREDICATES</a></dd> <dd id="Teradata.Parser.RESERVED_KEYWORDS" class="variable"><a href="../parser.html#Parser.RESERVED_KEYWORDS">RESERVED_KEYWORDS</a></dd> <dd id="Teradata.Parser.DB_CREATABLES" class="variable"><a href="../parser.html#Parser.DB_CREATABLES">DB_CREATABLES</a></dd> @@ -1399,75 +1437,80 @@ Default: 3</li> </div> <a class="headerlink" href="#Teradata.Generator"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Teradata.Generator-148"><a href="#Teradata.Generator-148"><span class="linenos">148</span></a> <span class="k">class</span> <span class="nc">Generator</span><span class="p">(</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="p">):</span> -</span><span id="Teradata.Generator-149"><a href="#Teradata.Generator-149"><span class="linenos">149</span></a> <span class="n">JOIN_HINTS</span> <span class="o">=</span> <span class="kc">False</span> -</span><span id="Teradata.Generator-150"><a href="#Teradata.Generator-150"><span class="linenos">150</span></a> <span class="n">TABLE_HINTS</span> <span class="o">=</span> <span class="kc">False</span> -</span><span id="Teradata.Generator-151"><a href="#Teradata.Generator-151"><span class="linenos">151</span></a> <span class="n">QUERY_HINTS</span> <span class="o">=</span> <span class="kc">False</span> -</span><span id="Teradata.Generator-152"><a href="#Teradata.Generator-152"><span class="linenos">152</span></a> -</span><span id="Teradata.Generator-153"><a href="#Teradata.Generator-153"><span class="linenos">153</span></a> <span class="n">TYPE_MAPPING</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Teradata.Generator-154"><a href="#Teradata.Generator-154"><span class="linenos">154</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TYPE_MAPPING</span><span class="p">,</span> -</span><span id="Teradata.Generator-155"><a href="#Teradata.Generator-155"><span class="linenos">155</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">GEOMETRY</span><span class="p">:</span> <span class="s2">"ST_GEOMETRY"</span><span class="p">,</span> -</span><span id="Teradata.Generator-156"><a href="#Teradata.Generator-156"><span class="linenos">156</span></a> <span class="p">}</span> -</span><span id="Teradata.Generator-157"><a href="#Teradata.Generator-157"><span class="linenos">157</span></a> -</span><span id="Teradata.Generator-158"><a href="#Teradata.Generator-158"><span class="linenos">158</span></a> <span class="n">PROPERTIES_LOCATION</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Teradata.Generator-159"><a href="#Teradata.Generator-159"><span class="linenos">159</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">PROPERTIES_LOCATION</span><span class="p">,</span> -</span><span id="Teradata.Generator-160"><a href="#Teradata.Generator-160"><span class="linenos">160</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">OnCommitProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_INDEX</span><span class="p">,</span> -</span><span id="Teradata.Generator-161"><a href="#Teradata.Generator-161"><span class="linenos">161</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_EXPRESSION</span><span class="p">,</span> -</span><span id="Teradata.Generator-162"><a href="#Teradata.Generator-162"><span class="linenos">162</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StabilityProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_CREATE</span><span class="p">,</span> -</span><span id="Teradata.Generator-163"><a href="#Teradata.Generator-163"><span class="linenos">163</span></a> <span class="p">}</span> -</span><span id="Teradata.Generator-164"><a href="#Teradata.Generator-164"><span class="linenos">164</span></a> -</span><span id="Teradata.Generator-165"><a href="#Teradata.Generator-165"><span class="linenos">165</span></a> <span class="n">TRANSFORMS</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Teradata.Generator-166"><a href="#Teradata.Generator-166"><span class="linenos">166</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TRANSFORMS</span><span class="p">,</span> -</span><span id="Teradata.Generator-167"><a href="#Teradata.Generator-167"><span class="linenos">167</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Max</span><span class="p">:</span> <span class="n">max_or_greatest</span><span class="p">,</span> -</span><span id="Teradata.Generator-168"><a href="#Teradata.Generator-168"><span class="linenos">168</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Min</span><span class="p">:</span> <span class="n">min_or_least</span><span class="p">,</span> -</span><span id="Teradata.Generator-169"><a href="#Teradata.Generator-169"><span class="linenos">169</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Select</span><span class="p">:</span> <span class="n">transforms</span><span class="o">.</span><span class="n">preprocess</span><span class="p">([</span><span class="n">transforms</span><span class="o">.</span><span class="n">eliminate_distinct_on</span><span class="p">]),</span> -</span><span id="Teradata.Generator-170"><a href="#Teradata.Generator-170"><span class="linenos">170</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StrToDate</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">"CAST(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2"> AS DATE FORMAT </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">format_time</span><span class="p">(</span><span class="n">e</span><span class="p">)</span><span class="si">}</span><span class="s2">)"</span><span class="p">,</span> -</span><span id="Teradata.Generator-171"><a href="#Teradata.Generator-171"><span class="linenos">171</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ToChar</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">function_fallback_sql</span><span class="p">(</span><span class="n">e</span><span class="p">),</span> -</span><span id="Teradata.Generator-172"><a href="#Teradata.Generator-172"><span class="linenos">172</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Use</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">"DATABASE </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span> -</span><span id="Teradata.Generator-173"><a href="#Teradata.Generator-173"><span class="linenos">173</span></a> <span class="p">}</span> -</span><span id="Teradata.Generator-174"><a href="#Teradata.Generator-174"><span class="linenos">174</span></a> -</span><span id="Teradata.Generator-175"><a href="#Teradata.Generator-175"><span class="linenos">175</span></a> <span class="k">def</span> <span class="nf">partitionedbyproperty_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Teradata.Generator-176"><a href="#Teradata.Generator-176"><span class="linenos">176</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"PARTITION BY </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Teradata.Generator-151"><a href="#Teradata.Generator-151"><span class="linenos">151</span></a> <span class="k">class</span> <span class="nc">Generator</span><span class="p">(</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="p">):</span> +</span><span id="Teradata.Generator-152"><a href="#Teradata.Generator-152"><span class="linenos">152</span></a> <span class="n">JOIN_HINTS</span> <span class="o">=</span> <span class="kc">False</span> +</span><span id="Teradata.Generator-153"><a href="#Teradata.Generator-153"><span class="linenos">153</span></a> <span class="n">TABLE_HINTS</span> <span class="o">=</span> <span class="kc">False</span> +</span><span id="Teradata.Generator-154"><a href="#Teradata.Generator-154"><span class="linenos">154</span></a> <span class="n">QUERY_HINTS</span> <span class="o">=</span> <span class="kc">False</span> +</span><span id="Teradata.Generator-155"><a href="#Teradata.Generator-155"><span class="linenos">155</span></a> +</span><span id="Teradata.Generator-156"><a href="#Teradata.Generator-156"><span class="linenos">156</span></a> <span class="n">TYPE_MAPPING</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Teradata.Generator-157"><a href="#Teradata.Generator-157"><span class="linenos">157</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TYPE_MAPPING</span><span class="p">,</span> +</span><span id="Teradata.Generator-158"><a href="#Teradata.Generator-158"><span class="linenos">158</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">GEOMETRY</span><span class="p">:</span> <span class="s2">"ST_GEOMETRY"</span><span class="p">,</span> +</span><span id="Teradata.Generator-159"><a href="#Teradata.Generator-159"><span class="linenos">159</span></a> <span class="p">}</span> +</span><span id="Teradata.Generator-160"><a href="#Teradata.Generator-160"><span class="linenos">160</span></a> +</span><span id="Teradata.Generator-161"><a href="#Teradata.Generator-161"><span class="linenos">161</span></a> <span class="n">PROPERTIES_LOCATION</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Teradata.Generator-162"><a href="#Teradata.Generator-162"><span class="linenos">162</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">PROPERTIES_LOCATION</span><span class="p">,</span> +</span><span id="Teradata.Generator-163"><a href="#Teradata.Generator-163"><span class="linenos">163</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">OnCommitProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_INDEX</span><span class="p">,</span> +</span><span id="Teradata.Generator-164"><a href="#Teradata.Generator-164"><span class="linenos">164</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_EXPRESSION</span><span class="p">,</span> +</span><span id="Teradata.Generator-165"><a href="#Teradata.Generator-165"><span class="linenos">165</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StabilityProperty</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_CREATE</span><span class="p">,</span> +</span><span id="Teradata.Generator-166"><a href="#Teradata.Generator-166"><span class="linenos">166</span></a> <span class="p">}</span> +</span><span id="Teradata.Generator-167"><a href="#Teradata.Generator-167"><span class="linenos">167</span></a> +</span><span id="Teradata.Generator-168"><a href="#Teradata.Generator-168"><span class="linenos">168</span></a> <span class="n">TRANSFORMS</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Teradata.Generator-169"><a href="#Teradata.Generator-169"><span class="linenos">169</span></a> <span class="o">**</span><span class="n">generator</span><span class="o">.</span><span class="n">Generator</span><span class="o">.</span><span class="n">TRANSFORMS</span><span class="p">,</span> +</span><span id="Teradata.Generator-170"><a href="#Teradata.Generator-170"><span class="linenos">170</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Max</span><span class="p">:</span> <span class="n">max_or_greatest</span><span class="p">,</span> +</span><span id="Teradata.Generator-171"><a href="#Teradata.Generator-171"><span class="linenos">171</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Min</span><span class="p">:</span> <span class="n">min_or_least</span><span class="p">,</span> +</span><span id="Teradata.Generator-172"><a href="#Teradata.Generator-172"><span class="linenos">172</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Select</span><span class="p">:</span> <span class="n">transforms</span><span class="o">.</span><span class="n">preprocess</span><span class="p">([</span><span class="n">transforms</span><span class="o">.</span><span class="n">eliminate_distinct_on</span><span class="p">]),</span> +</span><span id="Teradata.Generator-173"><a href="#Teradata.Generator-173"><span class="linenos">173</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">StrToDate</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">"CAST(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2"> AS DATE FORMAT </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">format_time</span><span class="p">(</span><span class="n">e</span><span class="p">)</span><span class="si">}</span><span class="s2">)"</span><span class="p">,</span> +</span><span id="Teradata.Generator-174"><a href="#Teradata.Generator-174"><span class="linenos">174</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">ToChar</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">function_fallback_sql</span><span class="p">(</span><span class="n">e</span><span class="p">),</span> +</span><span id="Teradata.Generator-175"><a href="#Teradata.Generator-175"><span class="linenos">175</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Use</span><span class="p">:</span> <span class="k">lambda</span> <span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span> <span class="sa">f</span><span class="s2">"DATABASE </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">e</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span> +</span><span id="Teradata.Generator-176"><a href="#Teradata.Generator-176"><span class="linenos">176</span></a> <span class="p">}</span> </span><span id="Teradata.Generator-177"><a href="#Teradata.Generator-177"><span class="linenos">177</span></a> -</span><span id="Teradata.Generator-178"><a href="#Teradata.Generator-178"><span class="linenos">178</span></a> <span class="c1"># FROM before SET in Teradata UPDATE syntax</span> -</span><span id="Teradata.Generator-179"><a href="#Teradata.Generator-179"><span class="linenos">179</span></a> <span class="c1"># https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/Teradata-VantageTM-SQL-Data-Manipulation-Language-17.20/Statement-Syntax/UPDATE/UPDATE-Syntax-Basic-Form-FROM-Clause</span> -</span><span id="Teradata.Generator-180"><a href="#Teradata.Generator-180"><span class="linenos">180</span></a> <span class="k">def</span> <span class="nf">update_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Update</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Teradata.Generator-181"><a href="#Teradata.Generator-181"><span class="linenos">181</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> -</span><span id="Teradata.Generator-182"><a href="#Teradata.Generator-182"><span class="linenos">182</span></a> <span class="n">from_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"from"</span><span class="p">)</span> -</span><span id="Teradata.Generator-183"><a href="#Teradata.Generator-183"><span class="linenos">183</span></a> <span class="n">set_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">flat</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> -</span><span id="Teradata.Generator-184"><a href="#Teradata.Generator-184"><span class="linenos">184</span></a> <span class="n">where_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"where"</span><span class="p">)</span> -</span><span id="Teradata.Generator-185"><a href="#Teradata.Generator-185"><span class="linenos">185</span></a> <span class="n">sql</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"UPDATE </span><span class="si">{</span><span class="n">this</span><span class="si">}{</span><span class="n">from_sql</span><span class="si">}</span><span class="s2"> SET </span><span class="si">{</span><span class="n">set_sql</span><span class="si">}{</span><span class="n">where_sql</span><span class="si">}</span><span class="s2">"</span> -</span><span id="Teradata.Generator-186"><a href="#Teradata.Generator-186"><span class="linenos">186</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">prepend_ctes</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">sql</span><span class="p">)</span> -</span><span id="Teradata.Generator-187"><a href="#Teradata.Generator-187"><span class="linenos">187</span></a> -</span><span id="Teradata.Generator-188"><a href="#Teradata.Generator-188"><span class="linenos">188</span></a> <span class="k">def</span> <span class="nf">mod_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Mod</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Teradata.Generator-189"><a href="#Teradata.Generator-189"><span class="linenos">189</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">binary</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"MOD"</span><span class="p">)</span> -</span><span id="Teradata.Generator-190"><a href="#Teradata.Generator-190"><span class="linenos">190</span></a> -</span><span id="Teradata.Generator-191"><a href="#Teradata.Generator-191"><span class="linenos">191</span></a> <span class="k">def</span> <span class="nf">datatype_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Teradata.Generator-192"><a href="#Teradata.Generator-192"><span class="linenos">192</span></a> <span class="n">type_sql</span> <span class="o">=</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">datatype_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> -</span><span id="Teradata.Generator-193"><a href="#Teradata.Generator-193"><span class="linenos">193</span></a> <span class="n">prefix_sql</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"prefix"</span><span class="p">)</span> -</span><span id="Teradata.Generator-194"><a href="#Teradata.Generator-194"><span class="linenos">194</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"SYSUDTLIB.</span><span class="si">{</span><span class="n">type_sql</span><span class="si">}</span><span class="s2">"</span> <span class="k">if</span> <span class="n">prefix_sql</span> <span class="k">else</span> <span class="n">type_sql</span> +</span><span id="Teradata.Generator-178"><a href="#Teradata.Generator-178"><span class="linenos">178</span></a> <span class="k">def</span> <span class="nf">tablesample_sql</span><span class="p">(</span> +</span><span id="Teradata.Generator-179"><a href="#Teradata.Generator-179"><span class="linenos">179</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">TableSample</span><span class="p">,</span> <span class="n">seed_prefix</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"SEED"</span><span class="p">,</span> <span class="n">sep</span><span class="o">=</span><span class="s2">" AS "</span> +</span><span id="Teradata.Generator-180"><a href="#Teradata.Generator-180"><span class="linenos">180</span></a> <span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Teradata.Generator-181"><a href="#Teradata.Generator-181"><span class="linenos">181</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2"> SAMPLE </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span> +</span><span id="Teradata.Generator-182"><a href="#Teradata.Generator-182"><span class="linenos">182</span></a> +</span><span id="Teradata.Generator-183"><a href="#Teradata.Generator-183"><span class="linenos">183</span></a> <span class="k">def</span> <span class="nf">partitionedbyproperty_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Teradata.Generator-184"><a href="#Teradata.Generator-184"><span class="linenos">184</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"PARTITION BY </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span> +</span><span id="Teradata.Generator-185"><a href="#Teradata.Generator-185"><span class="linenos">185</span></a> +</span><span id="Teradata.Generator-186"><a href="#Teradata.Generator-186"><span class="linenos">186</span></a> <span class="c1"># FROM before SET in Teradata UPDATE syntax</span> +</span><span id="Teradata.Generator-187"><a href="#Teradata.Generator-187"><span class="linenos">187</span></a> <span class="c1"># https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/Teradata-VantageTM-SQL-Data-Manipulation-Language-17.20/Statement-Syntax/UPDATE/UPDATE-Syntax-Basic-Form-FROM-Clause</span> +</span><span id="Teradata.Generator-188"><a href="#Teradata.Generator-188"><span class="linenos">188</span></a> <span class="k">def</span> <span class="nf">update_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Update</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Teradata.Generator-189"><a href="#Teradata.Generator-189"><span class="linenos">189</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> +</span><span id="Teradata.Generator-190"><a href="#Teradata.Generator-190"><span class="linenos">190</span></a> <span class="n">from_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"from"</span><span class="p">)</span> +</span><span id="Teradata.Generator-191"><a href="#Teradata.Generator-191"><span class="linenos">191</span></a> <span class="n">set_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">flat</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="Teradata.Generator-192"><a href="#Teradata.Generator-192"><span class="linenos">192</span></a> <span class="n">where_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"where"</span><span class="p">)</span> +</span><span id="Teradata.Generator-193"><a href="#Teradata.Generator-193"><span class="linenos">193</span></a> <span class="n">sql</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"UPDATE </span><span class="si">{</span><span class="n">this</span><span class="si">}{</span><span class="n">from_sql</span><span class="si">}</span><span class="s2"> SET </span><span class="si">{</span><span class="n">set_sql</span><span class="si">}{</span><span class="n">where_sql</span><span class="si">}</span><span class="s2">"</span> +</span><span id="Teradata.Generator-194"><a href="#Teradata.Generator-194"><span class="linenos">194</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">prepend_ctes</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">sql</span><span class="p">)</span> </span><span id="Teradata.Generator-195"><a href="#Teradata.Generator-195"><span class="linenos">195</span></a> -</span><span id="Teradata.Generator-196"><a href="#Teradata.Generator-196"><span class="linenos">196</span></a> <span class="k">def</span> <span class="nf">rangen_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">RangeN</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Teradata.Generator-197"><a href="#Teradata.Generator-197"><span class="linenos">197</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> -</span><span id="Teradata.Generator-198"><a href="#Teradata.Generator-198"><span class="linenos">198</span></a> <span class="n">expressions_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> -</span><span id="Teradata.Generator-199"><a href="#Teradata.Generator-199"><span class="linenos">199</span></a> <span class="n">each_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"each"</span><span class="p">)</span> -</span><span id="Teradata.Generator-200"><a href="#Teradata.Generator-200"><span class="linenos">200</span></a> <span class="n">each_sql</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">" EACH </span><span class="si">{</span><span class="n">each_sql</span><span class="si">}</span><span class="s2">"</span> <span class="k">if</span> <span class="n">each_sql</span> <span class="k">else</span> <span class="s2">""</span> -</span><span id="Teradata.Generator-201"><a href="#Teradata.Generator-201"><span class="linenos">201</span></a> -</span><span id="Teradata.Generator-202"><a href="#Teradata.Generator-202"><span class="linenos">202</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"RANGE_N(</span><span class="si">{</span><span class="n">this</span><span class="si">}</span><span class="s2"> BETWEEN </span><span class="si">{</span><span class="n">expressions_sql</span><span class="si">}{</span><span class="n">each_sql</span><span class="si">}</span><span class="s2">)"</span> +</span><span id="Teradata.Generator-196"><a href="#Teradata.Generator-196"><span class="linenos">196</span></a> <span class="k">def</span> <span class="nf">mod_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Mod</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Teradata.Generator-197"><a href="#Teradata.Generator-197"><span class="linenos">197</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">binary</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"MOD"</span><span class="p">)</span> +</span><span id="Teradata.Generator-198"><a href="#Teradata.Generator-198"><span class="linenos">198</span></a> +</span><span id="Teradata.Generator-199"><a href="#Teradata.Generator-199"><span class="linenos">199</span></a> <span class="k">def</span> <span class="nf">datatype_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Teradata.Generator-200"><a href="#Teradata.Generator-200"><span class="linenos">200</span></a> <span class="n">type_sql</span> <span class="o">=</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">datatype_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> +</span><span id="Teradata.Generator-201"><a href="#Teradata.Generator-201"><span class="linenos">201</span></a> <span class="n">prefix_sql</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"prefix"</span><span class="p">)</span> +</span><span id="Teradata.Generator-202"><a href="#Teradata.Generator-202"><span class="linenos">202</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"SYSUDTLIB.</span><span class="si">{</span><span class="n">type_sql</span><span class="si">}</span><span class="s2">"</span> <span class="k">if</span> <span class="n">prefix_sql</span> <span class="k">else</span> <span class="n">type_sql</span> </span><span id="Teradata.Generator-203"><a href="#Teradata.Generator-203"><span class="linenos">203</span></a> -</span><span id="Teradata.Generator-204"><a href="#Teradata.Generator-204"><span class="linenos">204</span></a> <span class="k">def</span> <span class="nf">createable_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Create</span><span class="p">,</span> <span class="n">locations</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">DefaultDict</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Teradata.Generator-205"><a href="#Teradata.Generator-205"><span class="linenos">205</span></a> <span class="n">kind</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> -</span><span id="Teradata.Generator-206"><a href="#Teradata.Generator-206"><span class="linenos">206</span></a> <span class="k">if</span> <span class="n">kind</span> <span class="o">==</span> <span class="s2">"TABLE"</span> <span class="ow">and</span> <span class="n">locations</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_NAME</span><span class="p">):</span> -</span><span id="Teradata.Generator-207"><a href="#Teradata.Generator-207"><span class="linenos">207</span></a> <span class="n">this_name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> -</span><span id="Teradata.Generator-208"><a href="#Teradata.Generator-208"><span class="linenos">208</span></a> <span class="n">this_properties</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">properties</span><span class="p">(</span> -</span><span id="Teradata.Generator-209"><a href="#Teradata.Generator-209"><span class="linenos">209</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="n">locations</span><span class="p">[</span><span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_NAME</span><span class="p">]),</span> -</span><span id="Teradata.Generator-210"><a href="#Teradata.Generator-210"><span class="linenos">210</span></a> <span class="n">wrapped</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> -</span><span id="Teradata.Generator-211"><a href="#Teradata.Generator-211"><span class="linenos">211</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">","</span><span class="p">,</span> -</span><span id="Teradata.Generator-212"><a href="#Teradata.Generator-212"><span class="linenos">212</span></a> <span class="p">)</span> -</span><span id="Teradata.Generator-213"><a href="#Teradata.Generator-213"><span class="linenos">213</span></a> <span class="n">this_schema</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">schema_columns_sql</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">this</span><span class="p">)</span> -</span><span id="Teradata.Generator-214"><a href="#Teradata.Generator-214"><span class="linenos">214</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">this_name</span><span class="si">}{</span><span class="n">this_properties</span><span class="si">}{</span><span class="bp">self</span><span class="o">.</span><span class="n">sep</span><span class="p">()</span><span class="si">}{</span><span class="n">this_schema</span><span class="si">}</span><span class="s2">"</span> -</span><span id="Teradata.Generator-215"><a href="#Teradata.Generator-215"><span class="linenos">215</span></a> -</span><span id="Teradata.Generator-216"><a href="#Teradata.Generator-216"><span class="linenos">216</span></a> <span class="k">return</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">createable_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">locations</span><span class="p">)</span> +</span><span id="Teradata.Generator-204"><a href="#Teradata.Generator-204"><span class="linenos">204</span></a> <span class="k">def</span> <span class="nf">rangen_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">RangeN</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Teradata.Generator-205"><a href="#Teradata.Generator-205"><span class="linenos">205</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> +</span><span id="Teradata.Generator-206"><a href="#Teradata.Generator-206"><span class="linenos">206</span></a> <span class="n">expressions_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> +</span><span id="Teradata.Generator-207"><a href="#Teradata.Generator-207"><span class="linenos">207</span></a> <span class="n">each_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"each"</span><span class="p">)</span> +</span><span id="Teradata.Generator-208"><a href="#Teradata.Generator-208"><span class="linenos">208</span></a> <span class="n">each_sql</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">" EACH </span><span class="si">{</span><span class="n">each_sql</span><span class="si">}</span><span class="s2">"</span> <span class="k">if</span> <span class="n">each_sql</span> <span class="k">else</span> <span class="s2">""</span> +</span><span id="Teradata.Generator-209"><a href="#Teradata.Generator-209"><span class="linenos">209</span></a> +</span><span id="Teradata.Generator-210"><a href="#Teradata.Generator-210"><span class="linenos">210</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"RANGE_N(</span><span class="si">{</span><span class="n">this</span><span class="si">}</span><span class="s2"> BETWEEN </span><span class="si">{</span><span class="n">expressions_sql</span><span class="si">}{</span><span class="n">each_sql</span><span class="si">}</span><span class="s2">)"</span> +</span><span id="Teradata.Generator-211"><a href="#Teradata.Generator-211"><span class="linenos">211</span></a> +</span><span id="Teradata.Generator-212"><a href="#Teradata.Generator-212"><span class="linenos">212</span></a> <span class="k">def</span> <span class="nf">createable_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Create</span><span class="p">,</span> <span class="n">locations</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">DefaultDict</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Teradata.Generator-213"><a href="#Teradata.Generator-213"><span class="linenos">213</span></a> <span class="n">kind</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> +</span><span id="Teradata.Generator-214"><a href="#Teradata.Generator-214"><span class="linenos">214</span></a> <span class="k">if</span> <span class="n">kind</span> <span class="o">==</span> <span class="s2">"TABLE"</span> <span class="ow">and</span> <span class="n">locations</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_NAME</span><span class="p">):</span> +</span><span id="Teradata.Generator-215"><a href="#Teradata.Generator-215"><span class="linenos">215</span></a> <span class="n">this_name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> +</span><span id="Teradata.Generator-216"><a href="#Teradata.Generator-216"><span class="linenos">216</span></a> <span class="n">this_properties</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">properties</span><span class="p">(</span> +</span><span id="Teradata.Generator-217"><a href="#Teradata.Generator-217"><span class="linenos">217</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="n">locations</span><span class="p">[</span><span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_NAME</span><span class="p">]),</span> +</span><span id="Teradata.Generator-218"><a href="#Teradata.Generator-218"><span class="linenos">218</span></a> <span class="n">wrapped</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> +</span><span id="Teradata.Generator-219"><a href="#Teradata.Generator-219"><span class="linenos">219</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">","</span><span class="p">,</span> +</span><span id="Teradata.Generator-220"><a href="#Teradata.Generator-220"><span class="linenos">220</span></a> <span class="p">)</span> +</span><span id="Teradata.Generator-221"><a href="#Teradata.Generator-221"><span class="linenos">221</span></a> <span class="n">this_schema</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">schema_columns_sql</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">this</span><span class="p">)</span> +</span><span id="Teradata.Generator-222"><a href="#Teradata.Generator-222"><span class="linenos">222</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">this_name</span><span class="si">}{</span><span class="n">this_properties</span><span class="si">}{</span><span class="bp">self</span><span class="o">.</span><span class="n">sep</span><span class="p">()</span><span class="si">}{</span><span class="n">this_schema</span><span class="si">}</span><span class="s2">"</span> +</span><span id="Teradata.Generator-223"><a href="#Teradata.Generator-223"><span class="linenos">223</span></a> +</span><span id="Teradata.Generator-224"><a href="#Teradata.Generator-224"><span class="linenos">224</span></a> <span class="k">return</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">createable_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">locations</span><span class="p">)</span> </span></pre></div> @@ -1550,7 +1593,7 @@ Default: True</li> <div class="attr variable"> <span class="name">TYPE_MAPPING</span> = <input id="Teradata.Generator.TYPE_MAPPING-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> - <label class="view-value-button pdoc-button" for="Teradata.Generator.TYPE_MAPPING-view-value"></label><span class="default_value">{<Type.NCHAR: 'NCHAR'>: 'CHAR', <Type.NVARCHAR: 'NVARCHAR'>: 'VARCHAR', <Type.MEDIUMTEXT: 'MEDIUMTEXT'>: 'TEXT', <Type.LONGTEXT: 'LONGTEXT'>: 'TEXT', <Type.MEDIUMBLOB: 'MEDIUMBLOB'>: 'BLOB', <Type.LONGBLOB: 'LONGBLOB'>: 'BLOB', <Type.INET: 'INET'>: 'INET', <Type.GEOMETRY: 'GEOMETRY'>: 'ST_GEOMETRY'}</span> + <label class="view-value-button pdoc-button" for="Teradata.Generator.TYPE_MAPPING-view-value"></label><span class="default_value">{<Type.NCHAR: 'NCHAR'>: 'CHAR', <Type.NVARCHAR: 'NVARCHAR'>: 'VARCHAR', <Type.MEDIUMTEXT: 'MEDIUMTEXT'>: 'TEXT', <Type.LONGTEXT: 'LONGTEXT'>: 'TEXT', <Type.TINYTEXT: 'TINYTEXT'>: 'TEXT', <Type.MEDIUMBLOB: 'MEDIUMBLOB'>: 'BLOB', <Type.LONGBLOB: 'LONGBLOB'>: 'BLOB', <Type.TINYBLOB: 'TINYBLOB'>: 'BLOB', <Type.INET: 'INET'>: 'INET', <Type.GEOMETRY: 'GEOMETRY'>: 'ST_GEOMETRY'}</span> </div> @@ -1576,7 +1619,7 @@ Default: True</li> <div class="attr variable"> <span class="name">TRANSFORMS</span> = <input id="Teradata.Generator.TRANSFORMS-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> - <label class="view-value-button pdoc-button" for="Teradata.Generator.TRANSFORMS-view-value"></label><span class="default_value">{<class '<a href="../expressions.html#DateAdd">sqlglot.expressions.DateAdd</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#TsOrDsAdd">sqlglot.expressions.TsOrDsAdd</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#CaseSpecificColumnConstraint">sqlglot.expressions.CaseSpecificColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#CharacterSetColumnConstraint">sqlglot.expressions.CharacterSetColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#CharacterSetProperty">sqlglot.expressions.CharacterSetProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#CheckColumnConstraint">sqlglot.expressions.CheckColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#ClusteredColumnConstraint">sqlglot.expressions.ClusteredColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#CollateColumnConstraint">sqlglot.expressions.CollateColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#CopyGrantsProperty">sqlglot.expressions.CopyGrantsProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#CommentColumnConstraint">sqlglot.expressions.CommentColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#DateFormatColumnConstraint">sqlglot.expressions.DateFormatColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#DefaultColumnConstraint">sqlglot.expressions.DefaultColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#EncodeColumnConstraint">sqlglot.expressions.EncodeColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#ExecuteAsProperty">sqlglot.expressions.ExecuteAsProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#ExternalProperty">sqlglot.expressions.ExternalProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#HeapProperty">sqlglot.expressions.HeapProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#InlineLengthColumnConstraint">sqlglot.expressions.InlineLengthColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#IntervalDayToSecondSpan">sqlglot.expressions.IntervalDayToSecondSpan</a>'>: 'DAY TO SECOND', <class '<a href="../expressions.html#IntervalYearToMonthSpan">sqlglot.expressions.IntervalYearToMonthSpan</a>'>: 'YEAR TO MONTH', <class '<a href="../expressions.html#LanguageProperty">sqlglot.expressions.LanguageProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#LocationProperty">sqlglot.expressions.LocationProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#LogProperty">sqlglot.expressions.LogProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#MaterializedProperty">sqlglot.expressions.MaterializedProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#NoPrimaryIndexProperty">sqlglot.expressions.NoPrimaryIndexProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#NonClusteredColumnConstraint">sqlglot.expressions.NonClusteredColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#NotForReplicationColumnConstraint">sqlglot.expressions.NotForReplicationColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#OnCommitProperty">sqlglot.expressions.OnCommitProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#OnProperty">sqlglot.expressions.OnProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#OnUpdateColumnConstraint">sqlglot.expressions.OnUpdateColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#PathColumnConstraint">sqlglot.expressions.PathColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#ReturnsProperty">sqlglot.expressions.ReturnsProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#SetProperty">sqlglot.expressions.SetProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#SettingsProperty">sqlglot.expressions.SettingsProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#SqlSecurityProperty">sqlglot.expressions.SqlSecurityProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#StabilityProperty">sqlglot.expressions.StabilityProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#TemporaryProperty">sqlglot.expressions.TemporaryProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#ToTableProperty">sqlglot.expressions.ToTableProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#TransientProperty">sqlglot.expressions.TransientProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#TitleColumnConstraint">sqlglot.expressions.TitleColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#UppercaseColumnConstraint">sqlglot.expressions.UppercaseColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#VarMap">sqlglot.expressions.VarMap</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#VolatileProperty">sqlglot.expressions.VolatileProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#WithJournalTableProperty">sqlglot.expressions.WithJournalTableProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#Max">sqlglot.expressions.Max</a>'>: <function max_or_greatest>, <class '<a href="../expressions.html#Min">sqlglot.expressions.Min</a>'>: <function min_or_least>, <class '<a href="../expressions.html#Select">sqlglot.expressions.Select</a>'>: <function preprocess.<locals>._to_sql>, <class '<a href="../expressions.html#StrToDate">sqlglot.expressions.StrToDate</a>'>: <function <a href="#Teradata.Generator">Teradata.Generator</a>.<lambda>>, <class '<a href="../expressions.html#ToChar">sqlglot.expressions.ToChar</a>'>: <function <a href="#Teradata.Generator">Teradata.Generator</a>.<lambda>>, <class '<a href="../expressions.html#Use">sqlglot.expressions.Use</a>'>: <function <a href="#Teradata.Generator">Teradata.Generator</a>.<lambda>>}</span> + <label class="view-value-button pdoc-button" for="Teradata.Generator.TRANSFORMS-view-value"></label><span class="default_value">{<class '<a href="../expressions.html#DateAdd">sqlglot.expressions.DateAdd</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#TsOrDsAdd">sqlglot.expressions.TsOrDsAdd</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#CaseSpecificColumnConstraint">sqlglot.expressions.CaseSpecificColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#CharacterSetColumnConstraint">sqlglot.expressions.CharacterSetColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#CharacterSetProperty">sqlglot.expressions.CharacterSetProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#CheckColumnConstraint">sqlglot.expressions.CheckColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#ClusteredColumnConstraint">sqlglot.expressions.ClusteredColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#CollateColumnConstraint">sqlglot.expressions.CollateColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#CopyGrantsProperty">sqlglot.expressions.CopyGrantsProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#CommentColumnConstraint">sqlglot.expressions.CommentColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#DateFormatColumnConstraint">sqlglot.expressions.DateFormatColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#DefaultColumnConstraint">sqlglot.expressions.DefaultColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#EncodeColumnConstraint">sqlglot.expressions.EncodeColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#ExecuteAsProperty">sqlglot.expressions.ExecuteAsProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#ExternalProperty">sqlglot.expressions.ExternalProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#HeapProperty">sqlglot.expressions.HeapProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#InlineLengthColumnConstraint">sqlglot.expressions.InlineLengthColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#IntervalSpan">sqlglot.expressions.IntervalSpan</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#LanguageProperty">sqlglot.expressions.LanguageProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#LocationProperty">sqlglot.expressions.LocationProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#LogProperty">sqlglot.expressions.LogProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#MaterializedProperty">sqlglot.expressions.MaterializedProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#NoPrimaryIndexProperty">sqlglot.expressions.NoPrimaryIndexProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#NonClusteredColumnConstraint">sqlglot.expressions.NonClusteredColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#NotForReplicationColumnConstraint">sqlglot.expressions.NotForReplicationColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#OnCommitProperty">sqlglot.expressions.OnCommitProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#OnProperty">sqlglot.expressions.OnProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#OnUpdateColumnConstraint">sqlglot.expressions.OnUpdateColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#PathColumnConstraint">sqlglot.expressions.PathColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#ReturnsProperty">sqlglot.expressions.ReturnsProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#SetProperty">sqlglot.expressions.SetProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#SettingsProperty">sqlglot.expressions.SettingsProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#SqlSecurityProperty">sqlglot.expressions.SqlSecurityProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#StabilityProperty">sqlglot.expressions.StabilityProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#TemporaryProperty">sqlglot.expressions.TemporaryProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#ToTableProperty">sqlglot.expressions.ToTableProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#TransientProperty">sqlglot.expressions.TransientProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#TitleColumnConstraint">sqlglot.expressions.TitleColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#UppercaseColumnConstraint">sqlglot.expressions.UppercaseColumnConstraint</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#VarMap">sqlglot.expressions.VarMap</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#VolatileProperty">sqlglot.expressions.VolatileProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#WithJournalTableProperty">sqlglot.expressions.WithJournalTableProperty</a>'>: <function Generator.<lambda>>, <class '<a href="../expressions.html#Max">sqlglot.expressions.Max</a>'>: <function max_or_greatest>, <class '<a href="../expressions.html#Min">sqlglot.expressions.Min</a>'>: <function min_or_least>, <class '<a href="../expressions.html#Select">sqlglot.expressions.Select</a>'>: <function preprocess.<locals>._to_sql>, <class '<a href="../expressions.html#StrToDate">sqlglot.expressions.StrToDate</a>'>: <function <a href="#Teradata.Generator">Teradata.Generator</a>.<lambda>>, <class '<a href="../expressions.html#ToChar">sqlglot.expressions.ToChar</a>'>: <function <a href="#Teradata.Generator">Teradata.Generator</a>.<lambda>>, <class '<a href="../expressions.html#Use">sqlglot.expressions.Use</a>'>: <function <a href="#Teradata.Generator">Teradata.Generator</a>.<lambda>>}</span> </div> @@ -1585,6 +1628,27 @@ Default: True</li> </div> + <div id="Teradata.Generator.tablesample_sql" class="classattr"> + <input id="Teradata.Generator.tablesample_sql-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> +<div class="attr function"> + + <span class="def">def</span> + <span class="name">tablesample_sql</span><span class="signature pdoc-code multiline">(<span class="param"> <span class="bp">self</span>,</span><span class="param"> <span class="n">expression</span><span class="p">:</span> <span class="n"><a href="../expressions.html#TableSample">sqlglot.expressions.TableSample</a></span>,</span><span class="param"> <span class="n">seed_prefix</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">'SEED'</span>,</span><span class="param"> <span class="n">sep</span><span class="o">=</span><span class="s1">' AS '</span></span><span class="return-annotation">) -> <span class="nb">str</span>:</span></span> + + <label class="view-source-button" for="Teradata.Generator.tablesample_sql-view-source"><span>View Source</span></label> + + </div> + <a class="headerlink" href="#Teradata.Generator.tablesample_sql"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="Teradata.Generator.tablesample_sql-178"><a href="#Teradata.Generator.tablesample_sql-178"><span class="linenos">178</span></a> <span class="k">def</span> <span class="nf">tablesample_sql</span><span class="p">(</span> +</span><span id="Teradata.Generator.tablesample_sql-179"><a href="#Teradata.Generator.tablesample_sql-179"><span class="linenos">179</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">TableSample</span><span class="p">,</span> <span class="n">seed_prefix</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"SEED"</span><span class="p">,</span> <span class="n">sep</span><span class="o">=</span><span class="s2">" AS "</span> +</span><span id="Teradata.Generator.tablesample_sql-180"><a href="#Teradata.Generator.tablesample_sql-180"><span class="linenos">180</span></a> <span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Teradata.Generator.tablesample_sql-181"><a href="#Teradata.Generator.tablesample_sql-181"><span class="linenos">181</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2"> SAMPLE </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span> +</span></pre></div> + + + + + </div> <div id="Teradata.Generator.partitionedbyproperty_sql" class="classattr"> <input id="Teradata.Generator.partitionedbyproperty_sql-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr function"> @@ -1596,8 +1660,8 @@ Default: True</li> </div> <a class="headerlink" href="#Teradata.Generator.partitionedbyproperty_sql"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Teradata.Generator.partitionedbyproperty_sql-175"><a href="#Teradata.Generator.partitionedbyproperty_sql-175"><span class="linenos">175</span></a> <span class="k">def</span> <span class="nf">partitionedbyproperty_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Teradata.Generator.partitionedbyproperty_sql-176"><a href="#Teradata.Generator.partitionedbyproperty_sql-176"><span class="linenos">176</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"PARTITION BY </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Teradata.Generator.partitionedbyproperty_sql-183"><a href="#Teradata.Generator.partitionedbyproperty_sql-183"><span class="linenos">183</span></a> <span class="k">def</span> <span class="nf">partitionedbyproperty_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">PartitionedByProperty</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Teradata.Generator.partitionedbyproperty_sql-184"><a href="#Teradata.Generator.partitionedbyproperty_sql-184"><span class="linenos">184</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"PARTITION BY </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span><span class="w"> </span><span class="s1">'this'</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span> </span></pre></div> @@ -1615,13 +1679,13 @@ Default: True</li> </div> <a class="headerlink" href="#Teradata.Generator.update_sql"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Teradata.Generator.update_sql-180"><a href="#Teradata.Generator.update_sql-180"><span class="linenos">180</span></a> <span class="k">def</span> <span class="nf">update_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Update</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Teradata.Generator.update_sql-181"><a href="#Teradata.Generator.update_sql-181"><span class="linenos">181</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> -</span><span id="Teradata.Generator.update_sql-182"><a href="#Teradata.Generator.update_sql-182"><span class="linenos">182</span></a> <span class="n">from_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"from"</span><span class="p">)</span> -</span><span id="Teradata.Generator.update_sql-183"><a href="#Teradata.Generator.update_sql-183"><span class="linenos">183</span></a> <span class="n">set_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">flat</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> -</span><span id="Teradata.Generator.update_sql-184"><a href="#Teradata.Generator.update_sql-184"><span class="linenos">184</span></a> <span class="n">where_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"where"</span><span class="p">)</span> -</span><span id="Teradata.Generator.update_sql-185"><a href="#Teradata.Generator.update_sql-185"><span class="linenos">185</span></a> <span class="n">sql</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"UPDATE </span><span class="si">{</span><span class="n">this</span><span class="si">}{</span><span class="n">from_sql</span><span class="si">}</span><span class="s2"> SET </span><span class="si">{</span><span class="n">set_sql</span><span class="si">}{</span><span class="n">where_sql</span><span class="si">}</span><span class="s2">"</span> -</span><span id="Teradata.Generator.update_sql-186"><a href="#Teradata.Generator.update_sql-186"><span class="linenos">186</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">prepend_ctes</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">sql</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Teradata.Generator.update_sql-188"><a href="#Teradata.Generator.update_sql-188"><span class="linenos">188</span></a> <span class="k">def</span> <span class="nf">update_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Update</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Teradata.Generator.update_sql-189"><a href="#Teradata.Generator.update_sql-189"><span class="linenos">189</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> +</span><span id="Teradata.Generator.update_sql-190"><a href="#Teradata.Generator.update_sql-190"><span class="linenos">190</span></a> <span class="n">from_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"from"</span><span class="p">)</span> +</span><span id="Teradata.Generator.update_sql-191"><a href="#Teradata.Generator.update_sql-191"><span class="linenos">191</span></a> <span class="n">set_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">flat</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="Teradata.Generator.update_sql-192"><a href="#Teradata.Generator.update_sql-192"><span class="linenos">192</span></a> <span class="n">where_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"where"</span><span class="p">)</span> +</span><span id="Teradata.Generator.update_sql-193"><a href="#Teradata.Generator.update_sql-193"><span class="linenos">193</span></a> <span class="n">sql</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"UPDATE </span><span class="si">{</span><span class="n">this</span><span class="si">}{</span><span class="n">from_sql</span><span class="si">}</span><span class="s2"> SET </span><span class="si">{</span><span class="n">set_sql</span><span class="si">}{</span><span class="n">where_sql</span><span class="si">}</span><span class="s2">"</span> +</span><span id="Teradata.Generator.update_sql-194"><a href="#Teradata.Generator.update_sql-194"><span class="linenos">194</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">prepend_ctes</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">sql</span><span class="p">)</span> </span></pre></div> @@ -1639,8 +1703,8 @@ Default: True</li> </div> <a class="headerlink" href="#Teradata.Generator.mod_sql"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Teradata.Generator.mod_sql-188"><a href="#Teradata.Generator.mod_sql-188"><span class="linenos">188</span></a> <span class="k">def</span> <span class="nf">mod_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Mod</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Teradata.Generator.mod_sql-189"><a href="#Teradata.Generator.mod_sql-189"><span class="linenos">189</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">binary</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"MOD"</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Teradata.Generator.mod_sql-196"><a href="#Teradata.Generator.mod_sql-196"><span class="linenos">196</span></a> <span class="k">def</span> <span class="nf">mod_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Mod</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Teradata.Generator.mod_sql-197"><a href="#Teradata.Generator.mod_sql-197"><span class="linenos">197</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">binary</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"MOD"</span><span class="p">)</span> </span></pre></div> @@ -1658,10 +1722,10 @@ Default: True</li> </div> <a class="headerlink" href="#Teradata.Generator.datatype_sql"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Teradata.Generator.datatype_sql-191"><a href="#Teradata.Generator.datatype_sql-191"><span class="linenos">191</span></a> <span class="k">def</span> <span class="nf">datatype_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Teradata.Generator.datatype_sql-192"><a href="#Teradata.Generator.datatype_sql-192"><span class="linenos">192</span></a> <span class="n">type_sql</span> <span class="o">=</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">datatype_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> -</span><span id="Teradata.Generator.datatype_sql-193"><a href="#Teradata.Generator.datatype_sql-193"><span class="linenos">193</span></a> <span class="n">prefix_sql</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"prefix"</span><span class="p">)</span> -</span><span id="Teradata.Generator.datatype_sql-194"><a href="#Teradata.Generator.datatype_sql-194"><span class="linenos">194</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"SYSUDTLIB.</span><span class="si">{</span><span class="n">type_sql</span><span class="si">}</span><span class="s2">"</span> <span class="k">if</span> <span class="n">prefix_sql</span> <span class="k">else</span> <span class="n">type_sql</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Teradata.Generator.datatype_sql-199"><a href="#Teradata.Generator.datatype_sql-199"><span class="linenos">199</span></a> <span class="k">def</span> <span class="nf">datatype_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">DataType</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Teradata.Generator.datatype_sql-200"><a href="#Teradata.Generator.datatype_sql-200"><span class="linenos">200</span></a> <span class="n">type_sql</span> <span class="o">=</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">datatype_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> +</span><span id="Teradata.Generator.datatype_sql-201"><a href="#Teradata.Generator.datatype_sql-201"><span class="linenos">201</span></a> <span class="n">prefix_sql</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"prefix"</span><span class="p">)</span> +</span><span id="Teradata.Generator.datatype_sql-202"><a href="#Teradata.Generator.datatype_sql-202"><span class="linenos">202</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"SYSUDTLIB.</span><span class="si">{</span><span class="n">type_sql</span><span class="si">}</span><span class="s2">"</span> <span class="k">if</span> <span class="n">prefix_sql</span> <span class="k">else</span> <span class="n">type_sql</span> </span></pre></div> @@ -1679,13 +1743,13 @@ Default: True</li> </div> <a class="headerlink" href="#Teradata.Generator.rangen_sql"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Teradata.Generator.rangen_sql-196"><a href="#Teradata.Generator.rangen_sql-196"><span class="linenos">196</span></a> <span class="k">def</span> <span class="nf">rangen_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">RangeN</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Teradata.Generator.rangen_sql-197"><a href="#Teradata.Generator.rangen_sql-197"><span class="linenos">197</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> -</span><span id="Teradata.Generator.rangen_sql-198"><a href="#Teradata.Generator.rangen_sql-198"><span class="linenos">198</span></a> <span class="n">expressions_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> -</span><span id="Teradata.Generator.rangen_sql-199"><a href="#Teradata.Generator.rangen_sql-199"><span class="linenos">199</span></a> <span class="n">each_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"each"</span><span class="p">)</span> -</span><span id="Teradata.Generator.rangen_sql-200"><a href="#Teradata.Generator.rangen_sql-200"><span class="linenos">200</span></a> <span class="n">each_sql</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">" EACH </span><span class="si">{</span><span class="n">each_sql</span><span class="si">}</span><span class="s2">"</span> <span class="k">if</span> <span class="n">each_sql</span> <span class="k">else</span> <span class="s2">""</span> -</span><span id="Teradata.Generator.rangen_sql-201"><a href="#Teradata.Generator.rangen_sql-201"><span class="linenos">201</span></a> -</span><span id="Teradata.Generator.rangen_sql-202"><a href="#Teradata.Generator.rangen_sql-202"><span class="linenos">202</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"RANGE_N(</span><span class="si">{</span><span class="n">this</span><span class="si">}</span><span class="s2"> BETWEEN </span><span class="si">{</span><span class="n">expressions_sql</span><span class="si">}{</span><span class="n">each_sql</span><span class="si">}</span><span class="s2">)"</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Teradata.Generator.rangen_sql-204"><a href="#Teradata.Generator.rangen_sql-204"><span class="linenos">204</span></a> <span class="k">def</span> <span class="nf">rangen_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">RangeN</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Teradata.Generator.rangen_sql-205"><a href="#Teradata.Generator.rangen_sql-205"><span class="linenos">205</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> +</span><span id="Teradata.Generator.rangen_sql-206"><a href="#Teradata.Generator.rangen_sql-206"><span class="linenos">206</span></a> <span class="n">expressions_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> +</span><span id="Teradata.Generator.rangen_sql-207"><a href="#Teradata.Generator.rangen_sql-207"><span class="linenos">207</span></a> <span class="n">each_sql</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"each"</span><span class="p">)</span> +</span><span id="Teradata.Generator.rangen_sql-208"><a href="#Teradata.Generator.rangen_sql-208"><span class="linenos">208</span></a> <span class="n">each_sql</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">" EACH </span><span class="si">{</span><span class="n">each_sql</span><span class="si">}</span><span class="s2">"</span> <span class="k">if</span> <span class="n">each_sql</span> <span class="k">else</span> <span class="s2">""</span> +</span><span id="Teradata.Generator.rangen_sql-209"><a href="#Teradata.Generator.rangen_sql-209"><span class="linenos">209</span></a> +</span><span id="Teradata.Generator.rangen_sql-210"><a href="#Teradata.Generator.rangen_sql-210"><span class="linenos">210</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"RANGE_N(</span><span class="si">{</span><span class="n">this</span><span class="si">}</span><span class="s2"> BETWEEN </span><span class="si">{</span><span class="n">expressions_sql</span><span class="si">}{</span><span class="n">each_sql</span><span class="si">}</span><span class="s2">)"</span> </span></pre></div> @@ -1703,19 +1767,19 @@ Default: True</li> </div> <a class="headerlink" href="#Teradata.Generator.createable_sql"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Teradata.Generator.createable_sql-204"><a href="#Teradata.Generator.createable_sql-204"><span class="linenos">204</span></a> <span class="k">def</span> <span class="nf">createable_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Create</span><span class="p">,</span> <span class="n">locations</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">DefaultDict</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Teradata.Generator.createable_sql-205"><a href="#Teradata.Generator.createable_sql-205"><span class="linenos">205</span></a> <span class="n">kind</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> -</span><span id="Teradata.Generator.createable_sql-206"><a href="#Teradata.Generator.createable_sql-206"><span class="linenos">206</span></a> <span class="k">if</span> <span class="n">kind</span> <span class="o">==</span> <span class="s2">"TABLE"</span> <span class="ow">and</span> <span class="n">locations</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_NAME</span><span class="p">):</span> -</span><span id="Teradata.Generator.createable_sql-207"><a href="#Teradata.Generator.createable_sql-207"><span class="linenos">207</span></a> <span class="n">this_name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> -</span><span id="Teradata.Generator.createable_sql-208"><a href="#Teradata.Generator.createable_sql-208"><span class="linenos">208</span></a> <span class="n">this_properties</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">properties</span><span class="p">(</span> -</span><span id="Teradata.Generator.createable_sql-209"><a href="#Teradata.Generator.createable_sql-209"><span class="linenos">209</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="n">locations</span><span class="p">[</span><span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_NAME</span><span class="p">]),</span> -</span><span id="Teradata.Generator.createable_sql-210"><a href="#Teradata.Generator.createable_sql-210"><span class="linenos">210</span></a> <span class="n">wrapped</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> -</span><span id="Teradata.Generator.createable_sql-211"><a href="#Teradata.Generator.createable_sql-211"><span class="linenos">211</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">","</span><span class="p">,</span> -</span><span id="Teradata.Generator.createable_sql-212"><a href="#Teradata.Generator.createable_sql-212"><span class="linenos">212</span></a> <span class="p">)</span> -</span><span id="Teradata.Generator.createable_sql-213"><a href="#Teradata.Generator.createable_sql-213"><span class="linenos">213</span></a> <span class="n">this_schema</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">schema_columns_sql</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">this</span><span class="p">)</span> -</span><span id="Teradata.Generator.createable_sql-214"><a href="#Teradata.Generator.createable_sql-214"><span class="linenos">214</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">this_name</span><span class="si">}{</span><span class="n">this_properties</span><span class="si">}{</span><span class="bp">self</span><span class="o">.</span><span class="n">sep</span><span class="p">()</span><span class="si">}{</span><span class="n">this_schema</span><span class="si">}</span><span class="s2">"</span> -</span><span id="Teradata.Generator.createable_sql-215"><a href="#Teradata.Generator.createable_sql-215"><span class="linenos">215</span></a> -</span><span id="Teradata.Generator.createable_sql-216"><a href="#Teradata.Generator.createable_sql-216"><span class="linenos">216</span></a> <span class="k">return</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">createable_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">locations</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Teradata.Generator.createable_sql-212"><a href="#Teradata.Generator.createable_sql-212"><span class="linenos">212</span></a> <span class="k">def</span> <span class="nf">createable_sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">exp</span><span class="o">.</span><span class="n">Create</span><span class="p">,</span> <span class="n">locations</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">DefaultDict</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Teradata.Generator.createable_sql-213"><a href="#Teradata.Generator.createable_sql-213"><span class="linenos">213</span></a> <span class="n">kind</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> +</span><span id="Teradata.Generator.createable_sql-214"><a href="#Teradata.Generator.createable_sql-214"><span class="linenos">214</span></a> <span class="k">if</span> <span class="n">kind</span> <span class="o">==</span> <span class="s2">"TABLE"</span> <span class="ow">and</span> <span class="n">locations</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_NAME</span><span class="p">):</span> +</span><span id="Teradata.Generator.createable_sql-215"><a href="#Teradata.Generator.createable_sql-215"><span class="linenos">215</span></a> <span class="n">this_name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> +</span><span id="Teradata.Generator.createable_sql-216"><a href="#Teradata.Generator.createable_sql-216"><span class="linenos">216</span></a> <span class="n">this_properties</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">properties</span><span class="p">(</span> +</span><span id="Teradata.Generator.createable_sql-217"><a href="#Teradata.Generator.createable_sql-217"><span class="linenos">217</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="n">locations</span><span class="p">[</span><span class="n">exp</span><span class="o">.</span><span class="n">Properties</span><span class="o">.</span><span class="n">Location</span><span class="o">.</span><span class="n">POST_NAME</span><span class="p">]),</span> +</span><span id="Teradata.Generator.createable_sql-218"><a href="#Teradata.Generator.createable_sql-218"><span class="linenos">218</span></a> <span class="n">wrapped</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> +</span><span id="Teradata.Generator.createable_sql-219"><a href="#Teradata.Generator.createable_sql-219"><span class="linenos">219</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">","</span><span class="p">,</span> +</span><span id="Teradata.Generator.createable_sql-220"><a href="#Teradata.Generator.createable_sql-220"><span class="linenos">220</span></a> <span class="p">)</span> +</span><span id="Teradata.Generator.createable_sql-221"><a href="#Teradata.Generator.createable_sql-221"><span class="linenos">221</span></a> <span class="n">this_schema</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">schema_columns_sql</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">this</span><span class="p">)</span> +</span><span id="Teradata.Generator.createable_sql-222"><a href="#Teradata.Generator.createable_sql-222"><span class="linenos">222</span></a> <span class="k">return</span> <span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">this_name</span><span class="si">}{</span><span class="n">this_properties</span><span class="si">}{</span><span class="bp">self</span><span class="o">.</span><span class="n">sep</span><span class="p">()</span><span class="si">}{</span><span class="n">this_schema</span><span class="si">}</span><span class="s2">"</span> +</span><span id="Teradata.Generator.createable_sql-223"><a href="#Teradata.Generator.createable_sql-223"><span class="linenos">223</span></a> +</span><span id="Teradata.Generator.createable_sql-224"><a href="#Teradata.Generator.createable_sql-224"><span class="linenos">224</span></a> <span class="k">return</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">createable_sql</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">locations</span><span class="p">)</span> </span></pre></div> @@ -1772,26 +1836,26 @@ Default: True</li> </div> <a class="headerlink" href="#Teradata.Generator.can_identify"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Teradata.Generator.can_identify-256"><a href="#Teradata.Generator.can_identify-256"><span class="linenos">256</span></a> <span class="nd">@classmethod</span> -</span><span id="Teradata.Generator.can_identify-257"><a href="#Teradata.Generator.can_identify-257"><span class="linenos">257</span></a> <span class="k">def</span> <span class="nf">can_identify</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">text</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">identify</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="nb">bool</span> <span class="o">=</span> <span class="s2">"safe"</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> -</span><span id="Teradata.Generator.can_identify-258"><a href="#Teradata.Generator.can_identify-258"><span class="linenos">258</span></a><span class="w"> </span><span class="sd">"""Checks if text can be identified given an identify option.</span> -</span><span id="Teradata.Generator.can_identify-259"><a href="#Teradata.Generator.can_identify-259"><span class="linenos">259</span></a> -</span><span id="Teradata.Generator.can_identify-260"><a href="#Teradata.Generator.can_identify-260"><span class="linenos">260</span></a><span class="sd"> Args:</span> -</span><span id="Teradata.Generator.can_identify-261"><a href="#Teradata.Generator.can_identify-261"><span class="linenos">261</span></a><span class="sd"> text: The text to check.</span> -</span><span id="Teradata.Generator.can_identify-262"><a href="#Teradata.Generator.can_identify-262"><span class="linenos">262</span></a><span class="sd"> identify:</span> -</span><span id="Teradata.Generator.can_identify-263"><a href="#Teradata.Generator.can_identify-263"><span class="linenos">263</span></a><span class="sd"> "always" or `True`: Always returns true.</span> -</span><span id="Teradata.Generator.can_identify-264"><a href="#Teradata.Generator.can_identify-264"><span class="linenos">264</span></a><span class="sd"> "safe": True if the identifier is case-insensitive.</span> -</span><span id="Teradata.Generator.can_identify-265"><a href="#Teradata.Generator.can_identify-265"><span class="linenos">265</span></a> -</span><span id="Teradata.Generator.can_identify-266"><a href="#Teradata.Generator.can_identify-266"><span class="linenos">266</span></a><span class="sd"> Returns:</span> -</span><span id="Teradata.Generator.can_identify-267"><a href="#Teradata.Generator.can_identify-267"><span class="linenos">267</span></a><span class="sd"> Whether or not the given text can be identified.</span> -</span><span id="Teradata.Generator.can_identify-268"><a href="#Teradata.Generator.can_identify-268"><span class="linenos">268</span></a><span class="sd"> """</span> -</span><span id="Teradata.Generator.can_identify-269"><a href="#Teradata.Generator.can_identify-269"><span class="linenos">269</span></a> <span class="k">if</span> <span class="n">identify</span> <span class="ow">is</span> <span class="kc">True</span> <span class="ow">or</span> <span class="n">identify</span> <span class="o">==</span> <span class="s2">"always"</span><span class="p">:</span> -</span><span id="Teradata.Generator.can_identify-270"><a href="#Teradata.Generator.can_identify-270"><span class="linenos">270</span></a> <span class="k">return</span> <span class="kc">True</span> -</span><span id="Teradata.Generator.can_identify-271"><a href="#Teradata.Generator.can_identify-271"><span class="linenos">271</span></a> -</span><span id="Teradata.Generator.can_identify-272"><a href="#Teradata.Generator.can_identify-272"><span class="linenos">272</span></a> <span class="k">if</span> <span class="n">identify</span> <span class="o">==</span> <span class="s2">"safe"</span><span class="p">:</span> -</span><span id="Teradata.Generator.can_identify-273"><a href="#Teradata.Generator.can_identify-273"><span class="linenos">273</span></a> <span class="k">return</span> <span class="ow">not</span> <span class="bp">cls</span><span class="o">.</span><span class="n">case_sensitive</span><span class="p">(</span><span class="n">text</span><span class="p">)</span> -</span><span id="Teradata.Generator.can_identify-274"><a href="#Teradata.Generator.can_identify-274"><span class="linenos">274</span></a> -</span><span id="Teradata.Generator.can_identify-275"><a href="#Teradata.Generator.can_identify-275"><span class="linenos">275</span></a> <span class="k">return</span> <span class="kc">False</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Teradata.Generator.can_identify-257"><a href="#Teradata.Generator.can_identify-257"><span class="linenos">257</span></a> <span class="nd">@classmethod</span> +</span><span id="Teradata.Generator.can_identify-258"><a href="#Teradata.Generator.can_identify-258"><span class="linenos">258</span></a> <span class="k">def</span> <span class="nf">can_identify</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">text</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">identify</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="nb">bool</span> <span class="o">=</span> <span class="s2">"safe"</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="Teradata.Generator.can_identify-259"><a href="#Teradata.Generator.can_identify-259"><span class="linenos">259</span></a><span class="w"> </span><span class="sd">"""Checks if text can be identified given an identify option.</span> +</span><span id="Teradata.Generator.can_identify-260"><a href="#Teradata.Generator.can_identify-260"><span class="linenos">260</span></a> +</span><span id="Teradata.Generator.can_identify-261"><a href="#Teradata.Generator.can_identify-261"><span class="linenos">261</span></a><span class="sd"> Args:</span> +</span><span id="Teradata.Generator.can_identify-262"><a href="#Teradata.Generator.can_identify-262"><span class="linenos">262</span></a><span class="sd"> text: The text to check.</span> +</span><span id="Teradata.Generator.can_identify-263"><a href="#Teradata.Generator.can_identify-263"><span class="linenos">263</span></a><span class="sd"> identify:</span> +</span><span id="Teradata.Generator.can_identify-264"><a href="#Teradata.Generator.can_identify-264"><span class="linenos">264</span></a><span class="sd"> "always" or `True`: Always returns true.</span> +</span><span id="Teradata.Generator.can_identify-265"><a href="#Teradata.Generator.can_identify-265"><span class="linenos">265</span></a><span class="sd"> "safe": True if the identifier is case-insensitive.</span> +</span><span id="Teradata.Generator.can_identify-266"><a href="#Teradata.Generator.can_identify-266"><span class="linenos">266</span></a> +</span><span id="Teradata.Generator.can_identify-267"><a href="#Teradata.Generator.can_identify-267"><span class="linenos">267</span></a><span class="sd"> Returns:</span> +</span><span id="Teradata.Generator.can_identify-268"><a href="#Teradata.Generator.can_identify-268"><span class="linenos">268</span></a><span class="sd"> Whether or not the given text can be identified.</span> +</span><span id="Teradata.Generator.can_identify-269"><a href="#Teradata.Generator.can_identify-269"><span class="linenos">269</span></a><span class="sd"> """</span> +</span><span id="Teradata.Generator.can_identify-270"><a href="#Teradata.Generator.can_identify-270"><span class="linenos">270</span></a> <span class="k">if</span> <span class="n">identify</span> <span class="ow">is</span> <span class="kc">True</span> <span class="ow">or</span> <span class="n">identify</span> <span class="o">==</span> <span class="s2">"always"</span><span class="p">:</span> +</span><span id="Teradata.Generator.can_identify-271"><a href="#Teradata.Generator.can_identify-271"><span class="linenos">271</span></a> <span class="k">return</span> <span class="kc">True</span> +</span><span id="Teradata.Generator.can_identify-272"><a href="#Teradata.Generator.can_identify-272"><span class="linenos">272</span></a> +</span><span id="Teradata.Generator.can_identify-273"><a href="#Teradata.Generator.can_identify-273"><span class="linenos">273</span></a> <span class="k">if</span> <span class="n">identify</span> <span class="o">==</span> <span class="s2">"safe"</span><span class="p">:</span> +</span><span id="Teradata.Generator.can_identify-274"><a href="#Teradata.Generator.can_identify-274"><span class="linenos">274</span></a> <span class="k">return</span> <span class="ow">not</span> <span class="bp">cls</span><span class="o">.</span><span class="n">case_sensitive</span><span class="p">(</span><span class="n">text</span><span class="p">)</span> +</span><span id="Teradata.Generator.can_identify-275"><a href="#Teradata.Generator.can_identify-275"><span class="linenos">275</span></a> +</span><span id="Teradata.Generator.can_identify-276"><a href="#Teradata.Generator.can_identify-276"><span class="linenos">276</span></a> <span class="k">return</span> <span class="kc">False</span> </span></pre></div> @@ -1865,7 +1929,7 @@ Default: True</li> <div id="Teradata.Generator.TOKENIZER_CLASS" class="classattr"> <div class="attr variable"> <span class="name">TOKENIZER_CLASS</span> = -<span class="default_value"><class '<a href="#Teradata.Tokenizer">sqlglot.dialects.teradata.Teradata.Tokenizer</a>'></span> +<span class="default_value"><class '<a href="#Teradata.Tokenizer">Teradata.Tokenizer</a>'></span> </div> @@ -2083,7 +2147,6 @@ Default: True</li> <dd id="Teradata.Generator.withtablehint_sql" class="function"><a href="../generator.html#Generator.withtablehint_sql">withtablehint_sql</a></dd> <dd id="Teradata.Generator.indextablehint_sql" class="function"><a href="../generator.html#Generator.indextablehint_sql">indextablehint_sql</a></dd> <dd id="Teradata.Generator.table_sql" class="function"><a href="../generator.html#Generator.table_sql">table_sql</a></dd> - <dd id="Teradata.Generator.tablesample_sql" class="function"><a href="../generator.html#Generator.tablesample_sql">tablesample_sql</a></dd> <dd id="Teradata.Generator.pivot_sql" class="function"><a href="../generator.html#Generator.pivot_sql">pivot_sql</a></dd> <dd id="Teradata.Generator.version_sql" class="function"><a href="../generator.html#Generator.version_sql">version_sql</a></dd> <dd id="Teradata.Generator.tuple_sql" class="function"><a href="../generator.html#Generator.tuple_sql">tuple_sql</a></dd> @@ -2154,7 +2217,12 @@ Default: True</li> <dd id="Teradata.Generator.if_sql" class="function"><a href="../generator.html#Generator.if_sql">if_sql</a></dd> <dd id="Teradata.Generator.matchagainst_sql" class="function"><a href="../generator.html#Generator.matchagainst_sql">matchagainst_sql</a></dd> <dd id="Teradata.Generator.jsonkeyvalue_sql" class="function"><a href="../generator.html#Generator.jsonkeyvalue_sql">jsonkeyvalue_sql</a></dd> + <dd id="Teradata.Generator.formatjson_sql" class="function"><a href="../generator.html#Generator.formatjson_sql">formatjson_sql</a></dd> <dd id="Teradata.Generator.jsonobject_sql" class="function"><a href="../generator.html#Generator.jsonobject_sql">jsonobject_sql</a></dd> + <dd id="Teradata.Generator.jsonarray_sql" class="function"><a href="../generator.html#Generator.jsonarray_sql">jsonarray_sql</a></dd> + <dd id="Teradata.Generator.jsonarrayagg_sql" class="function"><a href="../generator.html#Generator.jsonarrayagg_sql">jsonarrayagg_sql</a></dd> + <dd id="Teradata.Generator.jsoncolumndef_sql" class="function"><a href="../generator.html#Generator.jsoncolumndef_sql">jsoncolumndef_sql</a></dd> + <dd id="Teradata.Generator.jsontable_sql" class="function"><a href="../generator.html#Generator.jsontable_sql">jsontable_sql</a></dd> <dd id="Teradata.Generator.openjsoncolumndef_sql" class="function"><a href="../generator.html#Generator.openjsoncolumndef_sql">openjsoncolumndef_sql</a></dd> <dd id="Teradata.Generator.openjson_sql" class="function"><a href="../generator.html#Generator.openjson_sql">openjson_sql</a></dd> <dd id="Teradata.Generator.in_sql" class="function"><a href="../generator.html#Generator.in_sql">in_sql</a></dd> @@ -2255,6 +2323,7 @@ Default: True</li> <dd id="Teradata.Generator.indexcolumnconstraint_sql" class="function"><a href="../generator.html#Generator.indexcolumnconstraint_sql">indexcolumnconstraint_sql</a></dd> <dd id="Teradata.Generator.nvl2_sql" class="function"><a href="../generator.html#Generator.nvl2_sql">nvl2_sql</a></dd> <dd id="Teradata.Generator.comprehension_sql" class="function"><a href="../generator.html#Generator.comprehension_sql">comprehension_sql</a></dd> + <dd id="Teradata.Generator.columnprefix_sql" class="function"><a href="../generator.html#Generator.columnprefix_sql">columnprefix_sql</a></dd> </div> </dl> |