Merging upstream version 26.15.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
2a79d9df75
commit
de6539b796
58 changed files with 4878 additions and 4677 deletions
17
CHANGELOG.md
17
CHANGELOG.md
|
@ -1,6 +1,22 @@
|
||||||
Changelog
|
Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
## [v26.14.0] - 2025-04-15
|
||||||
|
### :boom: BREAKING CHANGES
|
||||||
|
- due to [`cb20038`](https://github.com/tobymao/sqlglot/commit/cb2003875fc6e149bd4a631e99c312a04435a46b) - treat GO as command *(PR [#4978](https://github.com/tobymao/sqlglot/pull/4978) by [@georgesittas](https://github.com/georgesittas))*:
|
||||||
|
|
||||||
|
treat GO as command (#4978)
|
||||||
|
|
||||||
|
- due to [`60e26b8`](https://github.com/tobymao/sqlglot/commit/60e26b868242a05a7fdc2725bd21a127910a6fb7) - improve transpilability of GET_JSON_OBJECT by parsing json path *(PR [#4980](https://github.com/tobymao/sqlglot/pull/4980) by [@georgesittas](https://github.com/georgesittas))*:
|
||||||
|
|
||||||
|
improve transpilability of GET_JSON_OBJECT by parsing json path (#4980)
|
||||||
|
|
||||||
|
|
||||||
|
### :bug: Bug Fixes
|
||||||
|
- [`cb20038`](https://github.com/tobymao/sqlglot/commit/cb2003875fc6e149bd4a631e99c312a04435a46b) - **tsql**: treat GO as command *(PR [#4978](https://github.com/tobymao/sqlglot/pull/4978) by [@georgesittas](https://github.com/georgesittas))*
|
||||||
|
- [`60e26b8`](https://github.com/tobymao/sqlglot/commit/60e26b868242a05a7fdc2725bd21a127910a6fb7) - **hive**: improve transpilability of GET_JSON_OBJECT by parsing json path *(PR [#4980](https://github.com/tobymao/sqlglot/pull/4980) by [@georgesittas](https://github.com/georgesittas))*
|
||||||
|
|
||||||
|
|
||||||
## [v26.13.2] - 2025-04-14
|
## [v26.13.2] - 2025-04-14
|
||||||
### :bug: Bug Fixes
|
### :bug: Bug Fixes
|
||||||
- [`9693dbd`](https://github.com/tobymao/sqlglot/commit/9693dbd18b98b2699cade738a254f71f2ee8ce74) - **clickhouse**: avoid superfluous parentheses in DISTINCT ON (...) *(commit by [@georgesittas](https://github.com/georgesittas))*
|
- [`9693dbd`](https://github.com/tobymao/sqlglot/commit/9693dbd18b98b2699cade738a254f71f2ee8ce74) - **clickhouse**: avoid superfluous parentheses in DISTINCT ON (...) *(commit by [@georgesittas](https://github.com/georgesittas))*
|
||||||
|
@ -6341,3 +6357,4 @@ Changelog
|
||||||
[v26.13.0]: https://github.com/tobymao/sqlglot/compare/v26.12.1...v26.13.0
|
[v26.13.0]: https://github.com/tobymao/sqlglot/compare/v26.12.1...v26.13.0
|
||||||
[v26.13.1]: https://github.com/tobymao/sqlglot/compare/v26.13.0...v26.13.1
|
[v26.13.1]: https://github.com/tobymao/sqlglot/compare/v26.13.0...v26.13.1
|
||||||
[v26.13.2]: https://github.com/tobymao/sqlglot/compare/v26.13.1...v26.13.2
|
[v26.13.2]: https://github.com/tobymao/sqlglot/compare/v26.13.1...v26.13.2
|
||||||
|
[v26.14.0]: https://github.com/tobymao/sqlglot/compare/v26.13.2...v26.14.0
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -84,8 +84,8 @@
|
||||||
</span><span id="L-17"><a href="#L-17"><span class="linenos">17</span></a><span class="n">__version_tuple__</span><span class="p">:</span> <span class="n">VERSION_TUPLE</span>
|
</span><span id="L-17"><a href="#L-17"><span class="linenos">17</span></a><span class="n">__version_tuple__</span><span class="p">:</span> <span class="n">VERSION_TUPLE</span>
|
||||||
</span><span id="L-18"><a href="#L-18"><span class="linenos">18</span></a><span class="n">version_tuple</span><span class="p">:</span> <span class="n">VERSION_TUPLE</span>
|
</span><span id="L-18"><a href="#L-18"><span class="linenos">18</span></a><span class="n">version_tuple</span><span class="p">:</span> <span class="n">VERSION_TUPLE</span>
|
||||||
</span><span id="L-19"><a href="#L-19"><span class="linenos">19</span></a>
|
</span><span id="L-19"><a href="#L-19"><span class="linenos">19</span></a>
|
||||||
</span><span id="L-20"><a href="#L-20"><span class="linenos">20</span></a><span class="n">__version__</span> <span class="o">=</span> <span class="n">version</span> <span class="o">=</span> <span class="s1">'26.13.2'</span>
|
</span><span id="L-20"><a href="#L-20"><span class="linenos">20</span></a><span class="n">__version__</span> <span class="o">=</span> <span class="n">version</span> <span class="o">=</span> <span class="s1">'26.14.0'</span>
|
||||||
</span><span id="L-21"><a href="#L-21"><span class="linenos">21</span></a><span class="n">__version_tuple__</span> <span class="o">=</span> <span class="n">version_tuple</span> <span class="o">=</span> <span class="p">(</span><span class="mi">26</span><span class="p">,</span> <span class="mi">13</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
|
</span><span id="L-21"><a href="#L-21"><span class="linenos">21</span></a><span class="n">__version_tuple__</span> <span class="o">=</span> <span class="n">version_tuple</span> <span class="o">=</span> <span class="p">(</span><span class="mi">26</span><span class="p">,</span> <span class="mi">14</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
|
||||||
</span></pre></div>
|
</span></pre></div>
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@
|
||||||
<section id="__version__">
|
<section id="__version__">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">__version__</span><span class="annotation">: str</span> =
|
<span class="name">__version__</span><span class="annotation">: str</span> =
|
||||||
<span class="default_value">'26.13.2'</span>
|
<span class="default_value">'26.14.0'</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -105,7 +105,7 @@
|
||||||
<section id="__version_tuple__">
|
<section id="__version_tuple__">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">__version_tuple__</span><span class="annotation">: object</span> =
|
<span class="name">__version_tuple__</span><span class="annotation">: object</span> =
|
||||||
<span class="default_value">(26, 13, 2)</span>
|
<span class="default_value">(26, 14, 0)</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -117,7 +117,7 @@
|
||||||
<section id="version">
|
<section id="version">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">version</span><span class="annotation">: str</span> =
|
<span class="name">version</span><span class="annotation">: str</span> =
|
||||||
<span class="default_value">'26.13.2'</span>
|
<span class="default_value">'26.14.0'</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -129,7 +129,7 @@
|
||||||
<section id="version_tuple">
|
<section id="version_tuple">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">version_tuple</span><span class="annotation">: object</span> =
|
<span class="name">version_tuple</span><span class="annotation">: object</span> =
|
||||||
<span class="default_value">(26, 13, 2)</span>
|
<span class="default_value">(26, 14, 0)</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -355,7 +355,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="Athena">
|
<section id="Athena">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">Athena</span> =
|
<span class="name">Athena</span> =
|
||||||
<span class="default_value"><MagicMock id='140264100748240'></span>
|
<span class="default_value"><MagicMock id='140401428831184'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -367,7 +367,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="BigQuery">
|
<section id="BigQuery">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">BigQuery</span> =
|
<span class="name">BigQuery</span> =
|
||||||
<span class="default_value"><MagicMock id='140264100743344'></span>
|
<span class="default_value"><MagicMock id='140401428826288'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -379,7 +379,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="ClickHouse">
|
<section id="ClickHouse">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">ClickHouse</span> =
|
<span class="name">ClickHouse</span> =
|
||||||
<span class="default_value"><MagicMock id='140264115191664'></span>
|
<span class="default_value"><MagicMock id='140401444880144'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -391,7 +391,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="Databricks">
|
<section id="Databricks">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">Databricks</span> =
|
<span class="name">Databricks</span> =
|
||||||
<span class="default_value"><MagicMock id='140264112300352'></span>
|
<span class="default_value"><MagicMock id='140401441104288'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -403,7 +403,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="Doris">
|
<section id="Doris">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">Doris</span> =
|
<span class="name">Doris</span> =
|
||||||
<span class="default_value"><MagicMock id='140264112292576'></span>
|
<span class="default_value"><MagicMock id='140401441096368'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -415,7 +415,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="Drill">
|
<section id="Drill">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">Drill</span> =
|
<span class="name">Drill</span> =
|
||||||
<span class="default_value"><MagicMock id='140264108318464'></span>
|
<span class="default_value"><MagicMock id='140401437204320'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -427,7 +427,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="Druid">
|
<section id="Druid">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">Druid</span> =
|
<span class="name">Druid</span> =
|
||||||
<span class="default_value"><MagicMock id='140264108317552'></span>
|
<span class="default_value"><MagicMock id='140401437203312'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -439,7 +439,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="DuckDB">
|
<section id="DuckDB">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">DuckDB</span> =
|
<span class="name">DuckDB</span> =
|
||||||
<span class="default_value"><MagicMock id='140264107845824'></span>
|
<span class="default_value"><MagicMock id='140401436698768'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -451,7 +451,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="Dune">
|
<section id="Dune">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">Dune</span> =
|
<span class="name">Dune</span> =
|
||||||
<span class="default_value"><MagicMock id='140264116948320'></span>
|
<span class="default_value"><MagicMock id='140401444164208'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -463,7 +463,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="Hive">
|
<section id="Hive">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">Hive</span> =
|
<span class="name">Hive</span> =
|
||||||
<span class="default_value"><MagicMock id='140264116955808'></span>
|
<span class="default_value"><MagicMock id='140401444170880'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -475,7 +475,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="Materialize">
|
<section id="Materialize">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">Materialize</span> =
|
<span class="name">Materialize</span> =
|
||||||
<span class="default_value"><MagicMock id='140264111251152'></span>
|
<span class="default_value"><MagicMock id='140401440465504'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -487,7 +487,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="MySQL">
|
<section id="MySQL">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">MySQL</span> =
|
<span class="name">MySQL</span> =
|
||||||
<span class="default_value"><MagicMock id='140264115116528'></span>
|
<span class="default_value"><MagicMock id='140401444677632'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -499,7 +499,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="Oracle">
|
<section id="Oracle">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">Oracle</span> =
|
<span class="name">Oracle</span> =
|
||||||
<span class="default_value"><MagicMock id='140264102972624'></span>
|
<span class="default_value"><MagicMock id='140401431039232'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -511,7 +511,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="Postgres">
|
<section id="Postgres">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">Postgres</span> =
|
<span class="name">Postgres</span> =
|
||||||
<span class="default_value"><MagicMock id='140264111467168'></span>
|
<span class="default_value"><MagicMock id='140401440107120'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -523,7 +523,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="Presto">
|
<section id="Presto">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">Presto</span> =
|
<span class="name">Presto</span> =
|
||||||
<span class="default_value"><MagicMock id='140264102706336'></span>
|
<span class="default_value"><MagicMock id='140401430772944'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -535,7 +535,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="PRQL">
|
<section id="PRQL">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">PRQL</span> =
|
<span class="name">PRQL</span> =
|
||||||
<span class="default_value"><MagicMock id='140264102696928'></span>
|
<span class="default_value"><MagicMock id='140401430763440'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -547,7 +547,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="Redshift">
|
<section id="Redshift">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">Redshift</span> =
|
<span class="name">Redshift</span> =
|
||||||
<span class="default_value"><MagicMock id='140264103185808'></span>
|
<span class="default_value"><MagicMock id='140401431252416'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -559,7 +559,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="RisingWave">
|
<section id="RisingWave">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">RisingWave</span> =
|
<span class="name">RisingWave</span> =
|
||||||
<span class="default_value"><MagicMock id='140264103194400'></span>
|
<span class="default_value"><MagicMock id='140401431260912'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -571,7 +571,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="Snowflake">
|
<section id="Snowflake">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">Snowflake</span> =
|
<span class="name">Snowflake</span> =
|
||||||
<span class="default_value"><MagicMock id='140264102785376'></span>
|
<span class="default_value"><MagicMock id='140401430851984'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -583,7 +583,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="Spark">
|
<section id="Spark">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">Spark</span> =
|
<span class="name">Spark</span> =
|
||||||
<span class="default_value"><MagicMock id='140264102778560'></span>
|
<span class="default_value"><MagicMock id='140401430845072'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -595,7 +595,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="Spark2">
|
<section id="Spark2">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">Spark2</span> =
|
<span class="name">Spark2</span> =
|
||||||
<span class="default_value"><MagicMock id='140264117325104'></span>
|
<span class="default_value"><MagicMock id='140401444539840'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -607,7 +607,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="SQLite">
|
<section id="SQLite">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">SQLite</span> =
|
<span class="name">SQLite</span> =
|
||||||
<span class="default_value"><MagicMock id='140264117328656'></span>
|
<span class="default_value"><MagicMock id='140401444543392'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -619,7 +619,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="StarRocks">
|
<section id="StarRocks">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">StarRocks</span> =
|
<span class="name">StarRocks</span> =
|
||||||
<span class="default_value"><MagicMock id='140264112789664'></span>
|
<span class="default_value"><MagicMock id='140401441410064'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -631,7 +631,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="Tableau">
|
<section id="Tableau">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">Tableau</span> =
|
<span class="name">Tableau</span> =
|
||||||
<span class="default_value"><MagicMock id='140264112797488'></span>
|
<span class="default_value"><MagicMock id='140401441421296'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -643,7 +643,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="Teradata">
|
<section id="Teradata">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">Teradata</span> =
|
<span class="name">Teradata</span> =
|
||||||
<span class="default_value"><MagicMock id='140264112400192'></span>
|
<span class="default_value"><MagicMock id='140401441187648'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -655,7 +655,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="Trino">
|
<section id="Trino">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">Trino</span> =
|
<span class="name">Trino</span> =
|
||||||
<span class="default_value"><MagicMock id='140264112391696'></span>
|
<span class="default_value"><MagicMock id='140401441179200'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -667,7 +667,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="TSQL">
|
<section id="TSQL">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">TSQL</span> =
|
<span class="name">TSQL</span> =
|
||||||
<span class="default_value"><MagicMock id='140264115133680'></span>
|
<span class="default_value"><MagicMock id='140401444636176'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -679,7 +679,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="Dialect">
|
<section id="Dialect">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">Dialect</span> =
|
<span class="name">Dialect</span> =
|
||||||
<span class="default_value"><MagicMock id='140264105668192'></span>
|
<span class="default_value"><MagicMock id='140401433734752'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -691,7 +691,7 @@ dialect implementations in order to understand how their various components can
|
||||||
<section id="Dialects">
|
<section id="Dialects">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">Dialects</span> =
|
<span class="name">Dialects</span> =
|
||||||
<span class="default_value"><MagicMock id='140264105670064'></span>
|
<span class="default_value"><MagicMock id='140401433736528'></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -62264,7 +62264,7 @@ Otherwise, this resets the expressions.</li>
|
||||||
<div id="DataType.STRUCT_TYPES" class="classattr">
|
<div id="DataType.STRUCT_TYPES" class="classattr">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">STRUCT_TYPES</span> =
|
<span class="name">STRUCT_TYPES</span> =
|
||||||
<span class="default_value">{<Type.OBJECT: 'OBJECT'>, <Type.UNION: 'UNION'>, <Type.STRUCT: 'STRUCT'>, <Type.NESTED: 'NESTED'>}</span>
|
<span class="default_value">{<Type.UNION: 'UNION'>, <Type.OBJECT: 'OBJECT'>, <Type.STRUCT: 'STRUCT'>, <Type.NESTED: 'NESTED'>}</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -62276,7 +62276,7 @@ Otherwise, this resets the expressions.</li>
|
||||||
<div id="DataType.ARRAY_TYPES" class="classattr">
|
<div id="DataType.ARRAY_TYPES" class="classattr">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">ARRAY_TYPES</span> =
|
<span class="name">ARRAY_TYPES</span> =
|
||||||
<span class="default_value">{<Type.ARRAY: 'ARRAY'>, <Type.LIST: 'LIST'>}</span>
|
<span class="default_value">{<Type.LIST: 'LIST'>, <Type.ARRAY: 'ARRAY'>}</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -62289,7 +62289,7 @@ Otherwise, this resets the expressions.</li>
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">NESTED_TYPES</span> =
|
<span class="name">NESTED_TYPES</span> =
|
||||||
<input id="DataType.NESTED_TYPES-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
<input id="DataType.NESTED_TYPES-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
||||||
<label class="view-value-button pdoc-button" for="DataType.NESTED_TYPES-view-value"></label><span class="default_value">{<Type.OBJECT: 'OBJECT'>, <Type.MAP: 'MAP'>, <Type.LIST: 'LIST'>, <Type.STRUCT: 'STRUCT'>, <Type.NESTED: 'NESTED'>, <Type.ARRAY: 'ARRAY'>, <Type.UNION: 'UNION'>}</span>
|
<label class="view-value-button pdoc-button" for="DataType.NESTED_TYPES-view-value"></label><span class="default_value">{<Type.UNION: 'UNION'>, <Type.OBJECT: 'OBJECT'>, <Type.MAP: 'MAP'>, <Type.NESTED: 'NESTED'>, <Type.LIST: 'LIST'>, <Type.STRUCT: 'STRUCT'>, <Type.ARRAY: 'ARRAY'>}</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -62302,7 +62302,7 @@ Otherwise, this resets the expressions.</li>
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">TEXT_TYPES</span> =
|
<span class="name">TEXT_TYPES</span> =
|
||||||
<input id="DataType.TEXT_TYPES-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
<input id="DataType.TEXT_TYPES-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
||||||
<label class="view-value-button pdoc-button" for="DataType.TEXT_TYPES-view-value"></label><span class="default_value">{<Type.VARCHAR: 'VARCHAR'>, <Type.TEXT: 'TEXT'>, <Type.NVARCHAR: 'NVARCHAR'>, <Type.CHAR: 'CHAR'>, <Type.NCHAR: 'NCHAR'>, <Type.NAME: 'NAME'>}</span>
|
<label class="view-value-button pdoc-button" for="DataType.TEXT_TYPES-view-value"></label><span class="default_value">{<Type.TEXT: 'TEXT'>, <Type.CHAR: 'CHAR'>, <Type.NAME: 'NAME'>, <Type.NVARCHAR: 'NVARCHAR'>, <Type.NCHAR: 'NCHAR'>, <Type.VARCHAR: 'VARCHAR'>}</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -62315,7 +62315,7 @@ Otherwise, this resets the expressions.</li>
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">SIGNED_INTEGER_TYPES</span> =
|
<span class="name">SIGNED_INTEGER_TYPES</span> =
|
||||||
<input id="DataType.SIGNED_INTEGER_TYPES-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
<input id="DataType.SIGNED_INTEGER_TYPES-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
||||||
<label class="view-value-button pdoc-button" for="DataType.SIGNED_INTEGER_TYPES-view-value"></label><span class="default_value">{<Type.BIGINT: 'BIGINT'>, <Type.SMALLINT: 'SMALLINT'>, <Type.INT128: 'INT128'>, <Type.TINYINT: 'TINYINT'>, <Type.INT256: 'INT256'>, <Type.INT: 'INT'>, <Type.MEDIUMINT: 'MEDIUMINT'>}</span>
|
<label class="view-value-button pdoc-button" for="DataType.SIGNED_INTEGER_TYPES-view-value"></label><span class="default_value">{<Type.INT: 'INT'>, <Type.TINYINT: 'TINYINT'>, <Type.MEDIUMINT: 'MEDIUMINT'>, <Type.SMALLINT: 'SMALLINT'>, <Type.INT256: 'INT256'>, <Type.INT128: 'INT128'>, <Type.BIGINT: 'BIGINT'>}</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -62328,7 +62328,7 @@ Otherwise, this resets the expressions.</li>
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">UNSIGNED_INTEGER_TYPES</span> =
|
<span class="name">UNSIGNED_INTEGER_TYPES</span> =
|
||||||
<input id="DataType.UNSIGNED_INTEGER_TYPES-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
<input id="DataType.UNSIGNED_INTEGER_TYPES-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
||||||
<label class="view-value-button pdoc-button" for="DataType.UNSIGNED_INTEGER_TYPES-view-value"></label><span class="default_value">{<Type.UINT128: 'UINT128'>, <Type.UINT256: 'UINT256'>, <Type.UINT: 'UINT'>, <Type.UMEDIUMINT: 'UMEDIUMINT'>, <Type.USMALLINT: 'USMALLINT'>, <Type.UBIGINT: 'UBIGINT'>, <Type.UTINYINT: 'UTINYINT'>}</span>
|
<label class="view-value-button pdoc-button" for="DataType.UNSIGNED_INTEGER_TYPES-view-value"></label><span class="default_value">{<Type.UINT256: 'UINT256'>, <Type.UINT: 'UINT'>, <Type.UBIGINT: 'UBIGINT'>, <Type.UMEDIUMINT: 'UMEDIUMINT'>, <Type.UTINYINT: 'UTINYINT'>, <Type.UINT128: 'UINT128'>, <Type.USMALLINT: 'USMALLINT'>}</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -62341,7 +62341,7 @@ Otherwise, this resets the expressions.</li>
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">INTEGER_TYPES</span> =
|
<span class="name">INTEGER_TYPES</span> =
|
||||||
<input id="DataType.INTEGER_TYPES-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
<input id="DataType.INTEGER_TYPES-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
||||||
<label class="view-value-button pdoc-button" for="DataType.INTEGER_TYPES-view-value"></label><span class="default_value">{<Type.BIGINT: 'BIGINT'>, <Type.SMALLINT: 'SMALLINT'>, <Type.UINT128: 'UINT128'>, <Type.INT128: 'INT128'>, <Type.TINYINT: 'TINYINT'>, <Type.UINT256: 'UINT256'>, <Type.UINT: 'UINT'>, <Type.UMEDIUMINT: 'UMEDIUMINT'>, <Type.BIT: 'BIT'>, <Type.USMALLINT: 'USMALLINT'>, <Type.INT256: 'INT256'>, <Type.INT: 'INT'>, <Type.UBIGINT: 'UBIGINT'>, <Type.UTINYINT: 'UTINYINT'>, <Type.MEDIUMINT: 'MEDIUMINT'>}</span>
|
<label class="view-value-button pdoc-button" for="DataType.INTEGER_TYPES-view-value"></label><span class="default_value">{<Type.UINT256: 'UINT256'>, <Type.INT: 'INT'>, <Type.UINT: 'UINT'>, <Type.UBIGINT: 'UBIGINT'>, <Type.TINYINT: 'TINYINT'>, <Type.MEDIUMINT: 'MEDIUMINT'>, <Type.UMEDIUMINT: 'UMEDIUMINT'>, <Type.UTINYINT: 'UTINYINT'>, <Type.BIT: 'BIT'>, <Type.SMALLINT: 'SMALLINT'>, <Type.USMALLINT: 'USMALLINT'>, <Type.INT256: 'INT256'>, <Type.UINT128: 'UINT128'>, <Type.INT128: 'INT128'>, <Type.BIGINT: 'BIGINT'>}</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -62353,7 +62353,7 @@ Otherwise, this resets the expressions.</li>
|
||||||
<div id="DataType.FLOAT_TYPES" class="classattr">
|
<div id="DataType.FLOAT_TYPES" class="classattr">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">FLOAT_TYPES</span> =
|
<span class="name">FLOAT_TYPES</span> =
|
||||||
<span class="default_value">{<Type.FLOAT: 'FLOAT'>, <Type.DOUBLE: 'DOUBLE'>}</span>
|
<span class="default_value">{<Type.DOUBLE: 'DOUBLE'>, <Type.FLOAT: 'FLOAT'>}</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -62366,7 +62366,7 @@ Otherwise, this resets the expressions.</li>
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">REAL_TYPES</span> =
|
<span class="name">REAL_TYPES</span> =
|
||||||
<input id="DataType.REAL_TYPES-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
<input id="DataType.REAL_TYPES-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
||||||
<label class="view-value-button pdoc-button" for="DataType.REAL_TYPES-view-value"></label><span class="default_value">{<Type.UDOUBLE: 'UDOUBLE'>, <Type.DECIMAL32: 'DECIMAL32'>, <Type.DECIMAL128: 'DECIMAL128'>, <Type.DOUBLE: 'DOUBLE'>, <Type.SMALLMONEY: 'SMALLMONEY'>, <Type.DECIMAL256: 'DECIMAL256'>, <Type.FLOAT: 'FLOAT'>, <Type.UDECIMAL: 'UDECIMAL'>, <Type.DECIMAL: 'DECIMAL'>, <Type.MONEY: 'MONEY'>, <Type.DECIMAL64: 'DECIMAL64'>, <Type.BIGDECIMAL: 'BIGDECIMAL'>}</span>
|
<label class="view-value-button pdoc-button" for="DataType.REAL_TYPES-view-value"></label><span class="default_value">{<Type.UDECIMAL: 'UDECIMAL'>, <Type.FLOAT: 'FLOAT'>, <Type.MONEY: 'MONEY'>, <Type.DECIMAL: 'DECIMAL'>, <Type.DECIMAL256: 'DECIMAL256'>, <Type.UDOUBLE: 'UDOUBLE'>, <Type.DECIMAL64: 'DECIMAL64'>, <Type.DECIMAL128: 'DECIMAL128'>, <Type.SMALLMONEY: 'SMALLMONEY'>, <Type.BIGDECIMAL: 'BIGDECIMAL'>, <Type.DOUBLE: 'DOUBLE'>, <Type.DECIMAL32: 'DECIMAL32'>}</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -62379,7 +62379,7 @@ Otherwise, this resets the expressions.</li>
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">NUMERIC_TYPES</span> =
|
<span class="name">NUMERIC_TYPES</span> =
|
||||||
<input id="DataType.NUMERIC_TYPES-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
<input id="DataType.NUMERIC_TYPES-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
||||||
<label class="view-value-button pdoc-button" for="DataType.NUMERIC_TYPES-view-value"></label><span class="default_value">{<Type.BIGINT: 'BIGINT'>, <Type.SMALLINT: 'SMALLINT'>, <Type.UINT256: 'UINT256'>, <Type.BIT: 'BIT'>, <Type.UMEDIUMINT: 'UMEDIUMINT'>, <Type.DOUBLE: 'DOUBLE'>, <Type.USMALLINT: 'USMALLINT'>, <Type.INT256: 'INT256'>, <Type.INT: 'INT'>, <Type.SMALLMONEY: 'SMALLMONEY'>, <Type.UTINYINT: 'UTINYINT'>, <Type.UDECIMAL: 'UDECIMAL'>, <Type.MEDIUMINT: 'MEDIUMINT'>, <Type.MONEY: 'MONEY'>, <Type.DECIMAL: 'DECIMAL'>, <Type.UINT128: 'UINT128'>, <Type.UDOUBLE: 'UDOUBLE'>, <Type.FLOAT: 'FLOAT'>, <Type.INT128: 'INT128'>, <Type.TINYINT: 'TINYINT'>, <Type.UINT: 'UINT'>, <Type.UBIGINT: 'UBIGINT'>, <Type.DECIMAL256: 'DECIMAL256'>, <Type.DECIMAL32: 'DECIMAL32'>, <Type.DECIMAL128: 'DECIMAL128'>, <Type.DECIMAL64: 'DECIMAL64'>, <Type.BIGDECIMAL: 'BIGDECIMAL'>}</span>
|
<label class="view-value-button pdoc-button" for="DataType.NUMERIC_TYPES-view-value"></label><span class="default_value">{<Type.UINT: 'UINT'>, <Type.UBIGINT: 'UBIGINT'>, <Type.DECIMAL: 'DECIMAL'>, <Type.UMEDIUMINT: 'UMEDIUMINT'>, <Type.BIT: 'BIT'>, <Type.SMALLMONEY: 'SMALLMONEY'>, <Type.SMALLINT: 'SMALLINT'>, <Type.TINYINT: 'TINYINT'>, <Type.INT256: 'INT256'>, <Type.UINT128: 'UINT128'>, <Type.INT128: 'INT128'>, <Type.BIGINT: 'BIGINT'>, <Type.DECIMAL32: 'DECIMAL32'>, <Type.UINT256: 'UINT256'>, <Type.UDECIMAL: 'UDECIMAL'>, <Type.INT: 'INT'>, <Type.FLOAT: 'FLOAT'>, <Type.MONEY: 'MONEY'>, <Type.DECIMAL256: 'DECIMAL256'>, <Type.MEDIUMINT: 'MEDIUMINT'>, <Type.UTINYINT: 'UTINYINT'>, <Type.UDOUBLE: 'UDOUBLE'>, <Type.DECIMAL64: 'DECIMAL64'>, <Type.DECIMAL128: 'DECIMAL128'>, <Type.BIGDECIMAL: 'BIGDECIMAL'>, <Type.DOUBLE: 'DOUBLE'>, <Type.USMALLINT: 'USMALLINT'>}</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -62392,7 +62392,7 @@ Otherwise, this resets the expressions.</li>
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">TEMPORAL_TYPES</span> =
|
<span class="name">TEMPORAL_TYPES</span> =
|
||||||
<input id="DataType.TEMPORAL_TYPES-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
<input id="DataType.TEMPORAL_TYPES-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
||||||
<label class="view-value-button pdoc-button" for="DataType.TEMPORAL_TYPES-view-value"></label><span class="default_value">{<Type.TIMETZ: 'TIMETZ'>, <Type.TIMESTAMP: 'TIMESTAMP'>, <Type.DATE32: 'DATE32'>, <Type.DATETIME: 'DATETIME'>, <Type.SMALLDATETIME: 'SMALLDATETIME'>, <Type.TIME: 'TIME'>, <Type.TIMESTAMP_S: 'TIMESTAMP_S'>, <Type.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <Type.DATETIME2: 'DATETIME2'>, <Type.DATETIME64: 'DATETIME64'>, <Type.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <Type.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <Type.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <Type.DATE: 'DATE'>, <Type.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>}</span>
|
<label class="view-value-button pdoc-button" for="DataType.TEMPORAL_TYPES-view-value"></label><span class="default_value">{<Type.DATE32: 'DATE32'>, <Type.DATE: 'DATE'>, <Type.SMALLDATETIME: 'SMALLDATETIME'>, <Type.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <Type.TIMESTAMP: 'TIMESTAMP'>, <Type.TIME: 'TIME'>, <Type.TIMETZ: 'TIMETZ'>, <Type.DATETIME2: 'DATETIME2'>, <Type.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <Type.TIMESTAMP_S: 'TIMESTAMP_S'>, <Type.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <Type.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <Type.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <Type.DATETIME: 'DATETIME'>, <Type.DATETIME64: 'DATETIME64'>}</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -12211,7 +12211,7 @@ Default: True</li>
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">SUPPORTED_JSON_PATH_PARTS</span> =
|
<span class="name">SUPPORTED_JSON_PATH_PARTS</span> =
|
||||||
<input id="Generator.SUPPORTED_JSON_PATH_PARTS-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
<input id="Generator.SUPPORTED_JSON_PATH_PARTS-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
||||||
<label class="view-value-button pdoc-button" for="Generator.SUPPORTED_JSON_PATH_PARTS-view-value"></label><span class="default_value">{<class '<a href="expressions.html#JSONPathRoot">sqlglot.expressions.JSONPathRoot</a>'>, <class '<a href="expressions.html#JSONPathRecursive">sqlglot.expressions.JSONPathRecursive</a>'>, <class '<a href="expressions.html#JSONPathKey">sqlglot.expressions.JSONPathKey</a>'>, <class '<a href="expressions.html#JSONPathWildcard">sqlglot.expressions.JSONPathWildcard</a>'>, <class '<a href="expressions.html#JSONPathFilter">sqlglot.expressions.JSONPathFilter</a>'>, <class '<a href="expressions.html#JSONPathUnion">sqlglot.expressions.JSONPathUnion</a>'>, <class '<a href="expressions.html#JSONPathSubscript">sqlglot.expressions.JSONPathSubscript</a>'>, <class '<a href="expressions.html#JSONPathSelector">sqlglot.expressions.JSONPathSelector</a>'>, <class '<a href="expressions.html#JSONPathSlice">sqlglot.expressions.JSONPathSlice</a>'>, <class '<a href="expressions.html#JSONPathScript">sqlglot.expressions.JSONPathScript</a>'>}</span>
|
<label class="view-value-button pdoc-button" for="Generator.SUPPORTED_JSON_PATH_PARTS-view-value"></label><span class="default_value">{<class '<a href="expressions.html#JSONPathFilter">sqlglot.expressions.JSONPathFilter</a>'>, <class '<a href="expressions.html#JSONPathUnion">sqlglot.expressions.JSONPathUnion</a>'>, <class '<a href="expressions.html#JSONPathSubscript">sqlglot.expressions.JSONPathSubscript</a>'>, <class '<a href="expressions.html#JSONPathSelector">sqlglot.expressions.JSONPathSelector</a>'>, <class '<a href="expressions.html#JSONPathSlice">sqlglot.expressions.JSONPathSlice</a>'>, <class '<a href="expressions.html#JSONPathScript">sqlglot.expressions.JSONPathScript</a>'>, <class '<a href="expressions.html#JSONPathRoot">sqlglot.expressions.JSONPathRoot</a>'>, <class '<a href="expressions.html#JSONPathWildcard">sqlglot.expressions.JSONPathWildcard</a>'>, <class '<a href="expressions.html#JSONPathRecursive">sqlglot.expressions.JSONPathRecursive</a>'>, <class '<a href="expressions.html#JSONPathKey">sqlglot.expressions.JSONPathKey</a>'>}</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -12649,7 +12649,7 @@ Default: True</li>
|
||||||
<div id="Generator.PARAMETERIZABLE_TEXT_TYPES" class="classattr">
|
<div id="Generator.PARAMETERIZABLE_TEXT_TYPES" class="classattr">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">PARAMETERIZABLE_TEXT_TYPES</span> =
|
<span class="name">PARAMETERIZABLE_TEXT_TYPES</span> =
|
||||||
<span class="default_value">{<Type.NVARCHAR: 'NVARCHAR'>, <Type.CHAR: 'CHAR'>, <Type.NCHAR: 'NCHAR'>, <Type.VARCHAR: 'VARCHAR'>}</span>
|
<span class="default_value">{<Type.NVARCHAR: 'NVARCHAR'>, <Type.VARCHAR: 'VARCHAR'>, <Type.NCHAR: 'NCHAR'>, <Type.CHAR: 'CHAR'>}</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1926,7 +1926,7 @@ belong to some totally-ordered set.</p>
|
||||||
<section id="DATE_UNITS">
|
<section id="DATE_UNITS">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">DATE_UNITS</span> =
|
<span class="name">DATE_UNITS</span> =
|
||||||
<span class="default_value">{'day', 'month', 'year', 'week', 'quarter', 'year_month'}</span>
|
<span class="default_value">{'year', 'month', 'day', 'year_month', 'quarter', 'week'}</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -641,7 +641,7 @@
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">ALL_JSON_PATH_PARTS</span> =
|
<span class="name">ALL_JSON_PATH_PARTS</span> =
|
||||||
<input id="ALL_JSON_PATH_PARTS-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
<input id="ALL_JSON_PATH_PARTS-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
||||||
<label class="view-value-button pdoc-button" for="ALL_JSON_PATH_PARTS-view-value"></label><span class="default_value">{<class '<a href="expressions.html#JSONPathRoot">sqlglot.expressions.JSONPathRoot</a>'>, <class '<a href="expressions.html#JSONPathRecursive">sqlglot.expressions.JSONPathRecursive</a>'>, <class '<a href="expressions.html#JSONPathKey">sqlglot.expressions.JSONPathKey</a>'>, <class '<a href="expressions.html#JSONPathWildcard">sqlglot.expressions.JSONPathWildcard</a>'>, <class '<a href="expressions.html#JSONPathFilter">sqlglot.expressions.JSONPathFilter</a>'>, <class '<a href="expressions.html#JSONPathUnion">sqlglot.expressions.JSONPathUnion</a>'>, <class '<a href="expressions.html#JSONPathSubscript">sqlglot.expressions.JSONPathSubscript</a>'>, <class '<a href="expressions.html#JSONPathSelector">sqlglot.expressions.JSONPathSelector</a>'>, <class '<a href="expressions.html#JSONPathSlice">sqlglot.expressions.JSONPathSlice</a>'>, <class '<a href="expressions.html#JSONPathScript">sqlglot.expressions.JSONPathScript</a>'>}</span>
|
<label class="view-value-button pdoc-button" for="ALL_JSON_PATH_PARTS-view-value"></label><span class="default_value">{<class '<a href="expressions.html#JSONPathFilter">sqlglot.expressions.JSONPathFilter</a>'>, <class '<a href="expressions.html#JSONPathUnion">sqlglot.expressions.JSONPathUnion</a>'>, <class '<a href="expressions.html#JSONPathSubscript">sqlglot.expressions.JSONPathSubscript</a>'>, <class '<a href="expressions.html#JSONPathSelector">sqlglot.expressions.JSONPathSelector</a>'>, <class '<a href="expressions.html#JSONPathSlice">sqlglot.expressions.JSONPathSlice</a>'>, <class '<a href="expressions.html#JSONPathScript">sqlglot.expressions.JSONPathScript</a>'>, <class '<a href="expressions.html#JSONPathRoot">sqlglot.expressions.JSONPathRoot</a>'>, <class '<a href="expressions.html#JSONPathWildcard">sqlglot.expressions.JSONPathWildcard</a>'>, <class '<a href="expressions.html#JSONPathRecursive">sqlglot.expressions.JSONPathRecursive</a>'>, <class '<a href="expressions.html#JSONPathKey">sqlglot.expressions.JSONPathKey</a>'>}</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -580,7 +580,7 @@ queries if it would result in multiple table selects in a single query:</p>
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">UNMERGABLE_ARGS</span> =
|
<span class="name">UNMERGABLE_ARGS</span> =
|
||||||
<input id="UNMERGABLE_ARGS-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
<input id="UNMERGABLE_ARGS-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
||||||
<label class="view-value-button pdoc-button" for="UNMERGABLE_ARGS-view-value"></label><span class="default_value">{'into', 'limit', 'sample', 'with', 'distinct', 'laterals', 'group', 'distribute', 'cluster', 'kind', 'format', 'prewhere', 'having', 'qualify', 'match', 'connect', 'operation_modifiers', 'offset', 'options', 'locks', 'pivots', 'settings', 'sort', 'windows'}</span>
|
<label class="view-value-button pdoc-button" for="UNMERGABLE_ARGS-view-value"></label><span class="default_value">{'qualify', 'with', 'laterals', 'kind', 'windows', 'into', 'group', 'distinct', 'connect', 'pivots', 'locks', 'sample', 'match', 'operation_modifiers', 'having', 'options', 'format', 'distribute', 'settings', 'limit', 'sort', 'offset', 'cluster', 'prewhere'}</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3250,7 +3250,7 @@ prefix are statically known.</p>
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">DATETRUNC_COMPARISONS</span> =
|
<span class="name">DATETRUNC_COMPARISONS</span> =
|
||||||
<input id="DATETRUNC_COMPARISONS-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
<input id="DATETRUNC_COMPARISONS-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
||||||
<label class="view-value-button pdoc-button" for="DATETRUNC_COMPARISONS-view-value"></label><span class="default_value">{<class '<a href="../expressions.html#LTE">sqlglot.expressions.LTE</a>'>, <class '<a href="../expressions.html#In">sqlglot.expressions.In</a>'>, <class '<a href="../expressions.html#GTE">sqlglot.expressions.GTE</a>'>, <class '<a href="../expressions.html#EQ">sqlglot.expressions.EQ</a>'>, <class '<a href="../expressions.html#NEQ">sqlglot.expressions.NEQ</a>'>, <class '<a href="../expressions.html#GT">sqlglot.expressions.GT</a>'>, <class '<a href="../expressions.html#LT">sqlglot.expressions.LT</a>'>}</span>
|
<label class="view-value-button pdoc-button" for="DATETRUNC_COMPARISONS-view-value"></label><span class="default_value">{<class '<a href="../expressions.html#In">sqlglot.expressions.In</a>'>, <class '<a href="../expressions.html#GTE">sqlglot.expressions.GTE</a>'>, <class '<a href="../expressions.html#EQ">sqlglot.expressions.EQ</a>'>, <class '<a href="../expressions.html#LTE">sqlglot.expressions.LTE</a>'>, <class '<a href="../expressions.html#GT">sqlglot.expressions.GT</a>'>, <class '<a href="../expressions.html#LT">sqlglot.expressions.LT</a>'>, <class '<a href="../expressions.html#NEQ">sqlglot.expressions.NEQ</a>'>}</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -3334,7 +3334,7 @@ prefix are statically known.</p>
|
||||||
<section id="JOINS">
|
<section id="JOINS">
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">JOINS</span> =
|
<span class="name">JOINS</span> =
|
||||||
<span class="default_value">{('', ''), ('RIGHT', ''), ('RIGHT', 'OUTER'), ('', 'INNER')}</span>
|
<span class="default_value">{('RIGHT', ''), ('', 'INNER'), ('RIGHT', 'OUTER'), ('', '')}</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -9434,7 +9434,7 @@
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">TOKENS_PRECEDING_HINT</span> =
|
<span class="name">TOKENS_PRECEDING_HINT</span> =
|
||||||
<input id="Tokenizer.TOKENS_PRECEDING_HINT-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
<input id="Tokenizer.TOKENS_PRECEDING_HINT-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
||||||
<label class="view-value-button pdoc-button" for="Tokenizer.TOKENS_PRECEDING_HINT-view-value"></label><span class="default_value">{<<a href="#TokenType.INSERT">TokenType.INSERT</a>: 'INSERT'>, <<a href="#TokenType.SELECT">TokenType.SELECT</a>: 'SELECT'>, <<a href="#TokenType.DELETE">TokenType.DELETE</a>: 'DELETE'>, <<a href="#TokenType.UPDATE">TokenType.UPDATE</a>: 'UPDATE'>}</span>
|
<label class="view-value-button pdoc-button" for="Tokenizer.TOKENS_PRECEDING_HINT-view-value"></label><span class="default_value">{<<a href="#TokenType.SELECT">TokenType.SELECT</a>: 'SELECT'>, <<a href="#TokenType.UPDATE">TokenType.UPDATE</a>: 'UPDATE'>, <<a href="#TokenType.DELETE">TokenType.DELETE</a>: 'DELETE'>, <<a href="#TokenType.INSERT">TokenType.INSERT</a>: 'INSERT'>}</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -9473,7 +9473,7 @@
|
||||||
<div class="attr variable">
|
<div class="attr variable">
|
||||||
<span class="name">COMMANDS</span> =
|
<span class="name">COMMANDS</span> =
|
||||||
<input id="Tokenizer.COMMANDS-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
<input id="Tokenizer.COMMANDS-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
|
||||||
<label class="view-value-button pdoc-button" for="Tokenizer.COMMANDS-view-value"></label><span class="default_value">{<<a href="#TokenType.EXECUTE">TokenType.EXECUTE</a>: 'EXECUTE'>, <<a href="#TokenType.SHOW">TokenType.SHOW</a>: 'SHOW'>, <<a href="#TokenType.FETCH">TokenType.FETCH</a>: 'FETCH'>, <<a href="#TokenType.RENAME">TokenType.RENAME</a>: 'RENAME'>, <<a href="#TokenType.COMMAND">TokenType.COMMAND</a>: 'COMMAND'>}</span>
|
<label class="view-value-button pdoc-button" for="Tokenizer.COMMANDS-view-value"></label><span class="default_value">{<<a href="#TokenType.EXECUTE">TokenType.EXECUTE</a>: 'EXECUTE'>, <<a href="#TokenType.SHOW">TokenType.SHOW</a>: 'SHOW'>, <<a href="#TokenType.COMMAND">TokenType.COMMAND</a>: 'COMMAND'>, <<a href="#TokenType.FETCH">TokenType.FETCH</a>: 'FETCH'>, <<a href="#TokenType.RENAME">TokenType.RENAME</a>: 'RENAME'>}</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -610,6 +610,8 @@ class Hive(Dialect):
|
||||||
e: f"({self.expressions(e, 'this', indent=False)})",
|
e: f"({self.expressions(e, 'this', indent=False)})",
|
||||||
exp.NotForReplicationColumnConstraint: lambda *_: "",
|
exp.NotForReplicationColumnConstraint: lambda *_: "",
|
||||||
exp.OnProperty: lambda *_: "",
|
exp.OnProperty: lambda *_: "",
|
||||||
|
exp.PartitionedByBucket: lambda self, e: self.func("BUCKET", e.expression, e.this),
|
||||||
|
exp.PartitionByTruncate: lambda self, e: self.func("TRUNCATE", e.expression, e.this),
|
||||||
exp.PrimaryKeyColumnConstraint: lambda *_: "PRIMARY KEY",
|
exp.PrimaryKeyColumnConstraint: lambda *_: "PRIMARY KEY",
|
||||||
exp.WeekOfYear: rename_func("WEEKOFYEAR"),
|
exp.WeekOfYear: rename_func("WEEKOFYEAR"),
|
||||||
exp.DayOfMonth: rename_func("DAYOFMONTH"),
|
exp.DayOfMonth: rename_func("DAYOFMONTH"),
|
||||||
|
|
|
@ -586,7 +586,6 @@ class Postgres(Dialect):
|
||||||
[transforms.add_within_group_for_percentiles]
|
[transforms.add_within_group_for_percentiles]
|
||||||
),
|
),
|
||||||
exp.Pivot: no_pivot_sql,
|
exp.Pivot: no_pivot_sql,
|
||||||
exp.Pow: lambda self, e: self.binary(e, "^"),
|
|
||||||
exp.Rand: rename_func("RANDOM"),
|
exp.Rand: rename_func("RANDOM"),
|
||||||
exp.RegexpLike: lambda self, e: self.binary(e, "~"),
|
exp.RegexpLike: lambda self, e: self.binary(e, "~"),
|
||||||
exp.RegexpILike: lambda self, e: self.binary(e, "~*"),
|
exp.RegexpILike: lambda self, e: self.binary(e, "~*"),
|
||||||
|
|
|
@ -57,8 +57,12 @@ def _no_sort_array(self: Presto.Generator, expression: exp.SortArray) -> str:
|
||||||
|
|
||||||
def _schema_sql(self: Presto.Generator, expression: exp.Schema) -> str:
|
def _schema_sql(self: Presto.Generator, expression: exp.Schema) -> str:
|
||||||
if isinstance(expression.parent, exp.PartitionedByProperty):
|
if isinstance(expression.parent, exp.PartitionedByProperty):
|
||||||
columns = ", ".join(f"'{c.name}'" for c in expression.expressions)
|
partition_exprs = [
|
||||||
return f"ARRAY[{columns}]"
|
self.sql(c) if isinstance(c, (exp.Func, exp.Property)) else self.sql(c, "this")
|
||||||
|
for c in expression.expressions
|
||||||
|
]
|
||||||
|
|
||||||
|
return self.sql(exp.Array(expressions=[exp.Literal.string(c) for c in partition_exprs]))
|
||||||
|
|
||||||
if expression.parent:
|
if expression.parent:
|
||||||
for schema in expression.parent.find_all(exp.Schema):
|
for schema in expression.parent.find_all(exp.Schema):
|
||||||
|
|
|
@ -221,9 +221,6 @@ class Redshift(Postgres):
|
||||||
# Postgres doesn't support JSON_PARSE, but Redshift does
|
# Postgres doesn't support JSON_PARSE, but Redshift does
|
||||||
TRANSFORMS.pop(exp.ParseJSON)
|
TRANSFORMS.pop(exp.ParseJSON)
|
||||||
|
|
||||||
# Redshift uses the POW | POWER (expr1, expr2) syntax instead of expr1 ^ expr2 (postgres)
|
|
||||||
TRANSFORMS.pop(exp.Pow)
|
|
||||||
|
|
||||||
# Redshift supports these functions
|
# Redshift supports these functions
|
||||||
TRANSFORMS.pop(exp.AnyValue)
|
TRANSFORMS.pop(exp.AnyValue)
|
||||||
TRANSFORMS.pop(exp.LastDay)
|
TRANSFORMS.pop(exp.LastDay)
|
||||||
|
|
|
@ -1933,7 +1933,7 @@ class TransformColumnConstraint(ColumnConstraintKind):
|
||||||
|
|
||||||
|
|
||||||
class PrimaryKeyColumnConstraint(ColumnConstraintKind):
|
class PrimaryKeyColumnConstraint(ColumnConstraintKind):
|
||||||
arg_types = {"desc": False}
|
arg_types = {"desc": False, "options": False}
|
||||||
|
|
||||||
|
|
||||||
class TitleColumnConstraint(ColumnConstraintKind):
|
class TitleColumnConstraint(ColumnConstraintKind):
|
||||||
|
@ -1941,7 +1941,13 @@ class TitleColumnConstraint(ColumnConstraintKind):
|
||||||
|
|
||||||
|
|
||||||
class UniqueColumnConstraint(ColumnConstraintKind):
|
class UniqueColumnConstraint(ColumnConstraintKind):
|
||||||
arg_types = {"this": False, "index_type": False, "on_conflict": False, "nulls": False}
|
arg_types = {
|
||||||
|
"this": False,
|
||||||
|
"index_type": False,
|
||||||
|
"on_conflict": False,
|
||||||
|
"nulls": False,
|
||||||
|
"options": False,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class UppercaseColumnConstraint(ColumnConstraintKind):
|
class UppercaseColumnConstraint(ColumnConstraintKind):
|
||||||
|
@ -2140,6 +2146,7 @@ class ForeignKey(Expression):
|
||||||
"reference": False,
|
"reference": False,
|
||||||
"delete": False,
|
"delete": False,
|
||||||
"update": False,
|
"update": False,
|
||||||
|
"options": False,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2917,6 +2924,14 @@ class PartitionedByProperty(Property):
|
||||||
arg_types = {"this": True}
|
arg_types = {"this": True}
|
||||||
|
|
||||||
|
|
||||||
|
class PartitionedByBucket(Property):
|
||||||
|
arg_types = {"this": True, "expression": True}
|
||||||
|
|
||||||
|
|
||||||
|
class PartitionByTruncate(Property):
|
||||||
|
arg_types = {"this": True, "expression": True}
|
||||||
|
|
||||||
|
|
||||||
# https://docs.starrocks.io/docs/sql-reference/sql-statements/table_bucket_part_index/CREATE_TABLE/
|
# https://docs.starrocks.io/docs/sql-reference/sql-statements/table_bucket_part_index/CREATE_TABLE/
|
||||||
class PartitionByRangeProperty(Property):
|
class PartitionByRangeProperty(Property):
|
||||||
arg_types = {"partition_expressions": True, "create_expressions": True}
|
arg_types = {"partition_expressions": True, "create_expressions": True}
|
||||||
|
|
|
@ -170,6 +170,8 @@ class Generator(metaclass=_Generator):
|
||||||
exp.Operator: lambda self, e: self.binary(e, ""), # The operator is produced in `binary`
|
exp.Operator: lambda self, e: self.binary(e, ""), # The operator is produced in `binary`
|
||||||
exp.OutputModelProperty: lambda self, e: f"OUTPUT{self.sql(e, 'this')}",
|
exp.OutputModelProperty: lambda self, e: f"OUTPUT{self.sql(e, 'this')}",
|
||||||
exp.PathColumnConstraint: lambda self, e: f"PATH {self.sql(e, 'this')}",
|
exp.PathColumnConstraint: lambda self, e: f"PATH {self.sql(e, 'this')}",
|
||||||
|
exp.PartitionedByBucket: lambda self, e: self.func("BUCKET", e.this, e.expression),
|
||||||
|
exp.PartitionByTruncate: lambda self, e: self.func("TRUNCATE", e.this, e.expression),
|
||||||
exp.PivotAny: lambda self, e: f"ANY{self.sql(e, 'this')}",
|
exp.PivotAny: lambda self, e: f"ANY{self.sql(e, 'this')}",
|
||||||
exp.ProjectionPolicyColumnConstraint: lambda self,
|
exp.ProjectionPolicyColumnConstraint: lambda self,
|
||||||
e: f"PROJECTION POLICY {self.sql(e, 'this')}",
|
e: f"PROJECTION POLICY {self.sql(e, 'this')}",
|
||||||
|
@ -1064,7 +1066,9 @@ class Generator(metaclass=_Generator):
|
||||||
desc = expression.args.get("desc")
|
desc = expression.args.get("desc")
|
||||||
if desc is not None:
|
if desc is not None:
|
||||||
return f"PRIMARY KEY{' DESC' if desc else ' ASC'}"
|
return f"PRIMARY KEY{' DESC' if desc else ' ASC'}"
|
||||||
return "PRIMARY KEY"
|
options = self.expressions(expression, key="options", flat=True, sep=" ")
|
||||||
|
options = f" {options}" if options else ""
|
||||||
|
return f"PRIMARY KEY{options}"
|
||||||
|
|
||||||
def uniquecolumnconstraint_sql(self, expression: exp.UniqueColumnConstraint) -> str:
|
def uniquecolumnconstraint_sql(self, expression: exp.UniqueColumnConstraint) -> str:
|
||||||
this = self.sql(expression, "this")
|
this = self.sql(expression, "this")
|
||||||
|
@ -1074,7 +1078,9 @@ class Generator(metaclass=_Generator):
|
||||||
on_conflict = self.sql(expression, "on_conflict")
|
on_conflict = self.sql(expression, "on_conflict")
|
||||||
on_conflict = f" {on_conflict}" if on_conflict else ""
|
on_conflict = f" {on_conflict}" if on_conflict else ""
|
||||||
nulls_sql = " NULLS NOT DISTINCT" if expression.args.get("nulls") else ""
|
nulls_sql = " NULLS NOT DISTINCT" if expression.args.get("nulls") else ""
|
||||||
return f"UNIQUE{nulls_sql}{this}{index_type}{on_conflict}"
|
options = self.expressions(expression, key="options", flat=True, sep=" ")
|
||||||
|
options = f" {options}" if options else ""
|
||||||
|
return f"UNIQUE{nulls_sql}{this}{index_type}{on_conflict}{options}"
|
||||||
|
|
||||||
def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
|
def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
|
||||||
return self.sql(expression, "this")
|
return self.sql(expression, "this")
|
||||||
|
@ -2919,7 +2925,9 @@ class Generator(metaclass=_Generator):
|
||||||
delete = f" ON DELETE {delete}" if delete else ""
|
delete = f" ON DELETE {delete}" if delete else ""
|
||||||
update = self.sql(expression, "update")
|
update = self.sql(expression, "update")
|
||||||
update = f" ON UPDATE {update}" if update else ""
|
update = f" ON UPDATE {update}" if update else ""
|
||||||
return f"FOREIGN KEY{expressions}{reference}{delete}{update}"
|
options = self.expressions(expression, key="options", flat=True, sep=" ")
|
||||||
|
options = f" {options}" if options else ""
|
||||||
|
return f"FOREIGN KEY{expressions}{reference}{delete}{update}{options}"
|
||||||
|
|
||||||
def primarykey_sql(self, expression: exp.ForeignKey) -> str:
|
def primarykey_sql(self, expression: exp.ForeignKey) -> str:
|
||||||
expressions = self.expressions(expression, flat=True)
|
expressions = self.expressions(expression, flat=True)
|
||||||
|
|
|
@ -93,15 +93,18 @@ def remove_redundant_casts(expression: exp.Expression) -> exp.Expression:
|
||||||
if (
|
if (
|
||||||
isinstance(expression, exp.Cast)
|
isinstance(expression, exp.Cast)
|
||||||
and expression.this.type
|
and expression.this.type
|
||||||
and expression.to.this == expression.this.type.this
|
and expression.to == expression.this.type
|
||||||
):
|
):
|
||||||
return expression.this
|
return expression.this
|
||||||
|
|
||||||
if (
|
if (
|
||||||
isinstance(expression, (exp.Date, exp.TsOrDsToDate))
|
isinstance(expression, (exp.Date, exp.TsOrDsToDate))
|
||||||
and expression.this.type
|
and expression.this.type
|
||||||
and expression.this.type.this == exp.DataType.Type.DATE
|
and expression.this.type.this == exp.DataType.Type.DATE
|
||||||
|
and not expression.this.type.expressions
|
||||||
):
|
):
|
||||||
return expression.this
|
return expression.this
|
||||||
|
|
||||||
return expression
|
return expression
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ def unnest(select, parent_select, next_alias_name):
|
||||||
.from_(select.subquery("_q", copy=False), copy=False)
|
.from_(select.subquery("_q", copy=False), copy=False)
|
||||||
.group_by(exp.column(value.alias, "_q"), copy=False)
|
.group_by(exp.column(value.alias, "_q"), copy=False)
|
||||||
)
|
)
|
||||||
else:
|
elif not find_in_scope(value.this, exp.AggFunc):
|
||||||
select = select.group_by(value.this, copy=False)
|
select = select.group_by(value.this, copy=False)
|
||||||
|
|
||||||
parent_select.join(
|
parent_select.join(
|
||||||
|
|
|
@ -218,7 +218,7 @@ class Parser(metaclass=_Parser):
|
||||||
"GENERATE_DATE_ARRAY": lambda args: exp.GenerateDateArray(
|
"GENERATE_DATE_ARRAY": lambda args: exp.GenerateDateArray(
|
||||||
start=seq_get(args, 0),
|
start=seq_get(args, 0),
|
||||||
end=seq_get(args, 1),
|
end=seq_get(args, 1),
|
||||||
step=seq_get(args, 2) or exp.Interval(this=exp.Literal.number(1), unit=exp.var("DAY")),
|
step=seq_get(args, 2) or exp.Interval(this=exp.Literal.string(1), unit=exp.var("DAY")),
|
||||||
),
|
),
|
||||||
"GLOB": lambda args: exp.Glob(this=seq_get(args, 1), expression=seq_get(args, 0)),
|
"GLOB": lambda args: exp.Glob(this=seq_get(args, 1), expression=seq_get(args, 0)),
|
||||||
"HEX": build_hex,
|
"HEX": build_hex,
|
||||||
|
@ -1100,8 +1100,32 @@ class Parser(metaclass=_Parser):
|
||||||
"WITH": lambda self: self.expression(
|
"WITH": lambda self: self.expression(
|
||||||
exp.Properties, expressions=self._parse_wrapped_properties()
|
exp.Properties, expressions=self._parse_wrapped_properties()
|
||||||
),
|
),
|
||||||
|
"BUCKET": lambda self: self._parse_partitioned_by_bucket_or_truncate(),
|
||||||
|
"TRUNCATE": lambda self: self._parse_partitioned_by_bucket_or_truncate(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def _parse_partitioned_by_bucket_or_truncate(self) -> exp.Expression:
|
||||||
|
klass = (
|
||||||
|
exp.PartitionedByBucket
|
||||||
|
if self._prev.text.upper() == "BUCKET"
|
||||||
|
else exp.PartitionByTruncate
|
||||||
|
)
|
||||||
|
|
||||||
|
args = self._parse_wrapped_csv(lambda: self._parse_primary() or self._parse_column())
|
||||||
|
this, expression = seq_get(args, 0), seq_get(args, 1)
|
||||||
|
|
||||||
|
if isinstance(this, exp.Literal):
|
||||||
|
# Check for Iceberg partition transforms (bucket / truncate) and ensure their arguments are in the right order
|
||||||
|
# - For Hive, it's `bucket(<num buckets>, <col name>)` or `truncate(<num_chars>, <col_name>)`
|
||||||
|
# - For Trino, it's reversed - `bucket(<col name>, <num buckets>)` or `truncate(<col_name>, <num_chars>)`
|
||||||
|
# Both variants are canonicalized in the latter i.e `bucket(<col name>, <num buckets>)`
|
||||||
|
#
|
||||||
|
# Hive ref: https://docs.aws.amazon.com/athena/latest/ug/querying-iceberg-creating-tables.html#querying-iceberg-partitioning
|
||||||
|
# Trino ref: https://docs.aws.amazon.com/athena/latest/ug/create-table-as.html#ctas-table-properties
|
||||||
|
this, expression = expression, this
|
||||||
|
|
||||||
|
return self.expression(klass, this=this, expression=expression)
|
||||||
|
|
||||||
ALTER_PARSERS = {
|
ALTER_PARSERS = {
|
||||||
"ADD": lambda self: self._parse_alter_table_add(),
|
"ADD": lambda self: self._parse_alter_table_add(),
|
||||||
"AS": lambda self: self._parse_select(),
|
"AS": lambda self: self._parse_select(),
|
||||||
|
@ -1132,6 +1156,8 @@ class Parser(metaclass=_Parser):
|
||||||
"PRIMARY KEY",
|
"PRIMARY KEY",
|
||||||
"UNIQUE",
|
"UNIQUE",
|
||||||
"WATERMARK",
|
"WATERMARK",
|
||||||
|
"BUCKET",
|
||||||
|
"TRUNCATE",
|
||||||
}
|
}
|
||||||
|
|
||||||
NO_PAREN_FUNCTION_PARSERS = {
|
NO_PAREN_FUNCTION_PARSERS = {
|
||||||
|
@ -1300,7 +1326,7 @@ class Parser(metaclass=_Parser):
|
||||||
"BTREE",
|
"BTREE",
|
||||||
"HASH",
|
"HASH",
|
||||||
),
|
),
|
||||||
**dict.fromkeys(("DEFERRABLE", "NORELY"), tuple()),
|
**dict.fromkeys(("DEFERRABLE", "NORELY", "RELY"), tuple()),
|
||||||
}
|
}
|
||||||
|
|
||||||
INSERT_ALTERNATIVES = {"ABORT", "FAIL", "IGNORE", "REPLACE", "ROLLBACK"}
|
INSERT_ALTERNATIVES = {"ABORT", "FAIL", "IGNORE", "REPLACE", "ROLLBACK"}
|
||||||
|
@ -1338,7 +1364,7 @@ class Parser(metaclass=_Parser):
|
||||||
|
|
||||||
NULL_TOKENS = {TokenType.NULL}
|
NULL_TOKENS = {TokenType.NULL}
|
||||||
|
|
||||||
UNNEST_OFFSET_ALIAS_TOKENS = ID_VAR_TOKENS - SET_OPERATIONS
|
UNNEST_OFFSET_ALIAS_TOKENS = TABLE_ALIAS_TOKENS - SET_OPERATIONS
|
||||||
|
|
||||||
SELECT_START_TOKENS = {TokenType.L_PAREN, TokenType.WITH, TokenType.SELECT}
|
SELECT_START_TOKENS = {TokenType.L_PAREN, TokenType.WITH, TokenType.SELECT}
|
||||||
|
|
||||||
|
@ -5989,6 +6015,7 @@ class Parser(metaclass=_Parser):
|
||||||
this=self._parse_schema(self._parse_unique_key()),
|
this=self._parse_schema(self._parse_unique_key()),
|
||||||
index_type=self._match(TokenType.USING) and self._advance_any() and self._prev.text,
|
index_type=self._match(TokenType.USING) and self._advance_any() and self._prev.text,
|
||||||
on_conflict=self._parse_on_conflict(),
|
on_conflict=self._parse_on_conflict(),
|
||||||
|
options=self._parse_key_constraint_options(),
|
||||||
)
|
)
|
||||||
|
|
||||||
def _parse_key_constraint_options(self) -> t.List[str]:
|
def _parse_key_constraint_options(self) -> t.List[str]:
|
||||||
|
@ -6037,7 +6064,7 @@ class Parser(metaclass=_Parser):
|
||||||
def _parse_foreign_key(self) -> exp.ForeignKey:
|
def _parse_foreign_key(self) -> exp.ForeignKey:
|
||||||
expressions = self._parse_wrapped_id_vars()
|
expressions = self._parse_wrapped_id_vars()
|
||||||
reference = self._parse_references()
|
reference = self._parse_references()
|
||||||
options = {}
|
on_options = {}
|
||||||
|
|
||||||
while self._match(TokenType.ON):
|
while self._match(TokenType.ON):
|
||||||
if not self._match_set((TokenType.DELETE, TokenType.UPDATE)):
|
if not self._match_set((TokenType.DELETE, TokenType.UPDATE)):
|
||||||
|
@ -6054,13 +6081,14 @@ class Parser(metaclass=_Parser):
|
||||||
self._advance()
|
self._advance()
|
||||||
action = self._prev.text.upper()
|
action = self._prev.text.upper()
|
||||||
|
|
||||||
options[kind] = action
|
on_options[kind] = action
|
||||||
|
|
||||||
return self.expression(
|
return self.expression(
|
||||||
exp.ForeignKey,
|
exp.ForeignKey,
|
||||||
expressions=expressions,
|
expressions=expressions,
|
||||||
reference=reference,
|
reference=reference,
|
||||||
**options, # type: ignore
|
options=self._parse_key_constraint_options(),
|
||||||
|
**on_options, # type: ignore
|
||||||
)
|
)
|
||||||
|
|
||||||
def _parse_primary_key_part(self) -> t.Optional[exp.Expression]:
|
def _parse_primary_key_part(self) -> t.Optional[exp.Expression]:
|
||||||
|
@ -6087,7 +6115,11 @@ class Parser(metaclass=_Parser):
|
||||||
)
|
)
|
||||||
|
|
||||||
if not in_props and not self._match(TokenType.L_PAREN, advance=False):
|
if not in_props and not self._match(TokenType.L_PAREN, advance=False):
|
||||||
return self.expression(exp.PrimaryKeyColumnConstraint, desc=desc)
|
return self.expression(
|
||||||
|
exp.PrimaryKeyColumnConstraint,
|
||||||
|
desc=desc,
|
||||||
|
options=self._parse_key_constraint_options(),
|
||||||
|
)
|
||||||
|
|
||||||
expressions = self._parse_wrapped_csv(
|
expressions = self._parse_wrapped_csv(
|
||||||
self._parse_primary_key_part, optional=wrapped_optional
|
self._parse_primary_key_part, optional=wrapped_optional
|
||||||
|
|
|
@ -202,6 +202,67 @@ class TestAthena(Validator):
|
||||||
identify=True,
|
identify=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_create_table(self):
|
||||||
|
# There are two CREATE TABLE syntaxes
|
||||||
|
# Both hit Athena's Hive engine but creating an Iceberg table is different from creating a normal Hive table
|
||||||
|
|
||||||
|
table_schema = exp.Schema(
|
||||||
|
this=exp.to_table("foo.bar"),
|
||||||
|
expressions=[
|
||||||
|
exp.ColumnDef(this=exp.to_identifier("a"), kind=exp.DataType.build("int")),
|
||||||
|
exp.ColumnDef(this=exp.to_identifier("b"), kind=exp.DataType.build("varchar")),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
# Hive tables - CREATE EXTERNAL TABLE
|
||||||
|
ct_hive = exp.Create(
|
||||||
|
this=table_schema,
|
||||||
|
kind="TABLE",
|
||||||
|
properties=exp.Properties(
|
||||||
|
expressions=[
|
||||||
|
exp.ExternalProperty(),
|
||||||
|
exp.FileFormatProperty(this=exp.Literal.string("parquet")),
|
||||||
|
exp.LocationProperty(this=exp.Literal.string("s3://foo")),
|
||||||
|
exp.PartitionedByProperty(
|
||||||
|
this=exp.Schema(expressions=[exp.to_column("partition_col")])
|
||||||
|
),
|
||||||
|
]
|
||||||
|
),
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
ct_hive.sql(dialect=self.dialect, identify=True),
|
||||||
|
"CREATE EXTERNAL TABLE `foo`.`bar` (`a` INT, `b` STRING) STORED AS PARQUET LOCATION 's3://foo' PARTITIONED BY (`partition_col`)",
|
||||||
|
)
|
||||||
|
|
||||||
|
# Iceberg tables - CREATE TABLE... TBLPROPERTIES ('table_type'='iceberg')
|
||||||
|
# no EXTERNAL keyword and the 'table_type=iceberg' property must be set
|
||||||
|
# ref: https://docs.aws.amazon.com/athena/latest/ug/querying-iceberg-creating-tables.html#querying-iceberg-partitioning
|
||||||
|
ct_iceberg = exp.Create(
|
||||||
|
this=table_schema,
|
||||||
|
kind="TABLE",
|
||||||
|
properties=exp.Properties(
|
||||||
|
expressions=[
|
||||||
|
exp.FileFormatProperty(this=exp.Literal.string("parquet")),
|
||||||
|
exp.LocationProperty(this=exp.Literal.string("s3://foo")),
|
||||||
|
exp.PartitionedByProperty(
|
||||||
|
this=exp.Schema(
|
||||||
|
expressions=[
|
||||||
|
exp.to_column("partition_col"),
|
||||||
|
exp.PartitionedByBucket(
|
||||||
|
this=exp.to_column("a"), expression=exp.Literal.number(4)
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
),
|
||||||
|
exp.Property(this=exp.var("table_type"), value=exp.Literal.string("iceberg")),
|
||||||
|
]
|
||||||
|
),
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
ct_iceberg.sql(dialect=self.dialect, identify=True),
|
||||||
|
"CREATE TABLE `foo`.`bar` (`a` INT, `b` STRING) STORED AS PARQUET LOCATION 's3://foo' PARTITIONED BY (`partition_col`, BUCKET(4, `a`)) TBLPROPERTIES ('table_type'='iceberg')",
|
||||||
|
)
|
||||||
|
|
||||||
def test_ctas(self):
|
def test_ctas(self):
|
||||||
# Hive tables use 'external_location' to specify the table location, Iceberg tables use 'location' to specify the table location
|
# Hive tables use 'external_location' to specify the table location, Iceberg tables use 'location' to specify the table location
|
||||||
# In addition, Hive tables used 'partitioned_by' to specify the partition fields and Iceberg tables use 'partitioning' to specify the partition fields
|
# In addition, Hive tables used 'partitioned_by' to specify the partition fields and Iceberg tables use 'partitioning' to specify the partition fields
|
||||||
|
@ -223,7 +284,11 @@ class TestAthena(Validator):
|
||||||
)
|
)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
ctas_hive.sql(dialect=self.dialect, identify=True),
|
ctas_hive.sql(dialect=self.dialect, identify=True),
|
||||||
"CREATE TABLE \"foo\".\"bar\" WITH (format='parquet', external_location='s3://foo', partitioned_by=ARRAY['partition_col']) AS SELECT 1",
|
"CREATE TABLE \"foo\".\"bar\" WITH (format='parquet', external_location='s3://foo', partitioned_by=ARRAY['\"partition_col\"']) AS SELECT 1",
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
ctas_hive.sql(dialect=self.dialect, identify=False),
|
||||||
|
"CREATE TABLE foo.bar WITH (format='parquet', external_location='s3://foo', partitioned_by=ARRAY['partition_col']) AS SELECT 1",
|
||||||
)
|
)
|
||||||
|
|
||||||
ctas_iceberg = exp.Create(
|
ctas_iceberg = exp.Create(
|
||||||
|
@ -234,7 +299,14 @@ class TestAthena(Validator):
|
||||||
exp.Property(this=exp.var("table_type"), value=exp.Literal.string("iceberg")),
|
exp.Property(this=exp.var("table_type"), value=exp.Literal.string("iceberg")),
|
||||||
exp.LocationProperty(this=exp.Literal.string("s3://foo")),
|
exp.LocationProperty(this=exp.Literal.string("s3://foo")),
|
||||||
exp.PartitionedByProperty(
|
exp.PartitionedByProperty(
|
||||||
this=exp.Schema(expressions=[exp.to_column("partition_col")])
|
this=exp.Schema(
|
||||||
|
expressions=[
|
||||||
|
exp.to_column("partition_col"),
|
||||||
|
exp.PartitionedByBucket(
|
||||||
|
this=exp.to_column("a"), expression=exp.Literal.number(4)
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
|
@ -242,5 +314,9 @@ class TestAthena(Validator):
|
||||||
)
|
)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
ctas_iceberg.sql(dialect=self.dialect, identify=True),
|
ctas_iceberg.sql(dialect=self.dialect, identify=True),
|
||||||
"CREATE TABLE \"foo\".\"bar\" WITH (table_type='iceberg', location='s3://foo', partitioning=ARRAY['partition_col']) AS SELECT 1",
|
"CREATE TABLE \"foo\".\"bar\" WITH (table_type='iceberg', location='s3://foo', partitioning=ARRAY['\"partition_col\"', 'BUCKET(\"a\", 4)']) AS SELECT 1",
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
ctas_iceberg.sql(dialect=self.dialect, identify=False),
|
||||||
|
"CREATE TABLE foo.bar WITH (table_type='iceberg', location='s3://foo', partitioning=ARRAY['partition_col', 'BUCKET(a, 4)']) AS SELECT 1",
|
||||||
)
|
)
|
||||||
|
|
|
@ -308,10 +308,6 @@ LANGUAGE js AS
|
||||||
"""SELECT JSON '"foo"' AS json_data""",
|
"""SELECT JSON '"foo"' AS json_data""",
|
||||||
"""SELECT PARSE_JSON('"foo"') AS json_data""",
|
"""SELECT PARSE_JSON('"foo"') AS json_data""",
|
||||||
)
|
)
|
||||||
self.validate_identity(
|
|
||||||
"SELECT * FROM UNNEST(x) WITH OFFSET EXCEPT DISTINCT SELECT * FROM UNNEST(y) WITH OFFSET",
|
|
||||||
"SELECT * FROM UNNEST(x) WITH OFFSET AS offset EXCEPT DISTINCT SELECT * FROM UNNEST(y) WITH OFFSET AS offset",
|
|
||||||
)
|
|
||||||
self.validate_identity(
|
self.validate_identity(
|
||||||
"SELECT * FROM (SELECT a, b, c FROM test) PIVOT(SUM(b) d, COUNT(*) e FOR c IN ('x', 'y'))",
|
"SELECT * FROM (SELECT a, b, c FROM test) PIVOT(SUM(b) d, COUNT(*) e FOR c IN ('x', 'y'))",
|
||||||
"SELECT * FROM (SELECT a, b, c FROM test) PIVOT(SUM(b) AS d, COUNT(*) AS e FOR c IN ('x', 'y'))",
|
"SELECT * FROM (SELECT a, b, c FROM test) PIVOT(SUM(b) AS d, COUNT(*) AS e FOR c IN ('x', 'y'))",
|
||||||
|
@ -1519,8 +1515,8 @@ WHERE
|
||||||
self.validate_all(
|
self.validate_all(
|
||||||
"SELECT GENERATE_DATE_ARRAY('2016-10-05', '2016-10-08')",
|
"SELECT GENERATE_DATE_ARRAY('2016-10-05', '2016-10-08')",
|
||||||
write={
|
write={
|
||||||
"duckdb": "SELECT CAST(GENERATE_SERIES(CAST('2016-10-05' AS DATE), CAST('2016-10-08' AS DATE), INTERVAL 1 DAY) AS DATE[])",
|
"duckdb": "SELECT CAST(GENERATE_SERIES(CAST('2016-10-05' AS DATE), CAST('2016-10-08' AS DATE), INTERVAL '1' DAY) AS DATE[])",
|
||||||
"bigquery": "SELECT GENERATE_DATE_ARRAY('2016-10-05', '2016-10-08', INTERVAL 1 DAY)",
|
"bigquery": "SELECT GENERATE_DATE_ARRAY('2016-10-05', '2016-10-08', INTERVAL '1' DAY)",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
self.validate_all(
|
self.validate_all(
|
||||||
|
@ -2424,3 +2420,16 @@ OPTIONS (
|
||||||
"SELECT 1 AS x UNION ALL STRICT CORRESPONDING BY (foo, bar) SELECT 2 AS x",
|
"SELECT 1 AS x UNION ALL STRICT CORRESPONDING BY (foo, bar) SELECT 2 AS x",
|
||||||
"SELECT 1 AS x UNION ALL BY NAME ON (foo, bar) SELECT 2 AS x",
|
"SELECT 1 AS x UNION ALL BY NAME ON (foo, bar) SELECT 2 AS x",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_with_offset(self):
|
||||||
|
self.validate_identity(
|
||||||
|
"SELECT * FROM UNNEST(x) WITH OFFSET EXCEPT DISTINCT SELECT * FROM UNNEST(y) WITH OFFSET",
|
||||||
|
"SELECT * FROM UNNEST(x) WITH OFFSET AS offset EXCEPT DISTINCT SELECT * FROM UNNEST(y) WITH OFFSET AS offset",
|
||||||
|
)
|
||||||
|
|
||||||
|
for join_ops in ("LEFT", "RIGHT", "FULL", "NATURAL", "SEMI", "ANTI"):
|
||||||
|
with self.subTest(f"Testing {join_ops} in test_with_offset"):
|
||||||
|
self.validate_identity(
|
||||||
|
f"SELECT * FROM t1, UNNEST([1, 2]) AS hit WITH OFFSET {join_ops} JOIN foo",
|
||||||
|
f"SELECT * FROM t1, UNNEST([1, 2]) AS hit WITH OFFSET AS offset {join_ops} JOIN foo",
|
||||||
|
)
|
||||||
|
|
|
@ -1034,7 +1034,7 @@ class TestDuckDB(Validator):
|
||||||
"clickhouse": "fromUnixTimestamp64Milli(CAST(x AS Nullable(Int64)))",
|
"clickhouse": "fromUnixTimestamp64Milli(CAST(x AS Nullable(Int64)))",
|
||||||
"duckdb": "EPOCH_MS(x)",
|
"duckdb": "EPOCH_MS(x)",
|
||||||
"mysql": "FROM_UNIXTIME(x / POWER(10, 3))",
|
"mysql": "FROM_UNIXTIME(x / POWER(10, 3))",
|
||||||
"postgres": "TO_TIMESTAMP(CAST(x AS DOUBLE PRECISION) / 10 ^ 3)",
|
"postgres": "TO_TIMESTAMP(CAST(x AS DOUBLE PRECISION) / POWER(10, 3))",
|
||||||
"presto": "FROM_UNIXTIME(CAST(x AS DOUBLE) / POW(10, 3))",
|
"presto": "FROM_UNIXTIME(CAST(x AS DOUBLE) / POW(10, 3))",
|
||||||
"spark": "TIMESTAMP_MILLIS(x)",
|
"spark": "TIMESTAMP_MILLIS(x)",
|
||||||
},
|
},
|
||||||
|
|
|
@ -568,7 +568,7 @@ FROM json_data, field_ids""",
|
||||||
"x ^ y",
|
"x ^ y",
|
||||||
write={
|
write={
|
||||||
"": "POWER(x, y)",
|
"": "POWER(x, y)",
|
||||||
"postgres": "x ^ y",
|
"postgres": "POWER(x, y)",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
self.validate_all(
|
self.validate_all(
|
||||||
|
@ -765,7 +765,7 @@ FROM json_data, field_ids""",
|
||||||
"x / y ^ z",
|
"x / y ^ z",
|
||||||
write={
|
write={
|
||||||
"": "x / POWER(y, z)",
|
"": "x / POWER(y, z)",
|
||||||
"postgres": "x / y ^ z",
|
"postgres": "x / POWER(y, z)",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
self.validate_all(
|
self.validate_all(
|
||||||
|
|
|
@ -609,7 +609,7 @@ class TestSnowflake(Validator):
|
||||||
"hive": "POWER(x, 2)",
|
"hive": "POWER(x, 2)",
|
||||||
"mysql": "POWER(x, 2)",
|
"mysql": "POWER(x, 2)",
|
||||||
"oracle": "POWER(x, 2)",
|
"oracle": "POWER(x, 2)",
|
||||||
"postgres": "x ^ 2",
|
"postgres": "POWER(x, 2)",
|
||||||
"presto": "POWER(x, 2)",
|
"presto": "POWER(x, 2)",
|
||||||
"redshift": "POWER(x, 2)",
|
"redshift": "POWER(x, 2)",
|
||||||
"snowflake": "POWER(x, 2)",
|
"snowflake": "POWER(x, 2)",
|
||||||
|
@ -2563,3 +2563,12 @@ SINGLE = TRUE""",
|
||||||
"duckdb": f"SELECT LISTAGG({distinct}col, '|SEPARATOR|' ORDER BY col2) FROM t",
|
"duckdb": f"SELECT LISTAGG({distinct}col, '|SEPARATOR|' ORDER BY col2) FROM t",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_rely_options(self):
|
||||||
|
for option in ("NORELY", "RELY"):
|
||||||
|
self.validate_identity(
|
||||||
|
f"CREATE TABLE t (col1 INT PRIMARY KEY {option}, col2 INT UNIQUE {option}, col3 INT NOT NULL FOREIGN KEY REFERENCES other_t (id) {option})"
|
||||||
|
)
|
||||||
|
self.validate_identity(
|
||||||
|
f"CREATE TABLE t (col1 INT, col2 INT, col3 INT, PRIMARY KEY (col1) {option}, UNIQUE (col1, col2) {option}, FOREIGN KEY (col3) REFERENCES other_t (id) {option})"
|
||||||
|
)
|
||||||
|
|
|
@ -56,7 +56,7 @@ class TestSpark(Validator):
|
||||||
"CREATE TABLE x USING ICEBERG PARTITIONED BY (MONTHS(y)) LOCATION 's3://z'",
|
"CREATE TABLE x USING ICEBERG PARTITIONED BY (MONTHS(y)) LOCATION 's3://z'",
|
||||||
write={
|
write={
|
||||||
"duckdb": "CREATE TABLE x",
|
"duckdb": "CREATE TABLE x",
|
||||||
"presto": "CREATE TABLE x WITH (FORMAT='ICEBERG', PARTITIONED_BY=ARRAY['MONTHS'])",
|
"presto": "CREATE TABLE x WITH (FORMAT='ICEBERG', PARTITIONED_BY=ARRAY['MONTHS(y)'])",
|
||||||
"hive": "CREATE TABLE x STORED AS ICEBERG PARTITIONED BY (MONTHS(y)) LOCATION 's3://z'",
|
"hive": "CREATE TABLE x STORED AS ICEBERG PARTITIONED BY (MONTHS(y)) LOCATION 's3://z'",
|
||||||
"spark": "CREATE TABLE x USING ICEBERG PARTITIONED BY (MONTHS(y)) LOCATION 's3://z'",
|
"spark": "CREATE TABLE x USING ICEBERG PARTITIONED BY (MONTHS(y)) LOCATION 's3://z'",
|
||||||
},
|
},
|
||||||
|
|
|
@ -93,6 +93,16 @@ class TestTrino(Validator):
|
||||||
"CREATE TABLE foo.bar WITH (LOCATION='s3://bucket/foo/bar') AS SELECT 1"
|
"CREATE TABLE foo.bar WITH (LOCATION='s3://bucket/foo/bar') AS SELECT 1"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Hive connector syntax (partitioned_by)
|
||||||
|
self.validate_identity(
|
||||||
|
"CREATE TABLE foo (a VARCHAR, b INTEGER, c DATE) WITH (PARTITIONED_BY=ARRAY['a', 'b'])"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Iceberg connector syntax (partitioning, can contain Iceberg transform expressions)
|
||||||
|
self.validate_identity(
|
||||||
|
"CREATE TABLE foo (a VARCHAR, b INTEGER, c DATE) WITH (PARTITIONING=ARRAY['a', 'bucket(4, b)', 'month(c)'])",
|
||||||
|
)
|
||||||
|
|
||||||
def test_analyze(self):
|
def test_analyze(self):
|
||||||
self.validate_identity("ANALYZE tbl")
|
self.validate_identity("ANALYZE tbl")
|
||||||
self.validate_identity("ANALYZE tbl WITH (prop1=val1, prop2=val2)")
|
self.validate_identity("ANALYZE tbl WITH (prop1=val1, prop2=val2)")
|
||||||
|
|
6
tests/fixtures/optimizer/canonicalize.sql
vendored
6
tests/fixtures/optimizer/canonicalize.sql
vendored
|
@ -124,6 +124,12 @@ SELECT CAST(CAST(`t`.`some_col` AS DATE) AS DATETIME) < CAST(CAST(`t`.`other_col
|
||||||
--------------------------------------
|
--------------------------------------
|
||||||
-- Remove redundant casts
|
-- Remove redundant casts
|
||||||
--------------------------------------
|
--------------------------------------
|
||||||
|
CAST(CAST("foo" AS DECIMAL(4, 2)) AS DECIMAL(8, 4)) AS "x";
|
||||||
|
CAST(CAST("foo" AS DECIMAL(4, 2)) AS DECIMAL(8, 4)) AS "x";
|
||||||
|
|
||||||
|
CAST(CAST("foo" AS DECIMAL(4, 2)) AS DECIMAL(4, 2)) AS "x";
|
||||||
|
CAST("foo" AS DECIMAL(4, 2)) AS "x";
|
||||||
|
|
||||||
CAST(CAST('2023-01-01' AS DATE) AS DATE);
|
CAST(CAST('2023-01-01' AS DATE) AS DATE);
|
||||||
CAST('2023-01-01' AS DATE);
|
CAST('2023-01-01' AS DATE);
|
||||||
|
|
||||||
|
|
11
tests/fixtures/optimizer/unnest_subqueries.sql
vendored
11
tests/fixtures/optimizer/unnest_subqueries.sql
vendored
|
@ -67,3 +67,14 @@ SELECT x.a > _u_0.b FROM x CROSS JOIN (SELECT SUM(y.a) AS b FROM y) AS _u_0;
|
||||||
|
|
||||||
SELECT (SELECT MAX(t2.c1) AS c1 FROM t2 WHERE t2.c2 = t1.c2 AND t2.c3 <= TRUNC(t1.c3)) AS c FROM t1;
|
SELECT (SELECT MAX(t2.c1) AS c1 FROM t2 WHERE t2.c2 = t1.c2 AND t2.c3 <= TRUNC(t1.c3)) AS c FROM t1;
|
||||||
SELECT _u_0.c1 AS c FROM t1 LEFT JOIN (SELECT MAX(t2.c1) AS c1, t2.c2 AS _u_1, MAX(t2.c3) AS _u_2 FROM t2 WHERE TRUE AND TRUE GROUP BY t2.c2) AS _u_0 ON _u_0._u_1 = t1.c2 WHERE _u_0._u_2 <= TRUNC(t1.c3);
|
SELECT _u_0.c1 AS c FROM t1 LEFT JOIN (SELECT MAX(t2.c1) AS c1, t2.c2 AS _u_1, MAX(t2.c3) AS _u_2 FROM t2 WHERE TRUE AND TRUE GROUP BY t2.c2) AS _u_0 ON _u_0._u_1 = t1.c2 WHERE _u_0._u_2 <= TRUNC(t1.c3);
|
||||||
|
|
||||||
|
SELECT s.t AS t FROM s WHERE 1 IN (SELECT t.a AS a FROM t WHERE t.b > 1);
|
||||||
|
SELECT s.t AS t FROM s LEFT JOIN (SELECT t.a AS a FROM t WHERE t.b > 1 GROUP BY t.a) AS _u_0 ON 1 = _u_0.a WHERE NOT _u_0.a IS NULL;
|
||||||
|
|
||||||
|
# title: can't create GROUP BY clause with an aggregate
|
||||||
|
SELECT s.t FROM s WHERE 1 IN (SELECT MAX(t.a) AS t1 FROM t);
|
||||||
|
SELECT s.t FROM s LEFT JOIN (SELECT MAX(t.a) AS t1 FROM t) AS _u_0 ON 1 = _u_0.t1 WHERE NOT _u_0.t1 IS NULL;
|
||||||
|
|
||||||
|
# title: can't create GROUP BY clause with an aggregate (nested)
|
||||||
|
SELECT s.t FROM s WHERE 1 IN (SELECT MAX(t.a) + 1 AS t1 FROM t);
|
||||||
|
SELECT s.t FROM s LEFT JOIN (SELECT MAX(t.a) + 1 AS t1 FROM t) AS _u_0 ON 1 = _u_0.t1 WHERE NOT _u_0.t1 IS NULL
|
||||||
|
|
|
@ -533,6 +533,11 @@ class TestOptimizer(unittest.TestCase):
|
||||||
def test_simplify(self):
|
def test_simplify(self):
|
||||||
self.check_file("simplify", simplify)
|
self.check_file("simplify", simplify)
|
||||||
|
|
||||||
|
# Ensure simplify mutates the AST properly
|
||||||
|
expression = parse_one("SELECT 1 + 2")
|
||||||
|
simplify(expression.selects[0])
|
||||||
|
self.assertEqual(expression.sql(), "SELECT 3")
|
||||||
|
|
||||||
expression = parse_one("SELECT a, c, b FROM table1 WHERE 1 = 1")
|
expression = parse_one("SELECT a, c, b FROM table1 WHERE 1 = 1")
|
||||||
self.assertEqual(simplify(simplify(expression.find(exp.Where))).sql(), "WHERE TRUE")
|
self.assertEqual(simplify(simplify(expression.find(exp.Where))).sql(), "WHERE TRUE")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue