sqlglot 30.31.0__tar.gz → 30.33.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (344) hide show
  1. {sqlglot-30.31.0 → sqlglot-30.33.0}/CHANGELOG.md +197 -0
  2. {sqlglot-30.31.0/sqlglot.egg-info → sqlglot-30.33.0}/PKG-INFO +3 -3
  3. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/_version.py +3 -3
  4. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/bigquery.py +3 -0
  5. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/clickhouse.py +8 -0
  6. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/databricks.py +1 -0
  7. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/dialect.py +128 -6
  8. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/hive.py +1 -0
  9. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/oracle.py +2 -0
  10. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/presto.py +33 -0
  11. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/sqlite.py +2 -0
  12. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/teradata.py +3 -1
  13. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/expressions/aggregate.py +8 -1
  14. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/expressions/array.py +1 -0
  15. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/expressions/core.py +18 -2
  16. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/expressions/math.py +1 -0
  17. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/expressions/query.py +13 -2
  18. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/expressions/string.py +6 -2
  19. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/expressions/temporal.py +17 -4
  20. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generator.py +156 -18
  21. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/athena.py +1 -1
  22. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/bigquery.py +54 -4
  23. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/clickhouse.py +26 -5
  24. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/databricks.py +69 -1
  25. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/dremio.py +1 -1
  26. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/drill.py +1 -1
  27. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/druid.py +1 -1
  28. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/duckdb.py +175 -44
  29. sqlglot-30.33.0/sqlglot/generators/dune.py +16 -0
  30. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/exasol.py +15 -13
  31. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/hive.py +26 -3
  32. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/materialize.py +4 -0
  33. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/mysql.py +9 -3
  34. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/oracle.py +16 -2
  35. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/postgres.py +13 -2
  36. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/presto.py +28 -4
  37. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/redshift.py +16 -5
  38. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/singlestore.py +0 -1
  39. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/snowflake.py +23 -6
  40. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/spark.py +18 -0
  41. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/spark2.py +23 -2
  42. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/sqlite.py +25 -5
  43. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/tableau.py +1 -1
  44. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/teradata.py +19 -1
  45. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/trino.py +1 -0
  46. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/tsql.py +33 -5
  47. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/annotate_types.py +2 -0
  48. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/eliminate_joins.py +16 -3
  49. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/merge_subqueries.py +189 -24
  50. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/optimize_joins.py +23 -7
  51. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/pushdown_predicates.py +44 -20
  52. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/qualify_columns.py +64 -28
  53. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/qualify_tables.py +2 -2
  54. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/resolver.py +13 -0
  55. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/scope.py +21 -2
  56. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/simplify.py +41 -8
  57. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/unnest_subqueries.py +64 -51
  58. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parser.py +59 -16
  59. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/bigquery.py +26 -6
  60. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/clickhouse.py +23 -3
  61. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/databricks.py +23 -0
  62. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/duckdb.py +16 -2
  63. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/exasol.py +5 -5
  64. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/hive.py +1 -0
  65. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/mysql.py +6 -0
  66. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/oracle.py +8 -3
  67. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/postgres.py +19 -10
  68. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/presto.py +39 -1
  69. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/snowflake.py +21 -6
  70. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/spark2.py +6 -0
  71. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/sqlite.py +23 -2
  72. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/teradata.py +117 -6
  73. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/tsql.py +3 -3
  74. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/schema.py +56 -38
  75. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/tokenizer_core.py +18 -2
  76. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/transforms.py +26 -20
  77. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/typing/__init__.py +10 -1
  78. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/typing/bigquery.py +48 -7
  79. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/typing/databricks.py +1 -0
  80. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/typing/postgres.py +19 -0
  81. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/typing/redshift.py +14 -0
  82. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/typing/snowflake.py +7 -1
  83. sqlglot-30.33.0/sqlglot/typing/sqlite.py +9 -0
  84. {sqlglot-30.31.0 → sqlglot-30.33.0/sqlglot.egg-info}/PKG-INFO +3 -3
  85. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot.egg-info/SOURCES.txt +3 -0
  86. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot.egg-info/requires.txt +2 -2
  87. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot.egg-info/scm_file_list.json +3 -0
  88. sqlglot-30.33.0/sqlglot.egg-info/scm_version.json +8 -0
  89. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_bigquery.py +215 -7
  90. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_clickhouse.py +71 -1
  91. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_databricks.py +187 -2
  92. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_dialect.py +90 -6
  93. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_duckdb.py +191 -2
  94. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_exasol.py +42 -30
  95. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_hive.py +24 -0
  96. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_materialize.py +6 -0
  97. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_mysql.py +72 -0
  98. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_oracle.py +116 -17
  99. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_postgres.py +236 -1
  100. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_presto.py +13 -0
  101. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_redshift.py +20 -0
  102. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_snowflake.py +162 -21
  103. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_spark.py +120 -1
  104. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_sqlite.py +357 -0
  105. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_starrocks.py +1 -1
  106. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_teradata.py +502 -1
  107. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_trino.py +47 -0
  108. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_tsql.py +69 -9
  109. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/annotate_functions.sql +24 -0
  110. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/eliminate_joins.sql +105 -0
  111. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +2 -2
  112. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/isolate_table_selects.sql +1 -1
  113. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/merge_subqueries.sql +191 -0
  114. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/optimize_joins.sql +15 -0
  115. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/optimizer.sql +42 -0
  116. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/pushdown_predicates.sql +89 -0
  117. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/pushdown_projections.sql +1 -1
  118. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/qualify_columns.sql +123 -2
  119. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/qualify_tables.sql +4 -4
  120. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/simplify.sql +26 -0
  121. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/unnest_subqueries.sql +59 -6
  122. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_build.py +15 -1
  123. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_generator.py +24 -0
  124. sqlglot-30.33.0/tests/test_optimize_cross_joins.py +53 -0
  125. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_optimizer.py +654 -24
  126. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_parser.py +19 -0
  127. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_schema.py +117 -0
  128. sqlglot-30.33.0/tests/test_simplify_between.py +63 -0
  129. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_tokens.py +21 -0
  130. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_transpile.py +32 -0
  131. sqlglot-30.31.0/sqlglot/generators/dune.py +0 -14
  132. sqlglot-30.31.0/sqlglot.egg-info/scm_version.json +0 -8
  133. {sqlglot-30.31.0 → sqlglot-30.33.0}/.gitignore +0 -0
  134. {sqlglot-30.31.0 → sqlglot-30.33.0}/.gitmodules +0 -0
  135. {sqlglot-30.31.0 → sqlglot-30.33.0}/.gitpod.yml +0 -0
  136. {sqlglot-30.31.0 → sqlglot-30.33.0}/.pre-commit-config.yaml +0 -0
  137. {sqlglot-30.31.0 → sqlglot-30.33.0}/AGENTS.md +0 -0
  138. {sqlglot-30.31.0 → sqlglot-30.33.0}/CLAUDE.md +0 -0
  139. {sqlglot-30.31.0 → sqlglot-30.33.0}/CONTRIBUTING.md +0 -0
  140. {sqlglot-30.31.0 → sqlglot-30.33.0}/LICENSE +0 -0
  141. {sqlglot-30.31.0 → sqlglot-30.33.0}/MANIFEST.in +0 -0
  142. {sqlglot-30.31.0 → sqlglot-30.33.0}/Makefile +0 -0
  143. {sqlglot-30.31.0 → sqlglot-30.33.0}/README.md +0 -0
  144. {sqlglot-30.31.0 → sqlglot-30.33.0}/pyproject.toml +0 -0
  145. {sqlglot-30.31.0 → sqlglot-30.33.0}/setup.cfg +0 -0
  146. {sqlglot-30.31.0 → sqlglot-30.33.0}/setup.py +0 -0
  147. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/__init__.py +0 -0
  148. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/__main__.py +0 -0
  149. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/_typing.py +0 -0
  150. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/anonymize.py +0 -0
  151. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/__init__.py +0 -0
  152. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/athena.py +0 -0
  153. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/dax.py +0 -0
  154. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/doris.py +0 -0
  155. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/dremio.py +0 -0
  156. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/drill.py +0 -0
  157. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/druid.py +0 -0
  158. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/duckdb.py +0 -0
  159. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/dune.py +0 -0
  160. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/exasol.py +0 -0
  161. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/fabric.py +0 -0
  162. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/materialize.py +0 -0
  163. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/mysql.py +0 -0
  164. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/postgres.py +0 -0
  165. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/prql.py +0 -0
  166. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/redshift.py +0 -0
  167. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/risingwave.py +0 -0
  168. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/singlestore.py +0 -0
  169. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/snowflake.py +0 -0
  170. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/solr.py +0 -0
  171. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/spark.py +0 -0
  172. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/spark2.py +0 -0
  173. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/starrocks.py +0 -0
  174. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/tableau.py +0 -0
  175. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/trino.py +0 -0
  176. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/dialects/tsql.py +0 -0
  177. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/diff.py +0 -0
  178. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/errors.py +0 -0
  179. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/executor/__init__.py +0 -0
  180. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/executor/context.py +0 -0
  181. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/executor/env.py +0 -0
  182. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/executor/python.py +0 -0
  183. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/executor/table.py +0 -0
  184. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/expressions/__init__.py +0 -0
  185. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/expressions/builders.py +0 -0
  186. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/expressions/constraints.py +0 -0
  187. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/expressions/datatypes.py +0 -0
  188. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/expressions/ddl.py +0 -0
  189. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/expressions/dml.py +0 -0
  190. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/expressions/functions.py +0 -0
  191. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/expressions/json.py +0 -0
  192. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/expressions/properties.py +0 -0
  193. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/__init__.py +0 -0
  194. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/dax.py +0 -0
  195. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/doris.py +0 -0
  196. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/fabric.py +0 -0
  197. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/prql.py +0 -0
  198. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/python.py +0 -0
  199. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/risingwave.py +0 -0
  200. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/solr.py +0 -0
  201. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/generators/starrocks.py +0 -0
  202. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/helper.py +0 -0
  203. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/jsonpath.py +0 -0
  204. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/lineage.py +0 -0
  205. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/__init__.py +0 -0
  206. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/canonicalize.py +0 -0
  207. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/canonicalize_internal_names.py +0 -0
  208. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
  209. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
  210. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/helpers.py +0 -0
  211. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
  212. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/journal.py +0 -0
  213. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/normalize.py +0 -0
  214. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
  215. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/optimizer.py +0 -0
  216. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/pushdown_projections.py +0 -0
  217. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/optimizer/qualify.py +0 -0
  218. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/__init__.py +0 -0
  219. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/athena.py +0 -0
  220. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/base.py +0 -0
  221. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/dax.py +0 -0
  222. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/doris.py +0 -0
  223. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/dremio.py +0 -0
  224. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/drill.py +0 -0
  225. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/druid.py +0 -0
  226. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/dune.py +0 -0
  227. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/fabric.py +0 -0
  228. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/materialize.py +0 -0
  229. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/prql.py +0 -0
  230. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/redshift.py +0 -0
  231. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/risingwave.py +0 -0
  232. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/singlestore.py +0 -0
  233. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/solr.py +0 -0
  234. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/spark.py +0 -0
  235. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/starrocks.py +0 -0
  236. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/tableau.py +0 -0
  237. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/parsers/trino.py +0 -0
  238. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/planner.py +0 -0
  239. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/py.typed +0 -0
  240. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/serde.py +0 -0
  241. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/time.py +0 -0
  242. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/tokens.py +0 -0
  243. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/trie.py +0 -0
  244. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/typing/clickhouse.py +0 -0
  245. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/typing/duckdb.py +0 -0
  246. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/typing/hive.py +0 -0
  247. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/typing/mysql.py +0 -0
  248. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/typing/presto.py +0 -0
  249. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/typing/spark.py +0 -0
  250. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/typing/spark2.py +0 -0
  251. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot/typing/tsql.py +0 -0
  252. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot.egg-info/dependency_links.txt +0 -0
  253. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot.egg-info/top_level.txt +0 -0
  254. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglot.png +0 -0
  255. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglotc/MANIFEST.in +0 -0
  256. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglotc/pyproject.toml +0 -0
  257. {sqlglot-30.31.0 → sqlglot-30.33.0}/sqlglotc/setup.py +0 -0
  258. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/__init__.py +0 -0
  259. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/__init__.py +0 -0
  260. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_athena.py +0 -0
  261. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_dax.py +0 -0
  262. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_doris.py +0 -0
  263. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_dremio.py +0 -0
  264. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_drill.py +0 -0
  265. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_druid.py +0 -0
  266. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_dune.py +0 -0
  267. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_fabric.py +0 -0
  268. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_pipe_syntax.py +0 -0
  269. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_prql.py +0 -0
  270. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_risingwave.py +0 -0
  271. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_singlestore.py +0 -0
  272. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_solr.py +0 -0
  273. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/dialects/test_tableau.py +0 -0
  274. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/identity.sql +0 -0
  275. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/jsonpath/LICENSE +0 -0
  276. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/jsonpath/cts.json +0 -0
  277. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/annotate_types.sql +0 -0
  278. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/canonicalize.sql +0 -0
  279. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/canonicalize_internal_names.sql +0 -0
  280. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
  281. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/normalize.sql +0 -0
  282. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
  283. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
  284. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
  285. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
  286. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
  287. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
  288. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
  289. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
  290. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
  291. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
  292. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
  293. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
  294. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
  295. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
  296. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
  297. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
  298. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
  299. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
  300. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
  301. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
  302. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
  303. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
  304. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
  305. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
  306. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
  307. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
  308. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
  309. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
  310. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
  311. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
  312. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
  313. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
  314. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
  315. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
  316. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
  317. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
  318. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
  319. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
  320. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
  321. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
  322. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/partial.sql +0 -0
  323. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/fixtures/pretty.sql +0 -0
  324. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/gen_fixtures.py +0 -0
  325. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/helpers.py +0 -0
  326. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/leakcheck.py +0 -0
  327. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/sqlglot/__init__.py +0 -0
  328. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_anonymize.py +0 -0
  329. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_dialect_entry_points.py +0 -0
  330. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_dialect_imports.py +0 -0
  331. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_diff.py +0 -0
  332. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_docs.py +0 -0
  333. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_errors.py +0 -0
  334. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_executor.py +0 -0
  335. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_expressions.py +0 -0
  336. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_helper.py +0 -0
  337. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_integration_loader.py +0 -0
  338. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_jsonpath.py +0 -0
  339. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_lineage.py +0 -0
  340. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_serde.py +0 -0
  341. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_sqlglotc.py +0 -0
  342. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_time.py +0 -0
  343. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_transforms.py +0 -0
  344. {sqlglot-30.31.0 → sqlglot-30.33.0}/tests/test_typing.py +0 -0
@@ -1,6 +1,201 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## [v30.32.0] - 2026-11-16
5
+ ### :sparkles: New Features
6
+ - [`466a644`](https://github.com/tobymao/sqlglot/commit/466a6443905f6684cfc38eea0422284231cd1182) - **Snowflake**: Fix type for Snowflake TO_VARIANT *(PR [#8979](https://github.com/tobymao/sqlglot/pull/8979) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
7
+ - [`931b4fb`](https://github.com/tobymao/sqlglot/commit/931b4fb425d452aec854f8c3cf213aa0229b4c73) - **teradata**: parse NAMED aliases *(PR [#8978](https://github.com/tobymao/sqlglot/pull/8978) by [@Walkeer](https://github.com/Walkeer))*
8
+ - [`539d7b9`](https://github.com/tobymao/sqlglot/commit/539d7b94dd553b1df478b46ed3a789383c5e82f1) - **Snowflake**: Handle Snowflake IS_ARRAY boolean type correctly *(PR [#9003](https://github.com/tobymao/sqlglot/pull/9003) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
9
+ - [`c226be9`](https://github.com/tobymao/sqlglot/commit/c226be91617b74ba2a5bf3edcedc9c561add7afa) - **Bigquery**: Add fix for BQ Extract DATETIME type *(PR [#9048](https://github.com/tobymao/sqlglot/pull/9048) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
10
+ - [`c4893ba`](https://github.com/tobymao/sqlglot/commit/c4893ba8c762947a397f0856b59cd104574f90ab) - **teradata**: parse XC hexadecimal character values [CODEX] *(PR [#9069](https://github.com/tobymao/sqlglot/pull/9069) by [@Walkeer](https://github.com/Walkeer))*
11
+ - [`834f494`](https://github.com/tobymao/sqlglot/commit/834f494633487450170ead2e34bd0be1081428e7) - **teradata**: parse XCV hexadecimal character literals [CODEX] *(PR [#9141](https://github.com/tobymao/sqlglot/pull/9141) by [@Walkeer](https://github.com/Walkeer))*
12
+
13
+ ### :bug: Bug Fixes
14
+ - [`4a6fad3`](https://github.com/tobymao/sqlglot/commit/4a6fad3014a2de318a2223b896481acb8a37147a) - **mysql, spark**: return an empty string for a negative LEFT/RIGHT length in DuckDB [CLAUDE] *(PR [#8967](https://github.com/tobymao/sqlglot/pull/8967) by [@anishmehta24](https://github.com/anishmehta24))*
15
+ - [`6bff65f`](https://github.com/tobymao/sqlglot/commit/6bff65f64f943e64d08be11965d77f4a81386b0b) - **optimizer**: preserve NULL semantics when unnesting IN subqueries *(PR [#8990](https://github.com/tobymao/sqlglot/pull/8990) by [@georgesittas](https://github.com/georgesittas))*
16
+ - :arrow_lower_right: *fixes issue [#8984](https://github.com/tobymao/sqlglot/issues/8984) opened by [@ananya-patel81](https://github.com/ananya-patel81)*
17
+ - [`9738cfb`](https://github.com/tobymao/sqlglot/commit/9738cfbb22378bb94aa6b9ac26bd0dc3a8692ff0) - **optimizer**: preserve uncorrelated EXISTS subqueries *(PR [#8993](https://github.com/tobymao/sqlglot/pull/8993) by [@georgesittas](https://github.com/georgesittas))*
18
+ - :arrow_lower_right: *fixes issue [#8987](https://github.com/tobymao/sqlglot/issues/8987) opened by [@ananya-patel81](https://github.com/ananya-patel81)*
19
+ - [`c4130f4`](https://github.com/tobymao/sqlglot/commit/c4130f48d1bc4721682c89e0e413c212daa05581) - **optimizer**: guard string range simplification by column type *(PR [#8994](https://github.com/tobymao/sqlglot/pull/8994) by [@georgesittas](https://github.com/georgesittas))*
20
+ - :arrow_lower_right: *fixes issue [#8988](https://github.com/tobymao/sqlglot/issues/8988) opened by [@ananya-patel81](https://github.com/ananya-patel81)*
21
+ - [`14f79fe`](https://github.com/tobymao/sqlglot/commit/14f79fe818bd5a2dbe5743fcc88ab05acb9a1055) - **optimizer**: preserve merged keys in chained USING joins [CODEX] *(PR [#8992](https://github.com/tobymao/sqlglot/pull/8992) by [@georgesittas](https://github.com/georgesittas))*
22
+ - :arrow_lower_right: *fixes issue [#8986](https://github.com/tobymao/sqlglot/issues/8986) opened by [@ananya-patel81](https://github.com/ananya-patel81)*
23
+ - [`64edeec`](https://github.com/tobymao/sqlglot/commit/64edeecbee4be9d743d84fe06f8d920e34f03c43) - **optimizer**: preserve outer join NULLs when merging subqueries *(PR [#8995](https://github.com/tobymao/sqlglot/pull/8995) by [@georgesittas](https://github.com/georgesittas))*
24
+ - :arrow_lower_right: *fixes issue [#8983](https://github.com/tobymao/sqlglot/issues/8983) opened by [@ananya-patel81](https://github.com/ananya-patel81)*
25
+ - [`600e73b`](https://github.com/tobymao/sqlglot/commit/600e73b05805b3dffd6189288b473cd45ce19d8c) - **duckdb**: preserve correlated ALL semantics *(PR [#8991](https://github.com/tobymao/sqlglot/pull/8991) by [@georgesittas](https://github.com/georgesittas))*
26
+ - :arrow_lower_right: *fixes issue [#8985](https://github.com/tobymao/sqlglot/issues/8985) opened by [@ananya-patel81](https://github.com/ananya-patel81)*
27
+ - [`0fcfc11`](https://github.com/tobymao/sqlglot/commit/0fcfc119b42d1103b97fd888cfda365629c8d676) - **schema**: avoid retaining queries in schema caches *(PR [#8999](https://github.com/tobymao/sqlglot/pull/8999) by [@georgesittas](https://github.com/georgesittas))*
28
+ - :arrow_lower_right: *fixes issue [#8997](https://github.com/tobymao/sqlglot/issues/8997) opened by [@NikitaYurasov](https://github.com/NikitaYurasov)*
29
+ - [`ddc22ff`](https://github.com/tobymao/sqlglot/commit/ddc22ffcdb8cef8f4fdaecdd69747906b2d0a907) - **snowflake**: resolve 'e' flag capture group default in REGEXP_SUBSTR / REGEXP_SUBSTR_ALL *(PR [#8961](https://github.com/tobymao/sqlglot/pull/8961) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
30
+ - [`715c4e3`](https://github.com/tobymao/sqlglot/commit/715c4e32d9bf349cab789f2e03b99b319563644d) - **optimizer**: preserve parenthesized joins *(PR [#9001](https://github.com/tobymao/sqlglot/pull/9001) by [@georgesittas](https://github.com/georgesittas))*
31
+ - :arrow_lower_right: *fixes issue [#9000](https://github.com/tobymao/sqlglot/issues/9000) opened by [@theblair](https://github.com/theblair)*
32
+ - [`39ea442`](https://github.com/tobymao/sqlglot/commit/39ea442e9b0fcbed8704b78b2a82563e41095af6) - **teradata**: handle overloaded TRUNC and DateTrunc transpilation *(PR [#8980](https://github.com/tobymao/sqlglot/pull/8980) by [@EduardoAndradeSLima](https://github.com/EduardoAndradeSLima))*
33
+ - [`9d77c91`](https://github.com/tobymao/sqlglot/commit/9d77c912450a80cf1423c8bc9e91994a750a53ee) - **mysql**: flag @> and <@ array operators as unsupported [CLAUDE] *(PR [#9012](https://github.com/tobymao/sqlglot/pull/9012) by [@zgurung](https://github.com/zgurung))*
34
+ - [`0ccd0ab`](https://github.com/tobymao/sqlglot/commit/0ccd0ab4542b53a8f6055da52b679db53ef3cc1f) - **parser**: require valid unit for interval + continuation *(PR [#9015](https://github.com/tobymao/sqlglot/pull/9015) by [@ansh-rohilla](https://github.com/ansh-rohilla))*
35
+ - :arrow_lower_right: *fixes issue [#9014](https://github.com/tobymao/sqlglot/issues/9014) opened by [@JabberWocky-22](https://github.com/JabberWocky-22)*
36
+ - [`233e6f3`](https://github.com/tobymao/sqlglot/commit/233e6f378f2b291628fa1dbf42dabf7491806066) - **generator**: prevent SELECT_KINDS leaks in compiled builds *(PR [#9026](https://github.com/tobymao/sqlglot/pull/9026) by [@georgesittas](https://github.com/georgesittas))*
37
+ - :arrow_lower_right: *fixes issue [#9019](https://github.com/tobymao/sqlglot/issues/9019) opened by [@arthurlaquieze](https://github.com/arthurlaquieze)*
38
+ - [`8e9f43a`](https://github.com/tobymao/sqlglot/commit/8e9f43a9919ef702ce478fad39ffac3ecef301ef) - **postgres**: avoid duplicate function parameter modes *(PR [#9020](https://github.com/tobymao/sqlglot/pull/9020) by [@georgesittas](https://github.com/georgesittas))*
39
+ - :arrow_lower_right: *fixes issue [#9008](https://github.com/tobymao/sqlglot/issues/9008) opened by [@rileythomp](https://github.com/rileythomp)*
40
+ - [`c111d0e`](https://github.com/tobymao/sqlglot/commit/c111d0e88d5de8cf782f80813c1c1185ef7cd001) - **databricks**: preserve UNNEST join semantics *(PR [#9025](https://github.com/tobymao/sqlglot/pull/9025) by [@georgesittas](https://github.com/georgesittas))*
41
+ - :arrow_lower_right: *fixes issue [#9018](https://github.com/tobymao/sqlglot/issues/9018) opened by [@swimming-potato](https://github.com/swimming-potato)*
42
+ - [`3463d9e`](https://github.com/tobymao/sqlglot/commit/3463d9ecab436616828f4fe0b20b0824608edf26) - **postgres**: parse CONVERT as charset conversion *(PR [#9024](https://github.com/tobymao/sqlglot/pull/9024) by [@georgesittas](https://github.com/georgesittas))*
43
+ - :arrow_lower_right: *fixes issue [#9016](https://github.com/tobymao/sqlglot/issues/9016) opened by [@JabberWocky-22](https://github.com/JabberWocky-22)*
44
+ - [`c7be595`](https://github.com/tobymao/sqlglot/commit/c7be595d85b232e62bf0b39bd604a26fe4331f34) - preserve Snowflake ASOF join semantics when transpiling *(PR [#9029](https://github.com/tobymao/sqlglot/pull/9029) by [@georgesittas](https://github.com/georgesittas))*
45
+ - :arrow_lower_right: *fixes issue [#9027](https://github.com/tobymao/sqlglot/issues/9027) opened by [@Ankitkj1999](https://github.com/Ankitkj1999)*
46
+ - [`5c473b2`](https://github.com/tobymao/sqlglot/commit/5c473b241c60a0f685a18bceb74466a2273a1e54) - **teradata**: preserve BYTEINT type identity [CODEX] *(PR [#9030](https://github.com/tobymao/sqlglot/pull/9030) by [@Walkeer](https://github.com/Walkeer))*
47
+ - [`8688c12`](https://github.com/tobymao/sqlglot/commit/8688c120ffee4c9b7d1ad2aa1373bfbe6d37a665) - preserve TRUNC calendar semantics across dialects *(PR [#9021](https://github.com/tobymao/sqlglot/pull/9021) by [@georgesittas](https://github.com/georgesittas))*
48
+ - [`3f22a0e`](https://github.com/tobymao/sqlglot/commit/3f22a0eef026441c27e718ee68ccacd959ca42e9) - **postgres**: preserve generate_series step semantics [CODEX] *(PR [#9023](https://github.com/tobymao/sqlglot/pull/9023) by [@georgesittas](https://github.com/georgesittas))*
49
+ - :arrow_lower_right: *fixes issue [#9017](https://github.com/tobymao/sqlglot/issues/9017) opened by [@JabberWocky-22](https://github.com/JabberWocky-22)*
50
+ - [`7dbf610`](https://github.com/tobymao/sqlglot/commit/7dbf610a9be24ee725b037f6faf37541b85c7bcb) - **optimizer**: prevent predicate pushdown through DISTINCT ON *(PR [#9035](https://github.com/tobymao/sqlglot/pull/9035) by [@georgesittas](https://github.com/georgesittas))*
51
+ - :arrow_lower_right: *fixes issue [#9031](https://github.com/tobymao/sqlglot/issues/9031) opened by [@xgbtxy](https://github.com/xgbtxy)*
52
+ - [`24503a1`](https://github.com/tobymao/sqlglot/commit/24503a1f148795ff77a9fe6e99b28bdce20a2658) - **optimizer**: preserve positional joins during optimization *(PR [#9042](https://github.com/tobymao/sqlglot/pull/9042) by [@georgesittas](https://github.com/georgesittas))*
53
+ - :arrow_lower_right: *fixes issue [#9038](https://github.com/tobymao/sqlglot/issues/9038) opened by [@Ankitkj1999](https://github.com/Ankitkj1999)*
54
+ - [`8c0c82e`](https://github.com/tobymao/sqlglot/commit/8c0c82e4b4cc083683942e38d69c266557ee97f0) - **teradata**: recognize CHARACTERS as character length [CODEX] *(PR [#9044](https://github.com/tobymao/sqlglot/pull/9044) by [@Walkeer](https://github.com/Walkeer))*
55
+ - [`6b2cef8`](https://github.com/tobymao/sqlglot/commit/6b2cef8a3c180478b4b265f6cc18f0c5346dd696) - **teradata**: recognize CURDATE() as current date [CODEX] *(PR [#9047](https://github.com/tobymao/sqlglot/pull/9047) by [@Walkeer](https://github.com/Walkeer))*
56
+ - [`0cac007`](https://github.com/tobymao/sqlglot/commit/0cac00719ffc0604fd7c63c9e230bc4925ae8e26) - **teradata**: omit empty parentheses from CURRENT_TIME [CODEX] *(PR [#9050](https://github.com/tobymao/sqlglot/pull/9050) by [@Walkeer](https://github.com/Walkeer))*
57
+ - [`e7e7f6c`](https://github.com/tobymao/sqlglot/commit/e7e7f6c45fdcdb5d56ecd4e90279e46503f331dd) - **optimizer**: preserve semi and anti join aliases in ON clauses *(PR [#9043](https://github.com/tobymao/sqlglot/pull/9043) by [@georgesittas](https://github.com/georgesittas))*
58
+ - :arrow_lower_right: *fixes issue [#9037](https://github.com/tobymao/sqlglot/issues/9037) opened by [@Ankitkj1999](https://github.com/Ankitkj1999)*
59
+ - [`61f63f0`](https://github.com/tobymao/sqlglot/commit/61f63f029a533c11b7db3446ffb758e27440a30b) - **teradata**: recognize CURTIME alias [CODEX] *(PR [#9059](https://github.com/tobymao/sqlglot/pull/9059) by [@Walkeer](https://github.com/Walkeer))*
60
+ - [`573e3cc`](https://github.com/tobymao/sqlglot/commit/573e3cca4d5fe701a6451bf1f04f0c8b5be4fe1c) - **optimizer**: preserve filters around special joins *(PR [#9040](https://github.com/tobymao/sqlglot/pull/9040) by [@georgesittas](https://github.com/georgesittas))*
61
+ - :arrow_lower_right: *fixes issue [#9036](https://github.com/tobymao/sqlglot/issues/9036) opened by [@Ankitkj1999](https://github.com/Ankitkj1999)*
62
+ - [`0f950e8`](https://github.com/tobymao/sqlglot/commit/0f950e8643318c71e356baa953f98a855af73c9e) - **teradata**: generate native DAYOFWEEK [CODEX] *(PR [#9064](https://github.com/tobymao/sqlglot/pull/9064) by [@Walkeer](https://github.com/Walkeer))*
63
+ - [`1357b56`](https://github.com/tobymao/sqlglot/commit/1357b5622dc80f9ba72187a02c7fa510e456ad12) - **duckdb**: count elapsed BigQuery timestamp units *(commit by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
64
+ - [`0d2f459`](https://github.com/tobymao/sqlglot/commit/0d2f459b9cd67bc4c2bf2853b09e0fe3b26426c9) - **parser**: parse qualified file format names in COPY INTO *(PR [#9054](https://github.com/tobymao/sqlglot/pull/9054) by [@zgurung](https://github.com/zgurung))*
65
+ - [`f7e901a`](https://github.com/tobymao/sqlglot/commit/f7e901a6fc848587ff461135ac7175984b6167d3) - **optimizer**: preserve single-row joins with USING, NATURAL, or outer sides [GEMINI] *(PR [#9053](https://github.com/tobymao/sqlglot/pull/9053) by [@xgbtxy](https://github.com/xgbtxy))*
66
+ - :arrow_lower_right: *fixes issue [#9052](https://github.com/tobymao/sqlglot/issues/9052) opened by [@xgbtxy](https://github.com/xgbtxy)*
67
+ - [`3c55eac`](https://github.com/tobymao/sqlglot/commit/3c55eacc64989f03eef1a99e96b738be2b0d3238) - **duckdb**: preserve timestamp difference overload semantics *(commit by [@georgesittas](https://github.com/georgesittas))*
68
+ - [`0e534d4`](https://github.com/tobymao/sqlglot/commit/0e534d4e74a8f2a7ff53870183609fae43649b58) - **parser**: gate multi-part interval addition behind dialect setting *(PR [#9057](https://github.com/tobymao/sqlglot/pull/9057) by [@ansh-rohilla](https://github.com/ansh-rohilla))*
69
+ - :arrow_lower_right: *fixes issue [#9055](https://github.com/tobymao/sqlglot/issues/9055) opened by [@JabberWocky-22](https://github.com/JabberWocky-22)*
70
+ - [`4c0e538`](https://github.com/tobymao/sqlglot/commit/4c0e538fdd93d14d8f29a987fc1b8dc4d7c552e7) - **oracle**: eliminate SEMI/ANTI joins, map VAR_POP and APPROX_COUNT_DISTINCT *(PR [#9067](https://github.com/tobymao/sqlglot/pull/9067) by [@imsurya26](https://github.com/imsurya26))*
71
+ - :arrow_lower_right: *fixes issue [#9061](https://github.com/tobymao/sqlglot/issues/9061) opened by [@haorein](https://github.com/haorein)*
72
+ - [`91c120c`](https://github.com/tobymao/sqlglot/commit/91c120c0ba447b41c6810a959ec1490ed341b9ae) - **postgres**: preserve date and interval arithmetic result types *(PR [#9070](https://github.com/tobymao/sqlglot/pull/9070) by [@georgesittas](https://github.com/georgesittas))*
73
+ - :arrow_lower_right: *fixes issue [#9056](https://github.com/tobymao/sqlglot/issues/9056) opened by [@JabberWocky-22](https://github.com/JabberWocky-22)*
74
+ - [`ec96d31`](https://github.com/tobymao/sqlglot/commit/ec96d31244ac7df0fd5bee2063c65d2b7de049b2) - **redshift**: type annotation for Redshift AT TIME ZONE *(PR [#9071](https://github.com/tobymao/sqlglot/pull/9071) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
75
+ - [`968314b`](https://github.com/tobymao/sqlglot/commit/968314baa0b2eb3c66bf9ecfa3776cdac14dd044) - **redshift**: infer AT TIME ZONE types for DATE and TIMETZ *(PR [#9073](https://github.com/tobymao/sqlglot/pull/9073) by [@georgesittas](https://github.com/georgesittas))*
76
+ - [`76fcf25`](https://github.com/tobymao/sqlglot/commit/76fcf25549dc6a4ce59af6e1ee7f21e332243c65) - **clickhouse**: generate array sorts and logical aggregates *(PR [#9072](https://github.com/tobymao/sqlglot/pull/9072) by [@haorein](https://github.com/haorein))*
77
+ - :arrow_lower_right: *fixes issue [#9063](https://github.com/tobymao/sqlglot/issues/9063) opened by [@haorein](https://github.com/haorein)*
78
+ - [`38437a3`](https://github.com/tobymao/sqlglot/commit/38437a3bf91f908927f4980fbf6cb7963e523d8b) - **clickhouse**: preserve logical aggregate null and numeric semantics *(commit by [@georgesittas](https://github.com/georgesittas))*
79
+ - [`1965183`](https://github.com/tobymao/sqlglot/commit/19651830bda35784b85781767510d2dbee95b936) - **generator**: add ORDER BY to window functions that require it *(PR [#9066](https://github.com/tobymao/sqlglot/pull/9066) by [@baruchoxman](https://github.com/baruchoxman))*
80
+ - :arrow_lower_right: *fixes issue [#9065](https://github.com/tobymao/sqlglot/issues/9065) opened by [@baruchoxman](https://github.com/baruchoxman)*
81
+ - [`79716c7`](https://github.com/tobymao/sqlglot/commit/79716c77ffb007c09482ee2ddcf08b8ccf4c127f) - **oracle**: keep VARIANCE and VAR_SAMP apart *(PR [#9075](https://github.com/tobymao/sqlglot/pull/9075) by [@haorein](https://github.com/haorein))*
82
+ - :arrow_lower_right: *fixes issue [#9060](https://github.com/tobymao/sqlglot/issues/9060) opened by [@haorein](https://github.com/haorein)*
83
+ - [`593835a`](https://github.com/tobymao/sqlglot/commit/593835aa3d804a3e399cce38f5c52a25e5e79a16) - **oracle**: preserve variance semantics for windows and empty inputs *(commit by [@georgesittas](https://github.com/georgesittas))*
84
+ - [`036030a`](https://github.com/tobymao/sqlglot/commit/036030a42170acd3ca3cc279fcb43656155fcf5c) - **generator**: preserve original variance function names *(commit by [@georgesittas](https://github.com/georgesittas))*
85
+ - [`06d6bcc`](https://github.com/tobymao/sqlglot/commit/06d6bcc5eaaaab52ddc32d736bdacc2e1d681c12) - **presto**: mark the third SLICE argument as a length [CLAUDE] *(PR [#9087](https://github.com/tobymao/sqlglot/pull/9087) by [@dayan02dev](https://github.com/dayan02dev))*
86
+ - [`b476d29`](https://github.com/tobymao/sqlglot/commit/b476d29f42eeabfd0c8a150b9239a344b02e68dd) - **sqlite**: preserve quoted PRAGMA identifiers [CODEX] *(PR [#9088](https://github.com/tobymao/sqlglot/pull/9088) by [@pengpengyi92](https://github.com/pengpengyi92))*
87
+ - [`b294f7f`](https://github.com/tobymao/sqlglot/commit/b294f7fa89c8a6f59d0c1c963777202d9ef59549) - **parser**: keep comments inside multi-word keywords *(PR [#9004](https://github.com/tobymao/sqlglot/pull/9004) by [@tobymao](https://github.com/tobymao))*
88
+ - :arrow_lower_right: *fixes issue [#8981](https://github.com/tobymao/sqlglot/issues/8981) opened by [@rileythomp](https://github.com/rileythomp)*
89
+ - [`3a25325`](https://github.com/tobymao/sqlglot/commit/3a25325d62b012eac714663dd359a9ed31768582) - **clickhouse**: raise ParseError for empty XOR calls [CODEX] *(PR [#9106](https://github.com/tobymao/sqlglot/pull/9106) by [@hector2394](https://github.com/hector2394))*
90
+ - :arrow_lower_right: *fixes issue [#9101](https://github.com/tobymao/sqlglot/issues/9101) opened by [@Sun-Wukhan](https://github.com/Sun-Wukhan)*
91
+ - [`2ec8bcc`](https://github.com/tobymao/sqlglot/commit/2ec8bcc6091758ad67e27e84598d170f3ca8f8f2) - **parser**: distinguish conditionless JOIN from comma joins *(PR [#9076](https://github.com/tobymao/sqlglot/pull/9076) by [@georgesittas](https://github.com/georgesittas))*
92
+ - [`784c0d7`](https://github.com/tobymao/sqlglot/commit/784c0d787efea81de5ddfae83f65f9ddc73e6117) - **teradata**: simplify XC literal handling *(PR [#9125](https://github.com/tobymao/sqlglot/pull/9125) by [@georgesittas](https://github.com/georgesittas))*
93
+ - [`cf16865`](https://github.com/tobymao/sqlglot/commit/cf1686591b014c427e25edc84ba63776424db89c) - **tsql**: coerce boolean casts in predicate positions [CODEX] *(PR [#9127](https://github.com/tobymao/sqlglot/pull/9127) by [@hector2394](https://github.com/hector2394))*
94
+ - :arrow_lower_right: *fixes issue [#9102](https://github.com/tobymao/sqlglot/issues/9102) opened by [@Sun-Wukhan](https://github.com/Sun-Wukhan)*
95
+ - [`913be7d`](https://github.com/tobymao/sqlglot/commit/913be7dbe897148ca516ac9de8f4c835d4ac5fa8) - **sqlite**: preserve unary plus affinity *(PR [#9126](https://github.com/tobymao/sqlglot/pull/9126) by [@vanshbarfiwala-lgtm](https://github.com/vanshbarfiwala-lgtm))*
96
+ - :arrow_lower_right: *fixes issue [#9124](https://github.com/tobymao/sqlglot/issues/9124) opened by [@vanshbarfiwala-lgtm](https://github.com/vanshbarfiwala-lgtm)*
97
+ - [`0f48d14`](https://github.com/tobymao/sqlglot/commit/0f48d1487a59dbc9ed78321d7a75950cca6addeb) - **optimizer**: don't decorrelate EXISTS predicates that use IS [CLAUDE] *(PR [#9121](https://github.com/tobymao/sqlglot/pull/9121) by [@hemtilva](https://github.com/hemtilva))*
98
+ - :arrow_lower_right: *fixes issue [#9120](https://github.com/tobymao/sqlglot/issues/9120) opened by [@hemtilva](https://github.com/hemtilva)*
99
+ - [`a97d8d6`](https://github.com/tobymao/sqlglot/commit/a97d8d63ebeaa5b9e2a94095f42df271b0ba4756) - **parser**: validate missing date arithmetic arguments *(commit by [@georgesittas](https://github.com/georgesittas))*
100
+ - :arrow_lower_right: *fixes issue [#9103](https://github.com/tobymao/sqlglot/issues/9103) opened by [@Sun-Wukhan](https://github.com/Sun-Wukhan)*
101
+ - [`ab10a79`](https://github.com/tobymao/sqlglot/commit/ab10a79f5966a72c66b0902926cef5f8168bb408) - **optimizer**: preserve parentheses under unary plus *(commit by [@georgesittas](https://github.com/georgesittas))*
102
+ - [`83d02ae`](https://github.com/tobymao/sqlglot/commit/83d02aeedd97366e0d9ebe6611047f7dbb40bebd) - **sqlite**: keep the exclusive end of RANGE in GENERATE_SERIES *(PR [#9123](https://github.com/tobymao/sqlglot/pull/9123) by [@DeepBuha06](https://github.com/DeepBuha06))*
103
+ - [`5b64475`](https://github.com/tobymao/sqlglot/commit/5b64475fc1ef950d3ae99d7d2d75de998342e378) - **bigquery**: type DATETIME_ADD/TIMESTAMP_ADD by their argument *(PR [#9117](https://github.com/tobymao/sqlglot/pull/9117) by [@VaggelisD](https://github.com/VaggelisD))*
104
+ - [`1a9c2d0`](https://github.com/tobymao/sqlglot/commit/1a9c2d0607019e82c7defab7d6c50ec489737401) - **sqlite**: map JSON and JSONB casts to JSON function ([#9113](https://github.com/tobymao/sqlglot/pull/9113)) *(PR [#9116](https://github.com/tobymao/sqlglot/pull/9116) by [@Gowthamsuryagolla](https://github.com/Gowthamsuryagolla))*
105
+ - :arrow_lower_right: *fixes issue [#9113](https://github.com/tobymao/sqlglot/issues/9113) opened by [@bardrop](https://github.com/bardrop)*
106
+ - [`14b6900`](https://github.com/tobymao/sqlglot/commit/14b69001c86abfbcf821ade0706749af23c18937) - **generator**: concatenate CHR calls for multi-argument CHAR *(PR [#9119](https://github.com/tobymao/sqlglot/pull/9119) by [@EnesSoydan](https://github.com/EnesSoydan))*
107
+ - :arrow_lower_right: *fixes issue [#8542](https://github.com/tobymao/sqlglot/issues/8542) opened by [@ParamTanna](https://github.com/ParamTanna)*
108
+ - [`361f808`](https://github.com/tobymao/sqlglot/commit/361f808132984bedfdb42e0950b1298bdd66a427) - **optimizer**: keep parentheses for reversed DATE_TRUNC comparisons under NOT *(PR [#9108](https://github.com/tobymao/sqlglot/pull/9108) by [@parthdembla007](https://github.com/parthdembla007))*
109
+ - :arrow_lower_right: *fixes issue [#9107](https://github.com/tobymao/sqlglot/issues/9107) opened by [@parthdembla007](https://github.com/parthdembla007)*
110
+ - [`b385119`](https://github.com/tobymao/sqlglot/commit/b385119d78f976519a08d1e94de8f25805b1040b) - preserve property comments and refine SQLite JSON cast tests *(commit by [@georgesittas](https://github.com/georgesittas))*
111
+ - [`df4496e`](https://github.com/tobymao/sqlglot/commit/df4496e48f5dec0c1105e31bc758d207e967b6ae) - **duckdb**: keep NULL and empty arrays for LATERAL VIEW OUTER as LEFT JOIN UNNEST [CLAUDE] *(PR [#9091](https://github.com/tobymao/sqlglot/pull/9091) by [@dayan02dev](https://github.com/dayan02dev))*
112
+ - [`d78ad66`](https://github.com/tobymao/sqlglot/commit/d78ad66cbdfda24e0ce9a1c535c7beaa6df1e18d) - **bigquery**: stabilize INFORMATION_SCHEMA round trips [CODEX] *(PR [#9133](https://github.com/tobymao/sqlglot/pull/9133) by [@georgesittas](https://github.com/georgesittas))*
113
+ - [`708fc0b`](https://github.com/tobymao/sqlglot/commit/708fc0bd605ac36561071c6924927c1c382aca35) - **optimizer**: keep LEFT JOINs onto UNION ALL derived tables in eliminate_joins [CLAUDE] *(PR [#9092](https://github.com/tobymao/sqlglot/pull/9092) by [@anishmehta24](https://github.com/anishmehta24))*
114
+ - [`c8e5853`](https://github.com/tobymao/sqlglot/commit/c8e5853d9979b34c2a4aab5b66c46bd674b62c9c) - **duckdb**: only match binary POSITION on byte boundaries *(commit by [@krish-goradia](https://github.com/krish-goradia))*
115
+ - [`3b6c49c`](https://github.com/tobymao/sqlglot/commit/3b6c49c8e440d65c16663d5d78ac9b7064b2389c) - **clickhouse**: map formatDateTime specifiers that differ from strftime *(commit by [@DeepBuha06](https://github.com/DeepBuha06))*
116
+ - [`35916ab`](https://github.com/tobymao/sqlglot/commit/35916abf778be027b31faf00564cf126d8c7dbf0) - **clickhouse**: preserve escaped time format specifiers *(commit by [@georgesittas](https://github.com/georgesittas))*
117
+ - [`505c4a3`](https://github.com/tobymao/sqlglot/commit/505c4a35d1c99c118377d5ef2a7c15f9e6b8f421) - **hive**: preserve sub-day DATEADD units in Hive and Spark [CODEX] *(PR [#9085](https://github.com/tobymao/sqlglot/pull/9085) by [@georgesittas](https://github.com/georgesittas))*
118
+ - :arrow_lower_right: *fixes issue [#9083](https://github.com/tobymao/sqlglot/issues/9083) opened by [@ryuan-cz](https://github.com/ryuan-cz)*
119
+ - [`e31d209`](https://github.com/tobymao/sqlglot/commit/e31d209ee0a3ed5aa35da952328aa03d475ce75d) - **bigquery**: rewrite LIKE ... ESCAPE literal patterns to backslash escapes *(PR [#9095](https://github.com/tobymao/sqlglot/pull/9095) by [@VaggelisD](https://github.com/VaggelisD))*
120
+ - [`ae3d013`](https://github.com/tobymao/sqlglot/commit/ae3d0139e760fe7bec499cd6fba3a53d727b6f8b) - **bigquery**: cast zoneless Presto/Trino AT TIME ZONE operand to TIMESTAMP *(PR [#9097](https://github.com/tobymao/sqlglot/pull/9097) by [@VaggelisD](https://github.com/VaggelisD))*
121
+ - [`8802c5a`](https://github.com/tobymao/sqlglot/commit/8802c5a7c9745703a29a824f4e245d44671ad940) - **generator**: keep the lambda of Spark's EXISTS(array, lambda) *(PR [#9140](https://github.com/tobymao/sqlglot/pull/9140) by [@EnesSoydan](https://github.com/EnesSoydan))*
122
+ - :arrow_lower_right: *fixes issue [#9032](https://github.com/tobymao/sqlglot/issues/9032) opened by [@Ankitkj1999](https://github.com/Ankitkj1999)*
123
+ - [`997b7cf`](https://github.com/tobymao/sqlglot/commit/997b7cfeb8cef2b361208bb72df7eead792cc0db) - **optimizer**: preserve BETWEEN SYMMETRIC semantics [CODEX] *(PR [#9142](https://github.com/tobymao/sqlglot/pull/9142) by [@Ramji-Purwar](https://github.com/Ramji-Purwar))*
124
+ - [`fccb238`](https://github.com/tobymao/sqlglot/commit/fccb2380b247f652e668d6508f1a3d2ff9a8eee2) - stop walking into udtf for walk_in_scope *(PR [#9099](https://github.com/tobymao/sqlglot/pull/9099) by [@barakalon](https://github.com/barakalon))*
125
+ - [`8c0dcfe`](https://github.com/tobymao/sqlglot/commit/8c0dcfe6872d5fbe1b65f62eb2b3269930dd3e55) - **sqlite**: omit default separator for DISTINCT aggregates [CODEX] *(PR [#9147](https://github.com/tobymao/sqlglot/pull/9147) by [@prathamchoksi](https://github.com/prathamchoksi))*
126
+ - :arrow_lower_right: *fixes issue [#9146](https://github.com/tobymao/sqlglot/issues/9146) opened by [@prathamchoksi](https://github.com/prathamchoksi)*
127
+ - [`152f69d`](https://github.com/tobymao/sqlglot/commit/152f69da577c9e9af7ee90c625668c23e576ef1c) - **optimizer**: retain conditional CROSS JOIN predicates [CODEX] *(PR [#9149](https://github.com/tobymao/sqlglot/pull/9149) by [@Ramji-Purwar](https://github.com/Ramji-Purwar))*
128
+ - [`0424c5d`](https://github.com/tobymao/sqlglot/commit/0424c5d9fcc007239a2324ca93e6cecfc74b5b67) - **duckdb**: preserve SQLite NULL group_concat separators [CODEX] *(PR [#9144](https://github.com/tobymao/sqlglot/pull/9144) by [@vanshbarfiwala-lgtm](https://github.com/vanshbarfiwala-lgtm))*
129
+ - :arrow_lower_right: *fixes issue [#9143](https://github.com/tobymao/sqlglot/issues/9143) opened by [@vanshbarfiwala-lgtm](https://github.com/vanshbarfiwala-lgtm)*
130
+ - [`34ac378`](https://github.com/tobymao/sqlglot/commit/34ac378866650d732a1de72c96058078938c95f3) - **optimizer**: preserve NULL semantics when decorrelating IN subqueries *(PR [#9151](https://github.com/tobymao/sqlglot/pull/9151) by [@geooo109](https://github.com/geooo109))*
131
+ - :arrow_lower_right: *fixes issue [#9122](https://github.com/tobymao/sqlglot/issues/9122) opened by [@hemtilva](https://github.com/hemtilva)*
132
+ - [`798a1d7`](https://github.com/tobymao/sqlglot/commit/798a1d77270da43041b37b4f5166252571f1243f) - **redshift**: preserve date unit expressions *(commit by [@georgesittas](https://github.com/georgesittas))*
133
+
134
+ ### :zap: Performance Improvements
135
+ - [`6332eff`](https://github.com/tobymao/sqlglot/commit/6332eff5414991744a5055bacafdadbd4db5ae57) - **expressions**: shallow-copy immutable meta in deepcopy [CLAUDE] *(PR [#9013](https://github.com/tobymao/sqlglot/pull/9013) by [@g4lb](https://github.com/g4lb))*
136
+
137
+ ### :wrench: Chores
138
+ - [`d95ad4f`](https://github.com/tobymao/sqlglot/commit/d95ad4f026f37a9083c697819ac4247ed919ceee) - sync conditionless join fixtures *(commit by [@georgesittas](https://github.com/georgesittas))*
139
+
140
+
141
+ ## [v30.31.0] - 2026-11-10
142
+ ### :boom: BREAKING CHANGES
143
+ - due to [`56525f7`](https://github.com/tobymao/sqlglot/commit/56525f74855190c45b102e7f0aee7d6d80d3a480) - NormalizationStrategy.CASE_INSENSITIVE_EXCEPT_TALBES *(PR [#8935](https://github.com/tobymao/sqlglot/pull/8935) by [@barakalon](https://github.com/barakalon))*:
144
+
145
+ NormalizationStrategy.CASE_INSENSITIVE_EXCEPT_TALBES (#8935)
146
+
147
+
148
+ ### :sparkles: New Features
149
+ - [`062a971`](https://github.com/tobymao/sqlglot/commit/062a971e79e2a77a6d1084bbd3d901a1b25540f3) - **teradata**: parse EXECUTE macro calls [CODEX] *(PR [#8948](https://github.com/tobymao/sqlglot/pull/8948) by [@Walkeer](https://github.com/Walkeer))*
150
+ - :arrow_lower_right: *addresses issue [#8947](https://github.com/tobymao/sqlglot/issues/8947) opened by [@Walkeer](https://github.com/Walkeer)*
151
+ - [`1ddb63b`](https://github.com/tobymao/sqlglot/commit/1ddb63b02509f7f6446edfb4026dd2967966a8a3) - **Bigquery**: Preserve struct type inside array in bigquery *(PR [#8921](https://github.com/tobymao/sqlglot/pull/8921) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
152
+ - [`4f6e8d8`](https://github.com/tobymao/sqlglot/commit/4f6e8d87ad6a8fcdcca490f1c0d36d54103aa40f) - **Snowflake**: Support Snowflake TO_JSON varchar type *(PR [#8975](https://github.com/tobymao/sqlglot/pull/8975) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
153
+ - [`c14c969`](https://github.com/tobymao/sqlglot/commit/c14c9698e28527103b8a5cfe1c183d1334291d98) - **teradata**: parse TITLE display headings [CODEX] *(PR [#8974](https://github.com/tobymao/sqlglot/pull/8974) by [@Walkeer](https://github.com/Walkeer))*
154
+
155
+ ### :bug: Bug Fixes
156
+ - [`b74097a`](https://github.com/tobymao/sqlglot/commit/b74097a1abddbdfefdf1ec4f470e4ea71bfddbc5) - **tokenizer**: parse SAVEPOINT and RELEASE as commands *(PR [#8920](https://github.com/tobymao/sqlglot/pull/8920) by [@chinmayajha](https://github.com/chinmayajha))*
157
+ - [`4269a98`](https://github.com/tobymao/sqlglot/commit/4269a98ac893364c8ae32529357c2d97a583dfa4) - **sqlite**: parse underscore digit separators in numbers [CLAUDE] *(PR [#8923](https://github.com/tobymao/sqlglot/pull/8923) by [@chinmayajha](https://github.com/chinmayajha))*
158
+ - [`b99f5d5`](https://github.com/tobymao/sqlglot/commit/b99f5d58b1773276544b513e072273789cf2549a) - **sqlite**: keep STRICT and parse WITHOUT ROWID table options [CLAUDE] *(PR [#8925](https://github.com/tobymao/sqlglot/pull/8925) by [@chinmayajha](https://github.com/chinmayajha))*
159
+ - [`dae5a7c`](https://github.com/tobymao/sqlglot/commit/dae5a7c533039f6a38d160bd67f23bfcad3670e7) - **sqlite**: parse REINDEX as a command [CLAUDE] *(PR [#8929](https://github.com/tobymao/sqlglot/pull/8929) by [@chinmayajha](https://github.com/chinmayajha))*
160
+ - [`56525f7`](https://github.com/tobymao/sqlglot/commit/56525f74855190c45b102e7f0aee7d6d80d3a480) - NormalizationStrategy.CASE_INSENSITIVE_EXCEPT_TALBES *(PR [#8935](https://github.com/tobymao/sqlglot/pull/8935) by [@barakalon](https://github.com/barakalon))*
161
+ - [`4a60ec8`](https://github.com/tobymao/sqlglot/commit/4a60ec83a8f60e4776ab002e750d7506d273db89) - **databricks**: parse TIMESTAMP WITHOUT TIME ZONE into TIMESTAMP_NTZ *(PR [#8926](https://github.com/tobymao/sqlglot/pull/8926) by [@treysp](https://github.com/treysp))*
162
+ - [`8a06b18`](https://github.com/tobymao/sqlglot/commit/8a06b18aa63de673c7ad4f2fd304d68e87438573) - **presto**: preserve DATE_TRUNC input type when transpiling to DuckDB *(PR [#8945](https://github.com/tobymao/sqlglot/pull/8945) by [@baruchoxman](https://github.com/baruchoxman))*
163
+ - :arrow_lower_right: *fixes issue [#8944](https://github.com/tobymao/sqlglot/issues/8944) opened by [@baruchoxman](https://github.com/baruchoxman)*
164
+ - [`cfda786`](https://github.com/tobymao/sqlglot/commit/cfda7864eaa2557348657358ec7ede6b5650f4aa) - **generator**: warn on slices in dialects with bracket-quoted identifiers *(commit by [@georgesittas](https://github.com/georgesittas))*
165
+ - [`cf60275`](https://github.com/tobymao/sqlglot/commit/cf6027514078544cbc3c1a470072946285efa475) - **redshift**: drop DISTKEY/SORTKEY/DISTSTYLE when generating other dialects *(PR [#8938](https://github.com/tobymao/sqlglot/pull/8938) by [@zgurung](https://github.com/zgurung))*
166
+ - :arrow_lower_right: *fixes issue [#8937](https://github.com/tobymao/sqlglot/issues/8937) opened by [@zgurung](https://github.com/zgurung)*
167
+ - [`ff1c85d`](https://github.com/tobymao/sqlglot/commit/ff1c85d05f90008582582209801e901a2bbbf394) - **teradata**: set NORMALIZATION_STRATEGY to CASE_INSENSITIVE *(PR [#8940](https://github.com/tobymao/sqlglot/pull/8940) by [@EduardoAndradeSLima](https://github.com/EduardoAndradeSLima))*
168
+ - :arrow_lower_right: *fixes issue [#8932](https://github.com/tobymao/sqlglot/issues/8932) opened by [@Bhavaneda](https://github.com/Bhavaneda)*
169
+ - [`5197166`](https://github.com/tobymao/sqlglot/commit/5197166a2aeee4dfd9aa62ed59f9962eb070dead) - **clickhouse**: parenthesize multi-row VALUES relations *(PR [#8943](https://github.com/tobymao/sqlglot/pull/8943) by [@yzhu-liftoff](https://github.com/yzhu-liftoff))*
170
+ - :arrow_lower_right: *fixes issue [#8942](https://github.com/tobymao/sqlglot/issues/8942) opened by [@yzhu-liftoff](https://github.com/yzhu-liftoff)*
171
+ - [`b032279`](https://github.com/tobymao/sqlglot/commit/b0322790534dfcbd51f8d6bba3fb48e6e811e45f) - **postgres**: report unsupported star EXCEPT *(PR [#8933](https://github.com/tobymao/sqlglot/pull/8933) by [@lss680455-create](https://github.com/lss680455-create))*
172
+ - :arrow_lower_right: *fixes issue [#8928](https://github.com/tobymao/sqlglot/issues/8928) opened by [@notlakshitha](https://github.com/notlakshitha)*
173
+ - [`3457400`](https://github.com/tobymao/sqlglot/commit/3457400b5d5a1888fc8b4327c0eab04e4cc989f4) - **redshift**: preserve star exclusion in strict transpilation modes *(commit by [@georgesittas](https://github.com/georgesittas))*
174
+ - [`19d1cc7`](https://github.com/tobymao/sqlglot/commit/19d1cc7ea29224cd9adcdbf59bf5dedd6ae5c6d2) - **sqlite**: transpile DATE_SUB to DATE with a negated modifier [CLAUDE] *(PR [#8931](https://github.com/tobymao/sqlglot/pull/8931) by [@dvsnehal](https://github.com/dvsnehal))*
175
+ - [`1300a99`](https://github.com/tobymao/sqlglot/commit/1300a99feb80551fa86d39eb8bed2210188fcb8e) - handle omitted REGEXP_REPLACE replacement *(PR [#8952](https://github.com/tobymao/sqlglot/pull/8952) by [@georgesittas](https://github.com/georgesittas))*
176
+ - :arrow_lower_right: *fixes issue [#8934](https://github.com/tobymao/sqlglot/issues/8934) opened by [@lss680455-create](https://github.com/lss680455-create)*
177
+ - [`5a8f468`](https://github.com/tobymao/sqlglot/commit/5a8f4686b536050a9be0b337be9b55cab26c0cb6) - preserve safe division guards for typed integers *(PR [#8950](https://github.com/tobymao/sqlglot/pull/8950) by [@georgesittas](https://github.com/georgesittas))*
178
+ - :arrow_lower_right: *fixes issue [#8946](https://github.com/tobymao/sqlglot/issues/8946) opened by [@IAMVENEETH](https://github.com/IAMVENEETH)*
179
+ - [`0503702`](https://github.com/tobymao/sqlglot/commit/0503702e2e183483ba6fc581c746f2eaf1ed3d46) - **duckdb**: parse generated INITCAP SQL with the DuckDB dialect [WORKBUDDY] *(PR [#8959](https://github.com/tobymao/sqlglot/pull/8959) by [@inchang-ing](https://github.com/inchang-ing))*
180
+ - :arrow_lower_right: *fixes issue [#8955](https://github.com/tobymao/sqlglot/issues/8955) opened by [@IAMVENEETH](https://github.com/IAMVENEETH)*
181
+ - [`e3963f5`](https://github.com/tobymao/sqlglot/commit/e3963f55bb49a335e23cdfb14f991f0aae4472b4) - **spark**: handle a 0 start and a negative length in SUBSTRING for DuckDB [CLAUDE] *(PR [#8966](https://github.com/tobymao/sqlglot/pull/8966) by [@anishmehta24](https://github.com/anishmehta24))*
182
+ - [`20b1a60`](https://github.com/tobymao/sqlglot/commit/20b1a60c46cd96c08772c4147d0f68bff46667ee) - **optimizer**: preserve source bindings in ORDER BY expressions [CODEX] *(PR [#8951](https://github.com/tobymao/sqlglot/pull/8951) by [@georgesittas](https://github.com/georgesittas))*
183
+ - :arrow_lower_right: *fixes issue [#8927](https://github.com/tobymao/sqlglot/issues/8927) opened by [@AndreMuraro](https://github.com/AndreMuraro)*
184
+ - [`6922013`](https://github.com/tobymao/sqlglot/commit/69220135b19802256402fde01bd34f35034db69d) - **postgres**: preserve omitted REGEXP_REPLACE replacement [CODEX] *(PR [#8969](https://github.com/tobymao/sqlglot/pull/8969) by [@hector2394](https://github.com/hector2394))*
185
+ - :arrow_lower_right: *fixes issue [#8968](https://github.com/tobymao/sqlglot/issues/8968) opened by [@Cyber-Marty](https://github.com/Cyber-Marty)*
186
+ - [`547fee8`](https://github.com/tobymao/sqlglot/commit/547fee896acb63c6bfd13147968a0e564feb45e9) - **optimizer**: don't simplify zoned DATE_TRUNC/TIMESTAMP_TRUNC [CLAUDE] *(PR [#8971](https://github.com/tobymao/sqlglot/pull/8971) by [@talzel](https://github.com/talzel))*
187
+ - :arrow_lower_right: *fixes issue [#8970](https://github.com/tobymao/sqlglot/issues/8970) opened by [@talzel](https://github.com/talzel)*
188
+ - [`7740638`](https://github.com/tobymao/sqlglot/commit/774063800ff49f08a2f3ce459427e717878a66b6) - **schema**: invalidate all cached lookups in MappingSchema.add_table *(PR [#8960](https://github.com/tobymao/sqlglot/pull/8960) by [@zgurung](https://github.com/zgurung))*
189
+ - [`0c1b5ee`](https://github.com/tobymao/sqlglot/commit/0c1b5ee65056ffd90b68705f469b8d36fc459b13) - **generator**: guard modulo by zero when transpiling from safe-division dialects *(PR [#8973](https://github.com/tobymao/sqlglot/pull/8973) by [@georgesittas](https://github.com/georgesittas))*
190
+ - :arrow_lower_right: *fixes issue [#8953](https://github.com/tobymao/sqlglot/issues/8953) opened by [@IAMVENEETH](https://github.com/IAMVENEETH)*
191
+ - [`326acdc`](https://github.com/tobymao/sqlglot/commit/326acdccf40182186bb3cd69f71a63f40c4f5c9d) - **teradata**: preserve nested TITLE function calls *(PR [#8976](https://github.com/tobymao/sqlglot/pull/8976) by [@georgesittas](https://github.com/georgesittas))*
192
+ - [`447a8a8`](https://github.com/tobymao/sqlglot/commit/447a8a8929835a82ead76d7c6d7e104df344ab36) - **optimizer**: resolve outer columns before inner table aliases in postgres *(PR [#8972](https://github.com/tobymao/sqlglot/pull/8972) by [@georgesittas](https://github.com/georgesittas))*
193
+ - :arrow_lower_right: *fixes issue [#8936](https://github.com/tobymao/sqlglot/issues/8936) opened by [@laravioli](https://github.com/laravioli)*
194
+
195
+ ### :zap: Performance Improvements
196
+ - [`e0a6385`](https://github.com/tobymao/sqlglot/commit/e0a638553ade104a05f38b5ea94564f462c03a32) - **optimizer**: skip comparison pairs that can never combine in simplify [CLAUDE] *(PR [#8965](https://github.com/tobymao/sqlglot/pull/8965) by [@deadstrobe5](https://github.com/deadstrobe5))*
197
+
198
+
4
199
  ## [v30.30.0] - 2026-11-06
5
200
  ### :boom: BREAKING CHANGES
6
201
  - due to [`2609055`](https://github.com/tobymao/sqlglot/commit/26090558386544da0932d78945c24ca97e303e31) - respect input column precedence in HAVING and QUALIFY *(PR [#8898](https://github.com/tobymao/sqlglot/pull/8898) by [@georgesittas](https://github.com/georgesittas))*:
@@ -16651,3 +16846,5 @@ pip install "sqlglot[c]" # compiled — faster, but no subclassing
16651
16846
  [v30.27.0]: https://github.com/tobymao/sqlglot/compare/v30.26.0...v30.27.0
16652
16847
  [v30.29.0]: https://github.com/tobymao/sqlglot/compare/v30.28.0...v30.29.0
16653
16848
  [v30.30.0]: https://github.com/tobymao/sqlglot/compare/v30.29.0...v30.30.0
16849
+ [v30.31.0]: https://github.com/tobymao/sqlglot/compare/v30.30.0...v30.31.0
16850
+ [v30.32.0]: https://github.com/tobymao/sqlglot/compare/v30.31.0...v30.32.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlglot
3
- Version: 30.31.0
3
+ Version: 30.33.0
4
4
  Summary: An easily customizable SQL parser and transpiler
5
5
  Author-email: Toby Mao <toby.mao@gmail.com>
6
6
  License-Expression: MIT
@@ -34,10 +34,10 @@ Requires-Dist: types-pytz; extra == "dev"
34
34
  Requires-Dist: typing_extensions; extra == "dev"
35
35
  Requires-Dist: pyperf; extra == "dev"
36
36
  Provides-Extra: c
37
- Requires-Dist: sqlglotc==30.31.0; python_version >= "3.10" and extra == "c"
37
+ Requires-Dist: sqlglotc==30.33.0; python_version >= "3.10" and extra == "c"
38
38
  Provides-Extra: rs
39
39
  Requires-Dist: sqlglotrs==0.13.0; extra == "rs"
40
- Requires-Dist: sqlglotc==30.31.0; python_version >= "3.10" and extra == "rs"
40
+ Requires-Dist: sqlglotc==30.33.0; python_version >= "3.10" and extra == "rs"
41
41
  Dynamic: license-file
42
42
  Dynamic: provides-extra
43
43
 
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '30.31.0'
22
- __version_tuple__ = version_tuple = (30, 31, 0)
21
+ __version__ = version = '30.33.0'
22
+ __version_tuple__ = version_tuple = (30, 33, 0)
23
23
 
24
- __commit_id__ = commit_id = 'g447a8a892'
24
+ __commit_id__ = commit_id = 'g0936dbe91'
@@ -70,6 +70,9 @@ class BigQuery(Dialect):
70
70
  # Preserve %E6S instead of expanding to %T.%f - since both %E6S & %T.%f are semantically different in BigQuery
71
71
  # %E6S is semantically different from %T.%f: %E6S works as a single atomic specifier for seconds with microseconds, while %T.%f expands incorrectly and fails to parse.
72
72
  "%H:%M:%S.%f": "%H:%M:%E6S",
73
+ # Milliseconds are only written, so BigQuery's own %E3S is read and kept as is
74
+ "%S.%f_three": "%E3S",
75
+ "%H:%M:%S.%f_three": "%H:%M:%E3S",
73
76
  }
74
77
 
75
78
  FORMAT_MAPPING = {
@@ -24,6 +24,14 @@ class ClickHouse(Dialect):
24
24
  IDENTIFIERS_CAN_START_WITH_DIGIT = True
25
25
  HEX_STRING_IS_INTEGER_TYPE = True
26
26
 
27
+ # https://clickhouse.com/docs/sql-reference/functions/date-time-functions#formatDateTime
28
+ TIME_MAPPING = {
29
+ "%%": "%%",
30
+ "%M": "%B",
31
+ "%i": "%M",
32
+ "%W": "%A",
33
+ }
34
+
27
35
  # https://github.com/ClickHouse/ClickHouse/issues/33935#issue-1112165779
28
36
  NORMALIZATION_STRATEGY = NormalizationStrategy.CASE_SENSITIVE
29
37
 
@@ -34,6 +34,7 @@ class Databricks(Spark):
34
34
  KEYWORDS = {
35
35
  **Spark.Tokenizer.KEYWORDS,
36
36
  "MATCH_RECOGNIZE": TokenType.MATCH_RECOGNIZE,
37
+ "OPTIMIZE": TokenType.OPTIMIZE,
37
38
  "STREAM": TokenType.STREAM,
38
39
  "VOID": TokenType.VOID,
39
40
  }
@@ -2,6 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  import importlib
4
4
  import logging
5
+ import re
5
6
  import string
6
7
  import typing as t
7
8
  import sys
@@ -1944,10 +1945,10 @@ def build_date_delta(
1944
1945
  def build_date_delta_with_interval(
1945
1946
  expression_class: Type[E],
1946
1947
  default_unit: str | None = None,
1947
- ) -> t.Callable[[BuilderArgs], E | None]:
1948
- def _builder(args: BuilderArgs) -> E | None:
1948
+ ) -> t.Callable[[BuilderArgs], E]:
1949
+ def _builder(args: BuilderArgs) -> E:
1949
1950
  if len(args) < 2:
1950
- return None
1951
+ return expression_class(this=seq_get(args, 0))
1951
1952
 
1952
1953
  interval = args[1]
1953
1954
 
@@ -2238,6 +2239,100 @@ def build_trunc(
2238
2239
  return exp.Anonymous(this="TRUNC", expressions=args)
2239
2240
 
2240
2241
 
2242
+ # https://docs.teradata.com/r/Lake-Working-with-SQL/SQL-Functions/SQL-Date-and-Time-Functions-and-Expressions/DateTime-and-Interval-Functions-and-Expressions/TRUNC-Date/TRUNC-Date-Syntax/ROUND-Date-and-TRUNC-Date-Argument-Types-and-Rules/TRUNC-and-ROUND-Date-Formats
2243
+ TRUNC_FORMAT_TO_UNIT = {
2244
+ "CC": "CENTURY",
2245
+ "SCC": "CENTURY",
2246
+ "SYYYY": "YEAR",
2247
+ "SYYY": "YEAR",
2248
+ "YYYY": "YEAR",
2249
+ "YEAR": "YEAR",
2250
+ "SYEAR": "YEAR",
2251
+ "YYY": "YEAR",
2252
+ "YY": "YEAR",
2253
+ "Y": "YEAR",
2254
+ "IYYY": "ISOYEAR",
2255
+ "IYY": "ISOYEAR",
2256
+ "IY": "ISOYEAR",
2257
+ "I": "ISOYEAR",
2258
+ "Q": "QUARTER",
2259
+ "MONTH": "MONTH",
2260
+ "MON": "MONTH",
2261
+ "MM": "MONTH",
2262
+ "RM": "MONTH",
2263
+ "DAY": "WEEK",
2264
+ "DY": "WEEK",
2265
+ "D": "WEEK",
2266
+ "IW": "ISOWEEK",
2267
+ # These weeks are anchored to the first day of the month/year, not a fixed weekday.
2268
+ "W": "WEEK_OF_MONTH",
2269
+ "WW": "WEEK_OF_YEAR",
2270
+ "DDD": "DAY",
2271
+ "DD": "DAY",
2272
+ "J": "DAY",
2273
+ "HH": "HOUR",
2274
+ "HH12": "HOUR",
2275
+ "HH24": "HOUR",
2276
+ "MI": "MINUTE",
2277
+ "SS": "SECOND",
2278
+ }
2279
+
2280
+
2281
+ def build_formatted_trunc(
2282
+ args: BuilderArgs, dialect: Dialect
2283
+ ) -> exp.DateTrunc | exp.Trunc | exp.Anonymous:
2284
+ trunc = build_trunc(args, dialect, date_trunc_unabbreviate=False, default_date_trunc_unit="DD")
2285
+ if isinstance(trunc, exp.DateTrunc) and trunc.unit.is_string:
2286
+ unit = TRUNC_FORMAT_TO_UNIT.get(trunc.unit.name.upper())
2287
+ if unit == "ISOWEEK" or (unit == "WEEK" and dialect.WEEK_OFFSET):
2288
+ start = 1 if unit == "ISOWEEK" else week_offset_to_dow(dialect.WEEK_OFFSET)
2289
+ day = next(day for day, dow in WEEK_START_DAY_TO_DOW.items() if dow == start)
2290
+ trunc.set("unit", exp.WeekStart(this=exp.var(day)))
2291
+ elif unit:
2292
+ trunc.set("unit", exp.Literal.string(unit))
2293
+ return trunc
2294
+
2295
+
2296
+ UNIT_TO_TRUNC_FORMAT = {
2297
+ "CENTURY": "CC",
2298
+ "YEAR": "YEAR",
2299
+ "YY": "YEAR",
2300
+ "YYYY": "YEAR",
2301
+ "ISOYEAR": "IYYY",
2302
+ "QUARTER": "Q",
2303
+ "MONTH": "MONTH",
2304
+ "MM": "MONTH",
2305
+ "MON": "MONTH",
2306
+ "WEEK": "IW",
2307
+ "WEEK_OF_MONTH": "W",
2308
+ "WEEK_OF_YEAR": "WW",
2309
+ "ISOWEEK": "IW",
2310
+ "DAY": "DD",
2311
+ "HOUR": "HH",
2312
+ "MINUTE": "MI",
2313
+ }
2314
+
2315
+
2316
+ @unsupported_args("zone", "century_from_zero")
2317
+ def date_trunc_to_trunc_sql(self: Generator, expression: exp.DateTrunc) -> str:
2318
+ unit = expression.unit
2319
+ if isinstance(unit, exp.WeekStart):
2320
+ if unit.name.upper() == "MONDAY":
2321
+ unit = exp.Literal.string("IW")
2322
+ else:
2323
+ self.weekstart_name(unit)
2324
+ unit = exp.Literal.string("DAY")
2325
+ elif isinstance(unit, (exp.Literal, exp.Var)):
2326
+ unit_name = unit.name.upper()
2327
+ mapped = UNIT_TO_TRUNC_FORMAT.get(unit_name)
2328
+ if mapped:
2329
+ unit = exp.Literal.string(mapped)
2330
+ else:
2331
+ self.unsupported(f"Unexpected interval unit: {unit_name}")
2332
+
2333
+ return self.func("TRUNC", expression.this, unit)
2334
+
2335
+
2241
2336
  def any_value_to_max_sql(self: Generator, expression: exp.AnyValue) -> str:
2242
2337
  return self.func("MAX", expression.this)
2243
2338
 
@@ -2392,11 +2487,23 @@ def unit_to_str(expression: exp.Expr, default: str = "DAY") -> exp.Expr | None:
2392
2487
 
2393
2488
 
2394
2489
  def weekstart_unit_to_str(
2395
- self: Generator, expression: exp.Expr, default: str = "DAY"
2490
+ self: Generator,
2491
+ expression: exp.Expr,
2492
+ default: str = "DAY",
2493
+ *,
2494
+ century_from_zero: bool = False,
2396
2495
  ) -> exp.Expr | None:
2397
2496
  unit = expression.args.get("unit")
2398
2497
  if isinstance(unit, exp.WeekStart):
2399
2498
  return exp.Literal.string(self.weekstart_name(unit))
2499
+ if isinstance(unit, exp.Literal) and unit.name.upper() in ("WEEK_OF_MONTH", "WEEK_OF_YEAR"):
2500
+ self.unsupported(f"Unexpected interval unit: {unit.name}")
2501
+ if (
2502
+ isinstance(unit, (exp.Literal, exp.Var))
2503
+ and map_date_part(unit).name.upper() == "CENTURY"
2504
+ and bool(expression.args.get("century_from_zero")) != century_from_zero
2505
+ ):
2506
+ self.unsupported("Cannot preserve century boundaries starting at different years")
2400
2507
 
2401
2508
  return unit_to_str(expression, default)
2402
2509
 
@@ -2404,7 +2511,7 @@ def weekstart_unit_to_str(
2404
2511
  def unit_to_var(expression: exp.Expr, default: str = "DAY") -> exp.Expr | None:
2405
2512
  unit = expression.args.get("unit")
2406
2513
 
2407
- if isinstance(unit, (exp.Var, exp.Placeholder, exp.WeekStart, exp.Column)):
2514
+ if unit and not isinstance(unit, exp.Literal):
2408
2515
  return unit
2409
2516
 
2410
2517
  value = unit.name if unit else default
@@ -2771,6 +2878,15 @@ def build_like(expr_type: Type[E], not_like: bool = False) -> t.Callable[[Builde
2771
2878
  return _builder
2772
2879
 
2773
2880
 
2881
+ def regexp_capture_group_count(pattern: exp.Expression | None) -> int | None:
2882
+ if pattern and (pattern.is_string or isinstance(pattern, exp.RawString)):
2883
+ try:
2884
+ return re.compile(pattern.name).groups
2885
+ except re.error:
2886
+ pass
2887
+ return None
2888
+
2889
+
2774
2890
  def build_regexp_extract(expr_type: Type[E]) -> t.Callable[[BuilderArgs, Dialect], E]:
2775
2891
  def _builder(args: BuilderArgs, dialect: Dialect) -> E:
2776
2892
  # The "position" argument specifies the index of the string character to start matching from.
@@ -2793,7 +2909,9 @@ def build_regexp_extract(expr_type: Type[E]) -> t.Callable[[BuilderArgs, Dialect
2793
2909
  return _builder
2794
2910
 
2795
2911
 
2796
- def explode_to_unnest_sql(self: Generator, expression: exp.Lateral) -> str:
2912
+ def explode_to_unnest_sql(
2913
+ self: Generator, expression: exp.Lateral, supports_left_join_unnest: bool = True
2914
+ ) -> str:
2797
2915
  this = expression.this
2798
2916
  alias = expression.args.get("alias")
2799
2917
 
@@ -2826,6 +2944,10 @@ def explode_to_unnest_sql(self: Generator, expression: exp.Lateral) -> str:
2826
2944
  )
2827
2945
 
2828
2946
  if cross_join_expr:
2947
+ if expression.args.get("outer") or isinstance(this, exp.ExplodeOuter):
2948
+ if supports_left_join_unnest:
2949
+ return self.sql(exp.Join(this=cross_join_expr, side="LEFT", on=exp.true()))
2950
+ self.unsupported("LEFT JOIN UNNEST is not supported, NULL or empty arrays are dropped")
2829
2951
  return self.sql(exp.Join(this=cross_join_expr, kind="cross"))
2830
2952
 
2831
2953
  return self.lateral_sql(expression)
@@ -73,6 +73,7 @@ class Hive(Dialect):
73
73
  "ss": "%Sstrict",
74
74
  "s": "%-S",
75
75
  "SSSSSS": "%f",
76
+ "SSS": "%f_three",
76
77
  "a": "%p",
77
78
  "DD": "%j",
78
79
  "D": "%-j",
@@ -14,6 +14,8 @@ from sqlglot.tokens import TokenType
14
14
 
15
15
 
16
16
  class Oracle(Dialect):
17
+ # Assume NLS_TERRITORY = 'AMERICA' for the DAY, DY and D truncation formats.
18
+ WEEK_OFFSET = -1
17
19
  ALIAS_POST_TABLESAMPLE = True
18
20
  LOCKING_READS_SUPPORTED = True
19
21
  TABLESAMPLE_SIZE_IS_PERCENT = True
@@ -12,6 +12,7 @@ from sqlglot.dialects.mysql import MySQL
12
12
  from sqlglot.generators.presto import PrestoGenerator
13
13
  from sqlglot.parsers.presto import PrestoParser
14
14
  from sqlglot.tokens import TokenType
15
+ from sqlglot.trie import new_trie
15
16
  from sqlglot.typing.presto import EXPRESSION_METADATA
16
17
 
17
18
 
@@ -34,6 +35,38 @@ class Presto(Dialect):
34
35
 
35
36
  TIME_MAPPING = MySQL.TIME_MAPPING
36
37
 
38
+ # FORMAT_DATETIME's Joda patterns, which DATE_FORMAT's MySQL codes can't always express, e.g. SSS.
39
+ # Fields that would format differently elsewhere are left out: fractions of a second other than
40
+ # ss.SSS (Joda keeps only milliseconds, and BigQuery writes them only with seconds), z and Z
41
+ # (other dialects don't keep the zone) and d (BigQuery pads it with a space).
42
+ # https://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html
43
+ JODA_TIME_MAPPING = {
44
+ "yyyy": "%Y",
45
+ "yy": "%y",
46
+ "MMMM": "%B",
47
+ "MMM": "%b",
48
+ "MM": "%m",
49
+ "M": "%-m",
50
+ "dd": "%d",
51
+ "DDD": "%j",
52
+ "D": "%-j",
53
+ "EEEE": "%A",
54
+ "EEE": "%a",
55
+ "a": "%p",
56
+ "HH": "%H",
57
+ "H": "%-H",
58
+ "hh": "%I",
59
+ "h": "%-I",
60
+ "mm": "%M",
61
+ "m": "%-M",
62
+ "ss": "%S",
63
+ "s": "%-S",
64
+ "ss.SSS": "%S.%f_three",
65
+ }
66
+ JODA_TIME_TRIE = new_trie(JODA_TIME_MAPPING)
67
+ INVERSE_JODA_TIME_MAPPING = {v: k for k, v in JODA_TIME_MAPPING.items()}
68
+ INVERSE_JODA_TIME_TRIE = new_trie(INVERSE_JODA_TIME_MAPPING)
69
+
37
70
  # https://github.com/trinodb/trino/issues/17
38
71
  # https://github.com/trinodb/trino/issues/12289
39
72
  # https://github.com/prestodb/presto/issues/2863
@@ -10,6 +10,7 @@ from sqlglot.dialects.dialect import (
10
10
  from sqlglot.generators.sqlite import SQLiteGenerator
11
11
  from sqlglot.parsers.sqlite import SQLiteParser
12
12
  from sqlglot.tokens import TokenType
13
+ from sqlglot.typing.sqlite import EXPRESSION_METADATA
13
14
 
14
15
 
15
16
  class SQLite(Dialect):
@@ -28,6 +29,7 @@ class SQLite(Dialect):
28
29
  CONCAT_WS_COALESCE = True
29
30
  INTERSECT_BINDS_TIGHTER_THAN_UNION_AND_EXCEPT = False
30
31
  NUMBERS_CAN_BE_UNDERSCORE_SEPARATED = True
32
+ EXPRESSION_METADATA = EXPRESSION_METADATA.copy()
31
33
 
32
34
  class Tokenizer(tokens.Tokenizer):
33
35
  IDENTIFIERS = ['"', ("[", "]"), "`"]