sqlglot 30.33.0__tar.gz → 30.34.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 (343) hide show
  1. {sqlglot-30.33.0 → sqlglot-30.34.0}/AGENTS.md +1 -1
  2. {sqlglot-30.33.0 → sqlglot-30.34.0}/CHANGELOG.md +50 -0
  3. {sqlglot-30.33.0 → sqlglot-30.34.0}/CLAUDE.md +1 -1
  4. {sqlglot-30.33.0 → sqlglot-30.34.0}/CONTRIBUTING.md +7 -11
  5. {sqlglot-30.33.0/sqlglot.egg-info → sqlglot-30.34.0}/PKG-INFO +8 -6
  6. {sqlglot-30.33.0 → sqlglot-30.34.0}/README.md +5 -3
  7. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/_version.py +3 -3
  8. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/anonymize.py +12 -1
  9. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/clickhouse.py +2 -0
  10. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/databricks.py +1 -0
  11. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/dialect.py +47 -21
  12. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/duckdb.py +1 -0
  13. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/exasol.py +1 -0
  14. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/hive.py +1 -0
  15. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/materialize.py +1 -0
  16. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/oracle.py +0 -1
  17. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/postgres.py +7 -0
  18. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/presto.py +1 -0
  19. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/redshift.py +2 -0
  20. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/risingwave.py +2 -0
  21. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/snowflake.py +7 -0
  22. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/sqlite.py +8 -0
  23. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/expressions/array.py +8 -0
  24. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/expressions/constraints.py +2 -2
  25. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/expressions/core.py +29 -7
  26. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/expressions/datatypes.py +1 -0
  27. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/expressions/dml.py +2 -0
  28. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/expressions/query.py +1 -1
  29. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/expressions/string.py +5 -1
  30. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/expressions/temporal.py +1 -1
  31. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generator.py +41 -14
  32. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/bigquery.py +38 -4
  33. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/clickhouse.py +26 -1
  34. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/databricks.py +3 -3
  35. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/duckdb.py +52 -24
  36. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/exasol.py +1 -0
  37. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/hive.py +1 -2
  38. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/materialize.py +5 -0
  39. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/postgres.py +68 -3
  40. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/presto.py +23 -0
  41. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/redshift.py +4 -0
  42. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/snowflake.py +7 -2
  43. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/spark.py +7 -0
  44. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/spark2.py +10 -3
  45. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/sqlite.py +155 -38
  46. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/teradata.py +8 -0
  47. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/helper.py +18 -0
  48. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/annotate_types.py +19 -14
  49. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/helpers.py +19 -6
  50. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/qualify_columns.py +63 -4
  51. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/simplify.py +91 -45
  52. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/unnest_subqueries.py +14 -3
  53. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parser.py +105 -48
  54. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/databricks.py +17 -10
  55. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/drill.py +0 -2
  56. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/duckdb.py +12 -7
  57. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/hive.py +3 -1
  58. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/materialize.py +2 -0
  59. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/mysql.py +1 -0
  60. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/postgres.py +9 -7
  61. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/redshift.py +10 -1
  62. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/snowflake.py +27 -2
  63. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/sqlite.py +124 -12
  64. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/teradata.py +211 -57
  65. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/tokenizer_core.py +117 -9
  66. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/tokens.py +8 -1
  67. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/typing/__init__.py +1 -0
  68. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/typing/bigquery.py +7 -4
  69. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/typing/hive.py +1 -0
  70. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/typing/postgres.py +10 -0
  71. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/typing/redshift.py +10 -0
  72. {sqlglot-30.33.0 → sqlglot-30.34.0/sqlglot.egg-info}/PKG-INFO +8 -6
  73. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot.egg-info/requires.txt +2 -2
  74. sqlglot-30.34.0/sqlglot.egg-info/scm_version.json +8 -0
  75. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_athena.py +0 -6
  76. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_bigquery.py +43 -28
  77. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_clickhouse.py +6 -4
  78. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_databricks.py +51 -8
  79. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_dialect.py +52 -4
  80. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_duckdb.py +140 -16
  81. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_exasol.py +20 -10
  82. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_materialize.py +3 -2
  83. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_mysql.py +13 -5
  84. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_oracle.py +2 -0
  85. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_postgres.py +149 -16
  86. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_redshift.py +25 -13
  87. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_singlestore.py +0 -17
  88. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_snowflake.py +105 -18
  89. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_spark.py +40 -1
  90. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_sqlite.py +567 -6
  91. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_teradata.py +166 -7
  92. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_trino.py +58 -0
  93. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_tsql.py +0 -28
  94. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/identity.sql +0 -6
  95. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/annotate_functions.sql +0 -20
  96. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/annotate_types.sql +28 -0
  97. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/qualify_columns.sql +70 -0
  98. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +3 -0
  99. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/simplify.sql +83 -40
  100. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/unnest_subqueries.sql +12 -0
  101. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_anonymize.py +62 -0
  102. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_build.py +10 -0
  103. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_jsonpath.py +5 -0
  104. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_optimizer.py +82 -1
  105. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_parser.py +41 -0
  106. sqlglot-30.33.0/sqlglot.egg-info/scm_version.json +0 -8
  107. {sqlglot-30.33.0 → sqlglot-30.34.0}/.gitignore +0 -0
  108. {sqlglot-30.33.0 → sqlglot-30.34.0}/.gitmodules +0 -0
  109. {sqlglot-30.33.0 → sqlglot-30.34.0}/.gitpod.yml +0 -0
  110. {sqlglot-30.33.0 → sqlglot-30.34.0}/.pre-commit-config.yaml +0 -0
  111. {sqlglot-30.33.0 → sqlglot-30.34.0}/LICENSE +0 -0
  112. {sqlglot-30.33.0 → sqlglot-30.34.0}/MANIFEST.in +0 -0
  113. {sqlglot-30.33.0 → sqlglot-30.34.0}/Makefile +0 -0
  114. {sqlglot-30.33.0 → sqlglot-30.34.0}/pyproject.toml +0 -0
  115. {sqlglot-30.33.0 → sqlglot-30.34.0}/setup.cfg +0 -0
  116. {sqlglot-30.33.0 → sqlglot-30.34.0}/setup.py +0 -0
  117. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/__init__.py +0 -0
  118. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/__main__.py +0 -0
  119. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/_typing.py +0 -0
  120. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/__init__.py +0 -0
  121. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/athena.py +0 -0
  122. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/bigquery.py +0 -0
  123. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/dax.py +0 -0
  124. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/doris.py +0 -0
  125. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/dremio.py +0 -0
  126. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/drill.py +0 -0
  127. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/druid.py +0 -0
  128. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/dune.py +0 -0
  129. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/fabric.py +0 -0
  130. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/mysql.py +0 -0
  131. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/prql.py +0 -0
  132. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/singlestore.py +0 -0
  133. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/solr.py +0 -0
  134. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/spark.py +0 -0
  135. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/spark2.py +0 -0
  136. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/starrocks.py +0 -0
  137. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/tableau.py +0 -0
  138. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/teradata.py +0 -0
  139. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/trino.py +0 -0
  140. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/dialects/tsql.py +0 -0
  141. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/diff.py +0 -0
  142. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/errors.py +0 -0
  143. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/executor/__init__.py +0 -0
  144. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/executor/context.py +0 -0
  145. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/executor/env.py +0 -0
  146. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/executor/python.py +0 -0
  147. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/executor/table.py +0 -0
  148. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/expressions/__init__.py +0 -0
  149. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/expressions/aggregate.py +0 -0
  150. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/expressions/builders.py +0 -0
  151. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/expressions/ddl.py +0 -0
  152. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/expressions/functions.py +0 -0
  153. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/expressions/json.py +0 -0
  154. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/expressions/math.py +0 -0
  155. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/expressions/properties.py +0 -0
  156. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/__init__.py +0 -0
  157. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/athena.py +0 -0
  158. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/dax.py +0 -0
  159. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/doris.py +0 -0
  160. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/dremio.py +0 -0
  161. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/drill.py +0 -0
  162. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/druid.py +0 -0
  163. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/dune.py +0 -0
  164. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/fabric.py +0 -0
  165. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/mysql.py +0 -0
  166. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/oracle.py +0 -0
  167. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/prql.py +0 -0
  168. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/python.py +0 -0
  169. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/risingwave.py +0 -0
  170. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/singlestore.py +0 -0
  171. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/solr.py +0 -0
  172. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/starrocks.py +0 -0
  173. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/tableau.py +0 -0
  174. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/trino.py +0 -0
  175. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/generators/tsql.py +0 -0
  176. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/jsonpath.py +0 -0
  177. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/lineage.py +0 -0
  178. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/__init__.py +0 -0
  179. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/canonicalize.py +0 -0
  180. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/canonicalize_internal_names.py +0 -0
  181. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
  182. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/eliminate_joins.py +0 -0
  183. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
  184. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
  185. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/journal.py +0 -0
  186. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/merge_subqueries.py +0 -0
  187. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/normalize.py +0 -0
  188. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
  189. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/optimize_joins.py +0 -0
  190. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/optimizer.py +0 -0
  191. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/pushdown_predicates.py +0 -0
  192. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/pushdown_projections.py +0 -0
  193. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/qualify.py +0 -0
  194. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/qualify_tables.py +0 -0
  195. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/resolver.py +0 -0
  196. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/optimizer/scope.py +0 -0
  197. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/__init__.py +0 -0
  198. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/athena.py +0 -0
  199. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/base.py +0 -0
  200. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/bigquery.py +0 -0
  201. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/clickhouse.py +0 -0
  202. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/dax.py +0 -0
  203. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/doris.py +0 -0
  204. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/dremio.py +0 -0
  205. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/druid.py +0 -0
  206. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/dune.py +0 -0
  207. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/exasol.py +0 -0
  208. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/fabric.py +0 -0
  209. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/oracle.py +0 -0
  210. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/presto.py +0 -0
  211. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/prql.py +0 -0
  212. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/risingwave.py +0 -0
  213. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/singlestore.py +0 -0
  214. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/solr.py +0 -0
  215. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/spark.py +0 -0
  216. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/spark2.py +0 -0
  217. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/starrocks.py +0 -0
  218. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/tableau.py +0 -0
  219. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/trino.py +0 -0
  220. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/parsers/tsql.py +0 -0
  221. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/planner.py +0 -0
  222. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/py.typed +0 -0
  223. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/schema.py +0 -0
  224. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/serde.py +0 -0
  225. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/time.py +0 -0
  226. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/transforms.py +0 -0
  227. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/trie.py +0 -0
  228. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/typing/clickhouse.py +0 -0
  229. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/typing/databricks.py +0 -0
  230. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/typing/duckdb.py +0 -0
  231. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/typing/mysql.py +0 -0
  232. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/typing/presto.py +0 -0
  233. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/typing/snowflake.py +0 -0
  234. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/typing/spark.py +0 -0
  235. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/typing/spark2.py +0 -0
  236. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/typing/sqlite.py +0 -0
  237. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot/typing/tsql.py +0 -0
  238. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot.egg-info/SOURCES.txt +0 -0
  239. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot.egg-info/dependency_links.txt +0 -0
  240. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot.egg-info/scm_file_list.json +0 -0
  241. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot.egg-info/top_level.txt +0 -0
  242. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglot.png +0 -0
  243. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglotc/MANIFEST.in +0 -0
  244. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglotc/pyproject.toml +0 -0
  245. {sqlglot-30.33.0 → sqlglot-30.34.0}/sqlglotc/setup.py +0 -0
  246. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/__init__.py +0 -0
  247. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/__init__.py +0 -0
  248. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_dax.py +0 -0
  249. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_doris.py +0 -0
  250. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_dremio.py +0 -0
  251. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_drill.py +0 -0
  252. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_druid.py +0 -0
  253. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_dune.py +0 -0
  254. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_fabric.py +0 -0
  255. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_hive.py +0 -0
  256. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_pipe_syntax.py +0 -0
  257. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_presto.py +0 -0
  258. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_prql.py +0 -0
  259. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_risingwave.py +0 -0
  260. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_solr.py +0 -0
  261. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_starrocks.py +0 -0
  262. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/dialects/test_tableau.py +0 -0
  263. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/jsonpath/LICENSE +0 -0
  264. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/jsonpath/cts.json +0 -0
  265. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/canonicalize.sql +0 -0
  266. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/canonicalize_internal_names.sql +0 -0
  267. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
  268. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/eliminate_joins.sql +0 -0
  269. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
  270. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
  271. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
  272. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/normalize.sql +0 -0
  273. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
  274. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
  275. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/optimizer.sql +0 -0
  276. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
  277. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
  278. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/pushdown_projections.sql +0 -0
  279. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
  280. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
  281. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
  282. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
  283. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
  284. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
  285. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
  286. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
  287. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
  288. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
  289. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
  290. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
  291. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
  292. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
  293. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
  294. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
  295. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
  296. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
  297. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
  298. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
  299. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
  300. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
  301. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
  302. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
  303. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
  304. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
  305. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
  306. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
  307. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
  308. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
  309. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
  310. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
  311. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
  312. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
  313. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
  314. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
  315. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
  316. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
  317. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/partial.sql +0 -0
  318. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/fixtures/pretty.sql +0 -0
  319. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/gen_fixtures.py +0 -0
  320. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/helpers.py +0 -0
  321. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/leakcheck.py +0 -0
  322. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/sqlglot/__init__.py +0 -0
  323. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_dialect_entry_points.py +0 -0
  324. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_dialect_imports.py +0 -0
  325. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_diff.py +0 -0
  326. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_docs.py +0 -0
  327. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_errors.py +0 -0
  328. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_executor.py +0 -0
  329. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_expressions.py +0 -0
  330. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_generator.py +0 -0
  331. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_helper.py +0 -0
  332. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_integration_loader.py +0 -0
  333. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_lineage.py +0 -0
  334. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_optimize_cross_joins.py +0 -0
  335. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_schema.py +0 -0
  336. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_serde.py +0 -0
  337. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_simplify_between.py +0 -0
  338. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_sqlglotc.py +0 -0
  339. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_time.py +0 -0
  340. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_tokens.py +0 -0
  341. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_transforms.py +0 -0
  342. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_transpile.py +0 -0
  343. {sqlglot-30.33.0 → sqlglot-30.34.0}/tests/test_typing.py +0 -0
@@ -4,7 +4,7 @@
4
4
  SQLGlot is a no-dependency SQL parser, transpiler, optimizer, and engine written in pure Python. It supports 31+ SQL dialects and can transpile between them while preserving semantics. The codebase is performance-critical despite being pure Python, with an optional mypyc-compiled C extension for speed improvements (`sqlglotc/`).
5
5
 
6
6
  ## Development Commands
7
- Before contributing read CONTRIBUTING.md
7
+ Read [CONTRIBUTING.md](CONTRIBUTING.md) before contributing. Only maintainers submit pull requests. External contributors can report bugs and request features through GitHub issues.
8
8
 
9
9
  ### Installation
10
10
  ```bash
@@ -1,6 +1,55 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## [v30.33.0] - 2026-11-17
5
+ ### :boom: BREAKING CHANGES
6
+ - due to [`fe09eb5`](https://github.com/tobymao/sqlglot/commit/fe09eb5c2c7269acb908af083539d0aaeca25b93) - treat SHA1/SHA256/SHA512 as binary digests [CLAUDE] *(PR [#9156](https://github.com/tobymao/sqlglot/pull/9156) by [@DeepBuha06](https://github.com/DeepBuha06))*:
7
+
8
+ treat SHA1/SHA256/SHA512 as binary digests [CLAUDE] (#9156)
9
+
10
+
11
+ ### :sparkles: New Features
12
+ - [`80c7137`](https://github.com/tobymao/sqlglot/commit/80c71376aebf4bdd3fd0c271d54204482df217f0) - **bigquery**: infer POWER results from numeric operand types *(PR [#9089](https://github.com/tobymao/sqlglot/pull/9089) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
13
+ - [`3ac233c`](https://github.com/tobymao/sqlglot/commit/3ac233c54cb8db46480f4778b4c7b6fcaab43d40) - **presto**: parse FORMAT_DATETIME Joda formats into TimeToStr *(PR [#9096](https://github.com/tobymao/sqlglot/pull/9096) by [@VaggelisD](https://github.com/VaggelisD))*
14
+ - [`c86e605`](https://github.com/tobymao/sqlglot/commit/c86e6050891096ea0dde094acdf19e2051fc3d90) - **Databricks**: Infer type for Databricks Date_TRUNC, SEQUENCE-to-EXPLODE propagation *(PR [#9158](https://github.com/tobymao/sqlglot/pull/9158) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
15
+ - [`b8b7e82`](https://github.com/tobymao/sqlglot/commit/b8b7e827cdc8e547497718b10fceee4ea4fa5dcc) - **databricks**: parse OPTIMIZE with table parser *(PR [#9164](https://github.com/tobymao/sqlglot/pull/9164) by [@Walkeer](https://github.com/Walkeer))*
16
+
17
+ ### :bug: Bug Fixes
18
+ - [`1d064df`](https://github.com/tobymao/sqlglot/commit/1d064dfb3fcb3cbc84106def136b6743340d5d1e) - **optimizer**: wrap merged projections used as the operand of IN / BETWEEN [CLAUDE] *(PR [#9139](https://github.com/tobymao/sqlglot/pull/9139) by [@arpangupta1805](https://github.com/arpangupta1805))*
19
+ - :arrow_lower_right: *fixes issue [#9138](https://github.com/tobymao/sqlglot/issues/9138) opened by [@arpangupta1805](https://github.com/arpangupta1805)*
20
+ - [`3194cf8`](https://github.com/tobymao/sqlglot/commit/3194cf84505461c5e5e0b80f089f9ddb504e772f) - **duckdb**: honor binary POSITION start offsets [CODEX] *(PR [#9145](https://github.com/tobymao/sqlglot/pull/9145) by [@krish-goradia](https://github.com/krish-goradia))*
21
+ - [`3159964`](https://github.com/tobymao/sqlglot/commit/315996469760c7034d37d1ca74e3facecef89896) - **postgres**: generate CARDINALITY for ArraySize without a dimension [CLAUDE] *(PR [#9157](https://github.com/tobymao/sqlglot/pull/9157) by [@EnesSoydan](https://github.com/EnesSoydan))*
22
+ - [`fe09eb5`](https://github.com/tobymao/sqlglot/commit/fe09eb5c2c7269acb908af083539d0aaeca25b93) - **clickhouse**: treat SHA1/SHA256/SHA512 as binary digests [CLAUDE] *(PR [#9156](https://github.com/tobymao/sqlglot/pull/9156) by [@DeepBuha06](https://github.com/DeepBuha06))*
23
+ - [`2359d11`](https://github.com/tobymao/sqlglot/commit/2359d11a233680ae9e9b7f8162377fe90ff99af6) - **hive**: handle MILLISECOND and MICROSECOND in DATEADD *(PR [#9161](https://github.com/tobymao/sqlglot/pull/9161) by [@saanvimundra](https://github.com/saanvimundra))*
24
+ - :arrow_lower_right: *fixes issue [#9160](https://github.com/tobymao/sqlglot/issues/9160) opened by [@saanvimundra](https://github.com/saanvimundra)*
25
+ - [`9ffdd7b`](https://github.com/tobymao/sqlglot/commit/9ffdd7bef97bcf59af1743fc72e28571c2d2ff08) - **sqlite**: translate week date arithmetic to days [CODEX] *(PR [#9168](https://github.com/tobymao/sqlglot/pull/9168) by [@prathamchoksi](https://github.com/prathamchoksi))*
26
+ - :arrow_lower_right: *fixes issue [#9167](https://github.com/tobymao/sqlglot/issues/9167) opened by [@prathamchoksi](https://github.com/prathamchoksi)*
27
+ - [`4d1409c`](https://github.com/tobymao/sqlglot/commit/4d1409c334d51ce508c5969c93ae8881301ddbbd) - **sqlite**: use DATETIME for sub-day DATE_ADD/DATE_SUB units *(PR [#9155](https://github.com/tobymao/sqlglot/pull/9155) by [@akchhayasharma](https://github.com/akchhayasharma))*
28
+ - :arrow_lower_right: *fixes issue [#9150](https://github.com/tobymao/sqlglot/issues/9150) opened by [@prathamchoksi](https://github.com/prathamchoksi)*
29
+ - [`2a2d341`](https://github.com/tobymao/sqlglot/commit/2a2d341d3eb8dcbc07f312a49821ff96f44ba346) - **sqlite**: preserve empty UNICODE results in DuckDB *(PR [#9175](https://github.com/tobymao/sqlglot/pull/9175) by [@georgesittas](https://github.com/georgesittas))*
30
+ - :arrow_lower_right: *fixes issue [#9172](https://github.com/tobymao/sqlglot/issues/9172) opened by [@vanshbarfiwala-lgtm](https://github.com/vanshbarfiwala-lgtm)*
31
+ - [`0142578`](https://github.com/tobymao/sqlglot/commit/0142578dc440257299a36706167d890fe83b9d13) - **hive**: map SSS to milliseconds in Hive/Spark time formats *(PR [#9173](https://github.com/tobymao/sqlglot/pull/9173) by [@dayan02dev](https://github.com/dayan02dev))*
32
+ - [`c521a7c`](https://github.com/tobymao/sqlglot/commit/c521a7cc2b63c845fe3232b0fafddcb17bfbc360) - **optimizer**: respect join ordering during predicate pushdown *(commit by [@treysp](https://github.com/treysp))*
33
+ - [`307245f`](https://github.com/tobymao/sqlglot/commit/307245faf60c0b00c03368558a5482502635e750) - **sqlite**: preserve negative ROUND precision in DuckDB *(PR [#9174](https://github.com/tobymao/sqlglot/pull/9174) by [@georgesittas](https://github.com/georgesittas))*
34
+ - :arrow_lower_right: *fixes issue [#9159](https://github.com/tobymao/sqlglot/issues/9159) opened by [@vanshbarfiwala-lgtm](https://github.com/vanshbarfiwala-lgtm)*
35
+ - [`30e99f7`](https://github.com/tobymao/sqlglot/commit/30e99f7b6b97dfc4c6da83d40655413f001c7aeb) - **optimizer**: preserve correlated column references when merging subqueries *(PR [#9051](https://github.com/tobymao/sqlglot/pull/9051) by [@treysp](https://github.com/treysp))*
36
+ - [`8ceabf8`](https://github.com/tobymao/sqlglot/commit/8ceabf87854bb55297f01c51864c8fbc1e8f7795) - **sqlite**: preserve integer RANDOM semantics in DuckDB *(PR [#9177](https://github.com/tobymao/sqlglot/pull/9177) by [@georgesittas](https://github.com/georgesittas))*
37
+ - :arrow_lower_right: *fixes issue [#9163](https://github.com/tobymao/sqlglot/issues/9163) opened by [@vanshbarfiwala-lgtm](https://github.com/vanshbarfiwala-lgtm)*
38
+ - [`b9688a1`](https://github.com/tobymao/sqlglot/commit/b9688a13d249fd95edf83b7c7862b6846c088abf) - **duckdb**: distinguish printf and brace formatting [CODEX] *(PR [#9176](https://github.com/tobymao/sqlglot/pull/9176) by [@georgesittas](https://github.com/georgesittas))*
39
+ - :arrow_lower_right: *fixes issue [#9112](https://github.com/tobymao/sqlglot/issues/9112) opened by [@bardrop](https://github.com/bardrop)*
40
+ - [`8897257`](https://github.com/tobymao/sqlglot/commit/88972576a2d84ccdd9dcff25279a016d4e08071c) - **optimizer**: apply star REPLACE / RENAME to USING join columns [CLAUDE] *(PR [#9170](https://github.com/tobymao/sqlglot/pull/9170) by [@arpangupta1805](https://github.com/arpangupta1805))*
41
+ - :arrow_lower_right: *fixes issue [#9169](https://github.com/tobymao/sqlglot/issues/9169) opened by [@arpangupta1805](https://github.com/arpangupta1805)*
42
+ - [`0936dbe`](https://github.com/tobymao/sqlglot/commit/0936dbe9192a3b57c6e6992acfcb93d4b429c51f) - **optimizer**: preserve scalar subqueries in predicates [CODEX] *(PR [#9171](https://github.com/tobymao/sqlglot/pull/9171) by [@hector2394](https://github.com/hector2394))*
43
+ - :arrow_lower_right: *fixes issue [#9148](https://github.com/tobymao/sqlglot/issues/9148) opened by [@arpangupta1805](https://github.com/arpangupta1805)*
44
+
45
+ ### :recycle: Refactors
46
+ - [`1a6309a`](https://github.com/tobymao/sqlglot/commit/1a6309ade5b784e79033b924e55884a9545395f0) - **databricks**: inherit Optimize argument defaults *(commit by [@georgesittas](https://github.com/georgesittas))*
47
+
48
+ ### :wrench: Chores
49
+ - [`024134c`](https://github.com/tobymao/sqlglot/commit/024134c6691f5b6cb97b29d9e227f3343021f032) - **optimizer**: simplify merge_subqueries wrap check, test OR under AND *(commit by [@geooo109](https://github.com/geooo109))*
50
+ - [`b9c408b`](https://github.com/tobymao/sqlglot/commit/b9c408ba1fdf50de5f07ba97818db1baa7a60688) - **optimizer**: drop redundant SAFE_TO_REPLACE_UNWRAPPED comment *(commit by [@geooo109](https://github.com/geooo109))*
51
+
52
+
4
53
  ## [v30.32.0] - 2026-11-16
5
54
  ### :sparkles: New Features
6
55
  - [`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))*
@@ -16848,3 +16897,4 @@ pip install "sqlglot[c]" # compiled — faster, but no subclassing
16848
16897
  [v30.30.0]: https://github.com/tobymao/sqlglot/compare/v30.29.0...v30.30.0
16849
16898
  [v30.31.0]: https://github.com/tobymao/sqlglot/compare/v30.30.0...v30.31.0
16850
16899
  [v30.32.0]: https://github.com/tobymao/sqlglot/compare/v30.31.0...v30.32.0
16900
+ [v30.33.0]: https://github.com/tobymao/sqlglot/compare/v30.32.0...v30.33.0
@@ -4,7 +4,7 @@
4
4
  SQLGlot is a no-dependency SQL parser, transpiler, optimizer, and engine written in pure Python. It supports 31+ SQL dialects and can transpile between them while preserving semantics. The codebase is performance-critical despite being pure Python, with an optional mypyc-compiled C extension for speed improvements (`sqlglotc/`).
5
5
 
6
6
  ## Development Commands
7
- Before contributing read CONTRIBUTING.md
7
+ Read [CONTRIBUTING.md](CONTRIBUTING.md) before contributing. Only maintainers submit pull requests. External contributors can report bugs and request features through GitHub issues.
8
8
 
9
9
  ### Installation
10
10
  ```bash
@@ -7,14 +7,14 @@ easy and transparent as possible, whether it's:
7
7
 
8
8
  - Reporting a bug
9
9
  - Discussing the current state of the code
10
- - Submitting a fix
10
+ - Suggesting a fix
11
11
  - Proposing new features
12
12
 
13
13
  ## We develop with GitHub
14
14
 
15
- We use GitHub to host code, to track issues and feature requests, as well as accept pull requests.
15
+ SQLGlot accepts pull requests only from maintainers. Anyone can [open an issue](https://github.com/tobymao/sqlglot/issues/new/choose) to report a bug, suggest a fix, or request a feature. The core team decides which issues to take on based on project priorities.
16
16
 
17
- ## Finding tasks to work on
17
+ ## Finding tasks to work on (maintainers only)
18
18
 
19
19
  When the core SQLGlot team does not plan to work on an issue, it is usually closed as "not planned". This may happen
20
20
  when a request is exceptionally difficult to address, or because the team deems that it shouldn't be prioritized.
@@ -25,9 +25,7 @@ need guidance, feel free to ask for clarifications.
25
25
 
26
26
  Before taking on a task, consider studying the [AST primer](https://github.com/tobymao/sqlglot/blob/main/posts/ast_primer.md) and the [onboarding document](https://github.com/tobymao/sqlglot/blob/main/posts/onboarding.md).
27
27
 
28
- ## Submitting code changes
29
-
30
- Pull requests are the best way to propose changes to the codebase, and we actively welcome them.
28
+ ## Submitting code changes (maintainers only)
31
29
 
32
30
  Pull requests should be small and they need to follow the conventions of the project. For features that require
33
31
  many changes, please reach out to us on [Slack](https://tobikodata.com/slack) before making a request, in order
@@ -63,7 +61,7 @@ Our policy:
63
61
  - **Disclose LLM use.** Human contributors who used an LLM are encouraged to mention it in a disclaimer.
64
62
  - **Write the PR description yourself.** Keep it concise and human-written; a few clear sentences without
65
63
  emojis summaries and restatements of the diff are worth more than a wall of text.
66
- - **If you are a new contributor, prefer opening an issue over a PR.** We are interested in growing
64
+ - **If you are an external contributor, open an issue.** We are interested in growing
67
65
  long-term contributors who genuinely understand the codebase. If you have found a bug or have a fix in
68
66
  mind, open a well-written issue with a reproducible example (see below). The core team can usually
69
67
  address it faster and more accurately than it takes to review an AI-generated PR.
@@ -86,11 +84,9 @@ We use GitHub issues to track public bugs. Report a bug by opening a new issue.
86
84
  - Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)
87
85
  - References (e.g. documentation pages related to the issue)
88
86
 
89
- ## Start a discussion using GitHub's [discussions](https://github.com/tobymao/sqlglot/discussions)
87
+ ## Request a feature
90
88
 
91
- [We use GitHub discussions](https://github.com/tobymao/sqlglot/discussions/190) to discuss about the current state
92
- of the code. If you want to propose a new feature, this is the right place to do it. Just start a discussion, and
93
- let us know why you think this feature would be a good addition to SQLGlot (by possibly including some usage examples).
89
+ To propose a feature, [open an issue](https://github.com/tobymao/sqlglot/issues/new/choose) explaining why it would be a good addition to SQLGlot. Include a usage example if you can.
94
90
 
95
91
  ## Deployment (maintainers only)
96
92
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlglot
3
- Version: 30.33.0
3
+ Version: 30.34.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.33.0; python_version >= "3.10" and extra == "c"
37
+ Requires-Dist: sqlglotc==30.34.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.33.0; python_version >= "3.10" and extra == "rs"
40
+ Requires-Dist: sqlglotc==30.34.0; python_version >= "3.10" and extra == "rs"
41
41
  Dynamic: license-file
42
42
  Dynamic: provides-extra
43
43
 
@@ -53,7 +53,9 @@ SQLGlot can detect a variety of [syntax errors](#parser-errors), such as unbalan
53
53
 
54
54
  Learn more about SQLGlot in the API [documentation](https://sqlglot.com/) and the expression tree [primer](https://github.com/tobymao/sqlglot/blob/main/posts/ast_primer.md).
55
55
 
56
- Contributions are very welcome in SQLGlot; read the [contribution guide](https://github.com/tobymao/sqlglot/blob/main/CONTRIBUTING.md) and the [onboarding document](https://github.com/tobymao/sqlglot/blob/main/posts/onboarding.md) to get started!
56
+ SQLGlot now accepts pull requests only from maintainers. Reviewing the growing volume of LLM-generated pull requests was taking time away from fixing bugs and improving SQLGlot.
57
+
58
+ You can still contribute by [opening an issue](https://github.com/tobymao/sqlglot/issues/new/choose) to report a bug or request a feature. The core team decides which issues to take on and which to close as "not planned" based on project priorities. See the [contribution guide](https://github.com/tobymao/sqlglot/blob/main/CONTRIBUTING.md) for help writing a report.
57
59
 
58
60
  ## Table of Contents
59
61
 
@@ -326,7 +328,7 @@ sqlglot.errors.UnsupportedError: Argument 'accuracy' is not supported for expres
326
328
 
327
329
  Some queries need additional information to be transpiled accurately, such as the schemas of the referenced tables. This is because certain transformations are type-sensitive and depend on type inference. The `qualify` and `annotate_types` optimizer [rules](https://github.com/tobymao/sqlglot/tree/main/sqlglot/optimizer) can provide this information, but they are not used by default because they add overhead and complexity.
328
330
 
329
- Transpilation is a hard problem, so SQLGlot solves it incrementally. Some dialect pairs may lack support for certain inputs, but coverage improves over time. We highly appreciate well-documented and tested issues or PRs, so feel free to [reach out](#get-in-touch) if you need guidance!
331
+ Transpilation is a hard problem, so SQLGlot solves it incrementally. Some dialect pairs may lack support for certain inputs, but coverage improves over time. If a translation is incorrect, please [open an issue](https://github.com/tobymao/sqlglot/issues/new/choose) with the input SQL, the source and target dialects, and the output you expected.
330
332
 
331
333
  ### Build and Modify SQL
332
334
 
@@ -681,7 +683,7 @@ Without dateutil, the optimizer leaves this arithmetic unevaluated.
681
683
 
682
684
  **Official Dialects** are maintained by the core SQLGlot team with higher priority for bug fixes and feature additions.
683
685
 
684
- **Community Dialects** are developed and maintained primarily through community contributions. These are fully functional but may receive lower priority for issue resolution compared to officially supported dialects. We welcome and encourage community contributions to improve these dialects.
686
+ **Community Dialects** grew out of community contributions. These are fully functional but may receive lower priority for issue resolution compared to officially supported dialects. We welcome bug reports and feature requests for these dialects.
685
687
 
686
688
  **Plugin Dialects** (supported since v28.6.0) are third-party dialects developed and maintained in external repositories by independent contributors. These dialects are not part of the SQLGlot codebase and are distributed as separate packages. The SQLGlot team does not provide support or maintenance for plugin dialects — please direct any issues or feature requests to their respective repositories. See [Creating a Dialect Plugin](#creating-a-dialect-plugin) below for information on how to build your own.
687
689
 
@@ -10,7 +10,9 @@ SQLGlot can detect a variety of [syntax errors](#parser-errors), such as unbalan
10
10
 
11
11
  Learn more about SQLGlot in the API [documentation](https://sqlglot.com/) and the expression tree [primer](https://github.com/tobymao/sqlglot/blob/main/posts/ast_primer.md).
12
12
 
13
- Contributions are very welcome in SQLGlot; read the [contribution guide](https://github.com/tobymao/sqlglot/blob/main/CONTRIBUTING.md) and the [onboarding document](https://github.com/tobymao/sqlglot/blob/main/posts/onboarding.md) to get started!
13
+ SQLGlot now accepts pull requests only from maintainers. Reviewing the growing volume of LLM-generated pull requests was taking time away from fixing bugs and improving SQLGlot.
14
+
15
+ You can still contribute by [opening an issue](https://github.com/tobymao/sqlglot/issues/new/choose) to report a bug or request a feature. The core team decides which issues to take on and which to close as "not planned" based on project priorities. See the [contribution guide](https://github.com/tobymao/sqlglot/blob/main/CONTRIBUTING.md) for help writing a report.
14
16
 
15
17
  ## Table of Contents
16
18
 
@@ -283,7 +285,7 @@ sqlglot.errors.UnsupportedError: Argument 'accuracy' is not supported for expres
283
285
 
284
286
  Some queries need additional information to be transpiled accurately, such as the schemas of the referenced tables. This is because certain transformations are type-sensitive and depend on type inference. The `qualify` and `annotate_types` optimizer [rules](https://github.com/tobymao/sqlglot/tree/main/sqlglot/optimizer) can provide this information, but they are not used by default because they add overhead and complexity.
285
287
 
286
- Transpilation is a hard problem, so SQLGlot solves it incrementally. Some dialect pairs may lack support for certain inputs, but coverage improves over time. We highly appreciate well-documented and tested issues or PRs, so feel free to [reach out](#get-in-touch) if you need guidance!
288
+ Transpilation is a hard problem, so SQLGlot solves it incrementally. Some dialect pairs may lack support for certain inputs, but coverage improves over time. If a translation is incorrect, please [open an issue](https://github.com/tobymao/sqlglot/issues/new/choose) with the input SQL, the source and target dialects, and the output you expected.
287
289
 
288
290
  ### Build and Modify SQL
289
291
 
@@ -638,7 +640,7 @@ Without dateutil, the optimizer leaves this arithmetic unevaluated.
638
640
 
639
641
  **Official Dialects** are maintained by the core SQLGlot team with higher priority for bug fixes and feature additions.
640
642
 
641
- **Community Dialects** are developed and maintained primarily through community contributions. These are fully functional but may receive lower priority for issue resolution compared to officially supported dialects. We welcome and encourage community contributions to improve these dialects.
643
+ **Community Dialects** grew out of community contributions. These are fully functional but may receive lower priority for issue resolution compared to officially supported dialects. We welcome bug reports and feature requests for these dialects.
642
644
 
643
645
  **Plugin Dialects** (supported since v28.6.0) are third-party dialects developed and maintained in external repositories by independent contributors. These dialects are not part of the SQLGlot codebase and are distributed as separate packages. The SQLGlot team does not provide support or maintenance for plugin dialects — please direct any issues or feature requests to their respective repositories. See [Creating a Dialect Plugin](#creating-a-dialect-plugin) below for information on how to build your own.
644
646
 
@@ -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.33.0'
22
- __version_tuple__ = version_tuple = (30, 33, 0)
21
+ __version__ = version = '30.34.0'
22
+ __version_tuple__ = version_tuple = (30, 34, 0)
23
23
 
24
- __commit_id__ = commit_id = 'g0936dbe91'
24
+ __commit_id__ = commit_id = 'g4caae634b'
@@ -21,6 +21,7 @@ ANONYMIZED_TYPES = {
21
21
  TokenType.RAW_STRING,
22
22
  TokenType.STRING,
23
23
  TokenType.UNICODE_STRING,
24
+ TokenType.UNICODE_IDENTIFIER,
24
25
  TokenType.VAR,
25
26
  }
26
27
  QUOTED_TYPES = ANONYMIZED_TYPES - {TokenType.NUMBER, TokenType.VAR}
@@ -152,8 +153,9 @@ def render(sql: str, tokens: list[Token], dialect: DialectType = None) -> str:
152
153
 
153
154
  result = []
154
155
  prev = 0
156
+ uescape_alias = ""
155
157
 
156
- for token in tokens:
158
+ for i, token in enumerate(tokens):
157
159
  result.append(_redact(sql[prev : token.start], comments, nested))
158
160
  prev = token.end + 1
159
161
  span = sql[token.start : prev]
@@ -162,6 +164,13 @@ def render(sql: str, tokens: list[Token], dialect: DialectType = None) -> str:
162
164
  result.append(token.text)
163
165
  elif token.token_type in ANONYMIZED_TYPES:
164
166
  result.append(_fit(span, token.text, quotes, token.token_type))
167
+ elif token.token_type == TokenType.UESCAPE:
168
+ if token.text.upper() == "UESCAPE":
169
+ uescape_alias = tokens[i - 1].text
170
+ elif token.text and token.text in uescape_alias:
171
+ # Keep the alias literal when it contains the clause's escape character.
172
+ span = "'!'".ljust(len(span))
173
+ result.append(span)
165
174
  else:
166
175
  result.append(span)
167
176
 
@@ -251,6 +260,8 @@ def _fit(span: str, alias: str, quotes: list[tuple[str, str]], token_type: Token
251
260
  break
252
261
 
253
262
  width = len(span) - start - end
263
+ if token_type == TokenType.IDENTIFIER and end and len(alias) < width:
264
+ return (span[:start] + alias + span[-end:]).ljust(len(span))
254
265
  pad = "0" if token_type == TokenType.NUMBER else "a"
255
266
 
256
267
  return span[:start] + alias[:width].rjust(width, pad) + span[len(span) - end :]
@@ -16,9 +16,11 @@ class ClickHouse(Dialect):
16
16
  INDEX_OFFSET = 1
17
17
  NORMALIZE_FUNCTIONS: bool | str = False
18
18
  NULL_ORDERING = "nulls_are_last"
19
+ SUPPORTS_ORDER_BY_ALL = True
19
20
  SUPPORTS_USER_DEFINED_TYPES = False
20
21
  LOG_BASE_FIRST: bool | None = None
21
22
  FORCE_EARLY_ALIAS_REF_EXPANSION = True
23
+ PREFER_PROJECTION_ALIASES_IN_DOT_PATHS = True
22
24
  ORIGINAL_NAME_META_KEY = "clickhouse_name"
23
25
  NUMBERS_CAN_BE_UNDERSCORE_SEPARATED = True
24
26
  IDENTIFIERS_CAN_START_WITH_DIGIT = True
@@ -33,6 +33,7 @@ class Databricks(Spark):
33
33
  class Tokenizer(Spark.Tokenizer):
34
34
  KEYWORDS = {
35
35
  **Spark.Tokenizer.KEYWORDS,
36
+ "?::": TokenType.QDCOLON,
36
37
  "MATCH_RECOGNIZE": TokenType.MATCH_RECOGNIZE,
37
38
  "OPTIMIZE": TokenType.OPTIMIZE,
38
39
  "STREAM": TokenType.STREAM,
@@ -18,6 +18,7 @@ from sqlglot.generator import Generator, unsupported_args
18
18
  from sqlglot.expressions import apply_index_offset
19
19
  from sqlglot.helper import (
20
20
  AutoName,
21
+ find_new_name,
21
22
  flatten,
22
23
  is_int,
23
24
  seq_get,
@@ -610,6 +611,9 @@ class Dialect(metaclass=_Dialect):
610
611
  to "WHERE id = 1 GROUP BY id HAVING id = 1"
611
612
  """
612
613
 
614
+ PREFER_PROJECTION_ALIASES_IN_DOT_PATHS = False
615
+ """Whether `obj.field` prefers a projection alias named `obj` over a source column of the same name."""
616
+
613
617
  EXPAND_ONLY_GROUP_ALIAS_REF = False
614
618
  """Whether alias reference expansion before qualification should only happen for the GROUP BY clause."""
615
619
 
@@ -622,6 +626,9 @@ class Dialect(metaclass=_Dialect):
622
626
  regardless of their clause's expression precedence.
623
627
  """
624
628
 
629
+ GROUP_BY_ALL_HAVING_MIN_VERSION: t.ClassVar[tuple[int, ...] | None] = None
630
+ """First version where implicit GROUP BY ALL columns take precedence over HAVING aliases."""
631
+
625
632
  ANNOTATE_ALL_SCOPES = False
626
633
  """Whether to annotate all scopes during optimization. Used by BigQuery for UNNEST support."""
627
634
 
@@ -660,6 +667,9 @@ class Dialect(metaclass=_Dialect):
660
667
  Whether LIMIT ALL is supported (equivalent to no limit) as in Postgres.
661
668
  """
662
669
 
670
+ SUPPORTS_UPDATE_OR = False
671
+ """Whether UPDATE accepts an OR conflict resolution algorithm before the table name."""
672
+
663
673
  PROJECTION_ALIASES_SHADOW_SOURCE_NAMES = False
664
674
  """
665
675
  Whether projection alias names can shadow table/source names in GROUP BY and HAVING clauses.
@@ -791,6 +801,9 @@ class Dialect(metaclass=_Dialect):
791
801
  table NULLs differently in this context.
792
802
  """
793
803
 
804
+ FOLD_MIXED_TEMPORAL_COMPARISONS = True
805
+ """Whether to compare literals of different temporal types as datetimes during simplification."""
806
+
794
807
  HAS_DISTINCT_ARRAY_CONSTRUCTORS = False
795
808
  """
796
809
  Whether the ARRAY constructor is context-sensitive, i.e in Redshift ARRAY[1, 2, 3] != ARRAY(1, 2, 3)
@@ -819,6 +832,9 @@ class Dialect(metaclass=_Dialect):
819
832
  ARRAY_FUNCS_PROPAGATES_NULLS = False
820
833
  """Whether Array update functions return NULL when the input array is NULL."""
821
834
 
835
+ ARRAY_REMOVE_PROPAGATES_NULLS = False
836
+ """Whether ARRAY_REMOVE returns NULL when the removal value is NULL."""
837
+
822
838
  PROMOTE_TO_INFERRED_DATETIME_TYPE = False
823
839
  """
824
840
  This flag is used in the optimizer's canonicalize rule and determines whether x will be promoted
@@ -1521,6 +1537,7 @@ def no_pivot_sql(self: Generator, expression: exp.Pivot) -> str:
1521
1537
 
1522
1538
 
1523
1539
  def no_trycast_sql(self: Generator, expression: exp.TryCast) -> str:
1540
+ self.unsupported("TRY_CAST is unsupported. CAST may not return NULL on conversion failure.")
1524
1541
  return self.cast_sql(expression)
1525
1542
 
1526
1543
 
@@ -2738,9 +2755,24 @@ def array_compact_sql(self: Generator, expression: exp.ArrayCompact) -> str:
2738
2755
  )
2739
2756
 
2740
2757
 
2741
- def remove_from_array_using_filter(self: Generator, expression: exp.ArrayRemove) -> str:
2742
- lambda_id = exp.to_identifier("_u")
2743
- cond = exp.NEQ(this=lambda_id, expression=expression.expression)
2758
+ def remove_from_array_using_filter(
2759
+ self: Generator,
2760
+ expression: exp.ArrayRemove,
2761
+ *,
2762
+ keep: t.Callable[[exp.Identifier, exp.Expr], exp.Expr] | None = None,
2763
+ supports_nullable_arrays: bool = True,
2764
+ ) -> str:
2765
+ removal_value = expression.expression
2766
+ lambda_id = exp.to_identifier(
2767
+ find_new_name({i.name.lower() for i in removal_value.find_all(exp.Identifier)}, "_u")
2768
+ )
2769
+ if isinstance(removal_value, (exp.Predicate, exp.Connector, exp.Not)):
2770
+ removal_value = exp.paren(removal_value)
2771
+ cond = (
2772
+ keep(lambda_id, removal_value)
2773
+ if keep
2774
+ else exp.NullSafeNEQ(this=lambda_id, expression=removal_value)
2775
+ )
2744
2776
 
2745
2777
  filter_sql = self.sql(
2746
2778
  exp.ArrayFilter(
@@ -2749,28 +2781,22 @@ def remove_from_array_using_filter(self: Generator, expression: exp.ArrayRemove)
2749
2781
  )
2750
2782
  )
2751
2783
 
2752
- # Handle NULL propagation for ArrayRemove
2753
- source_null_propagation = bool(expression.args.get("null_propagation"))
2754
- target_null_propagation = self.dialect.ARRAY_FUNCS_PROPAGATES_NULLS
2755
-
2756
- # Source propagates NULLs (Snowflake), target doesn't (DuckDB):
2757
- # When removal value is NULL, return NULL instead of applying filter
2758
- if source_null_propagation and not target_null_propagation:
2759
- removal_value = expression.expression
2784
+ if expression.args.get("null_propagation"):
2785
+ operand = removal_value.unnest()
2786
+ if isinstance(operand, (exp.Literal, exp.Boolean, exp.Array)):
2787
+ return filter_sql
2760
2788
 
2761
- # Optimization: skip wrapper if removal value is a non-NULL literal
2762
- # (e.g., 5, 'a', TRUE) or an array literal (e.g., [1, 2])
2763
- if (
2764
- isinstance(removal_value, exp.Literal) and not isinstance(removal_value, exp.Null)
2765
- ) or isinstance(removal_value, exp.Array):
2789
+ while isinstance(operand, exp.Neg):
2790
+ operand = operand.this.unnest()
2791
+ if operand.is_number:
2766
2792
  return filter_sql
2767
2793
 
2768
- return self.sql(
2769
- exp.If(
2770
- this=exp.Is(this=removal_value, expression=exp.Null()),
2771
- true=exp.Null(),
2772
- false=filter_sql,
2794
+ if supports_nullable_arrays:
2795
+ return self.sql(
2796
+ exp.If(this=removal_value.is_(exp.null()), true=exp.null(), false=filter_sql)
2773
2797
  )
2798
+ self.unsupported(
2799
+ "ClickHouse cannot return a NULL array when the ARRAY_REMOVE target is NULL"
2774
2800
  )
2775
2801
 
2776
2802
  return filter_sql
@@ -29,6 +29,7 @@ class DuckDB(Dialect):
29
29
  exp.Order: AliasPrecedence.MERGED_SOURCE,
30
30
  exp.Qualify: AliasPrecedence.SOURCE,
31
31
  }
32
+ GROUP_BY_ALL_HAVING_MIN_VERSION = (2, 0, 1)
32
33
  SUPPORTS_FIXED_SIZE_ARRAYS = True
33
34
  TABLES_REFERENCEABLE_AS_COLUMNS = True
34
35
  QUERY_RESULTS_ARE_STRUCTS = True
@@ -58,6 +58,7 @@ class Exasol(Dialect):
58
58
  # https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/if.htm
59
59
  "ENDIF": TokenType.END,
60
60
  "LONG VARCHAR": TokenType.TEXT,
61
+ "HASHTYPE": TokenType.HASHTYPE,
61
62
  "REGEXP_LIKE": TokenType.RLIKE,
62
63
  "SEPARATOR": TokenType.SEPARATOR,
63
64
  "SYSTIMESTAMP": TokenType.SYSTIMESTAMP,
@@ -27,6 +27,7 @@ class Hive(Dialect):
27
27
  }
28
28
  CONCAT_WS_COALESCE = True
29
29
  ARRAY_AGG_INCLUDES_NULLS = None
30
+ ARRAY_REMOVE_PROPAGATES_NULLS = True
30
31
  REGEXP_EXTRACT_DEFAULT_GROUP = 1
31
32
  ALTER_TABLE_SUPPORTS_CASCADE = True
32
33
  INTERSECT_BINDS_TIGHTER_THAN_UNION_AND_EXCEPT = False
@@ -11,6 +11,7 @@ class Materialize(Postgres):
11
11
  UNESCAPED_SEQUENCES = {"\\a": "a", "\\v": "v"}
12
12
 
13
13
  class Tokenizer(Postgres.Tokenizer):
14
+ UNICODE_IDENTIFIERS = []
14
15
  NUMERIC_ESCAPES = {"u": (16, 4, 4, 0xFFFF), "U": (16, 8, 8, 0x10FFFF)}
15
16
 
16
17
  Parser = MaterializeParser
@@ -113,7 +113,6 @@ class Oracle(Dialect):
113
113
  "SAMPLE": TokenType.TABLE_SAMPLE,
114
114
  "START": TokenType.BEGIN,
115
115
  "SUBPARTITION": TokenType.PARTITION,
116
- "TOP": TokenType.TOP,
117
116
  "VARCHAR2": TokenType.VARCHAR,
118
117
  "SYSTIMESTAMP": TokenType.SYSTIMESTAMP,
119
118
  }
@@ -95,6 +95,7 @@ class Postgres(Dialect):
95
95
  HEX_STRINGS = [("x'", "'"), ("X'", "'")]
96
96
  BYTE_STRINGS = [("e'", "'"), ("E'", "'")]
97
97
  UNICODE_STRINGS = [("U&'", "'"), ("u&'", "'")]
98
+ UNICODE_IDENTIFIERS = [('U&"', '"'), ('u&"', '"')]
98
99
  BYTE_STRING_ESCAPES = ["'", "\\"]
99
100
  HEREDOC_STRINGS = ["$"]
100
101
 
@@ -119,13 +120,17 @@ class Postgres(Dialect):
119
120
  "BEGIN": TokenType.BEGIN,
120
121
  "BIGSERIAL": TokenType.BIGSERIAL,
121
122
  "CSTRING": TokenType.PSEUDO_TYPE,
123
+ "DEALLOCATE": TokenType.COMMAND,
122
124
  "DECLARE": TokenType.COMMAND,
125
+ "DISCARD": TokenType.COMMAND,
123
126
  "DO": TokenType.COMMAND,
124
127
  "EXEC": TokenType.COMMAND,
125
128
  "HSTORE": TokenType.HSTORE,
126
129
  "INT8": TokenType.BIGINT,
130
+ "LISTEN": TokenType.COMMAND,
127
131
  "MONEY": TokenType.MONEY,
128
132
  "NAME": TokenType.NAME,
133
+ "NOTIFY": TokenType.COMMAND,
129
134
  "OID": TokenType.OBJECT_IDENTIFIER,
130
135
  "ONLY": TokenType.ONLY,
131
136
  "POINT": TokenType.POINT,
@@ -136,6 +141,7 @@ class Postgres(Dialect):
136
141
  "SMALLSERIAL": TokenType.SMALLSERIAL,
137
142
  "TEMP": TokenType.TEMPORARY,
138
143
  "TYPE": TokenType.TYPE,
144
+ "UNLISTEN": TokenType.COMMAND,
139
145
  "REGCLASS": TokenType.OBJECT_IDENTIFIER,
140
146
  "REGCOLLATION": TokenType.OBJECT_IDENTIFIER,
141
147
  "REGCONFIG": TokenType.OBJECT_IDENTIFIER,
@@ -158,6 +164,7 @@ class Postgres(Dialect):
158
164
  SINGLE_TOKENS = {
159
165
  **tokens.Tokenizer.SINGLE_TOKENS,
160
166
  "$": TokenType.HEREDOC_STRING,
167
+ "@": TokenType.AT_SIGN,
161
168
  }
162
169
 
163
170
  VAR_SINGLE_TOKENS = {"$"}
@@ -32,6 +32,7 @@ class Presto(Dialect):
32
32
  SUPPORTS_VALUES_DEFAULT = False
33
33
  LEAST_GREATEST_IGNORES_NULLS = False
34
34
  UUID_IS_STRING_TYPE = False
35
+ ARRAY_REMOVE_PROPAGATES_NULLS = True
35
36
 
36
37
  TIME_MAPPING = MySQL.TIME_MAPPING
37
38
 
@@ -23,6 +23,7 @@ class Redshift(Postgres):
23
23
  COALESCE_COMPARISON_NON_STANDARD = True
24
24
  REGEXP_EXTRACT_POSITION_OVERFLOW_RETURNS_NULL = False
25
25
  ARRAY_FUNCS_PROPAGATES_NULLS = True
26
+ ARRAY_REMOVE_PROPAGATES_NULLS = True
26
27
 
27
28
  # ref: https://docs.aws.amazon.com/redshift/latest/dg/r_FORMAT_strings.html
28
29
  TIME_FORMAT = "'YYYY-MM-DD HH24:MI:SS'"
@@ -43,6 +44,7 @@ class Redshift(Postgres):
43
44
  DROP_UNKNOWN_ESCAPES = True
44
45
  BIT_STRINGS = []
45
46
  HEX_STRINGS = []
47
+ UNICODE_IDENTIFIERS = []
46
48
  STRING_ESCAPES = ["\\", "'"]
47
49
 
48
50
  KEYWORDS = {
@@ -15,6 +15,8 @@ class RisingWave(Postgres):
15
15
  UNESCAPED_SEQUENCES = {"\\a": "a", "\\v": "v"}
16
16
 
17
17
  class Tokenizer(Postgres.Tokenizer):
18
+ UNICODE_IDENTIFIERS = []
19
+
18
20
  KEYWORDS = {
19
21
  **Postgres.Tokenizer.KEYWORDS,
20
22
  "SINK": TokenType.SINK,
@@ -23,6 +23,7 @@ class Snowflake(Dialect):
23
23
  UNESCAPED_SEQUENCES = {"\\a": "a", "\\v": "v"}
24
24
  NULL_ORDERING = "nulls_are_large"
25
25
  TIME_FORMAT = "'YYYY-MM-DD HH24:MI:SS'"
26
+ SUPPORTS_ORDER_BY_ALL = True
26
27
  SUPPORTS_USER_DEFINED_TYPES = False
27
28
  PREFER_CTE_ALIAS_COLUMN = True
28
29
  COLUMN_ALIAS_PRECEDENCE = {
@@ -34,6 +35,7 @@ class Snowflake(Dialect):
34
35
  COPY_PARAMS_ARE_CSV = False
35
36
  ARRAY_AGG_INCLUDES_NULLS = None
36
37
  ARRAY_FUNCS_PROPAGATES_NULLS = True
38
+ ARRAY_REMOVE_PROPAGATES_NULLS = True
37
39
  ALTER_TABLE_ADD_REQUIRED_FOR_EACH_COLUMN = False
38
40
  ALTER_TABLE_DROP_REQUIRED_FOR_EACH_COLUMN = False
39
41
  TRY_CAST_REQUIRES_STRING = True
@@ -140,6 +142,8 @@ class Snowflake(Dialect):
140
142
  KEYWORDS = {
141
143
  **tokens.Tokenizer.KEYWORDS,
142
144
  "(+)": TokenType.JOIN_MARKER,
145
+ "@": TokenType.STAGE_PATH,
146
+ "@~": TokenType.STAGE_PATH,
143
147
  "BYTEINT": TokenType.INT,
144
148
  "FILE://": TokenType.URI_START,
145
149
  "FILE FORMAT": TokenType.FILE_FORMAT,
@@ -187,6 +191,9 @@ class Snowflake(Dialect):
187
191
 
188
192
  VAR_SINGLE_TOKENS = {"$"}
189
193
 
194
+ # https://docs.snowflake.com/en/user-guide/querying-stage
195
+ UNQUOTED_PATH_TERMINATORS = {",", ";", "(", ")", "'", "`", "~", "<", ">", "|"}
196
+
190
197
  COMMANDS = tokens.Tokenizer.COMMANDS - {TokenType.SHOW}
191
198
 
192
199
  Generator = SnowflakeGenerator
@@ -24,13 +24,21 @@ class SQLite(Dialect):
24
24
  exp.Qualify: AliasPrecedence.SOURCE,
25
25
  }
26
26
  SAFE_TO_ELIMINATE_DOUBLE_NEGATION = False
27
+ SUPPORTS_UPDATE_OR = True
27
28
  USING_COLUMN_ORDER = UsingColumnOrder.IN_PLACE
28
29
  CONCAT_COALESCE = True
29
30
  CONCAT_WS_COALESCE = True
31
+ # DATE() and DATETIME() return text in different formats.
32
+ FOLD_MIXED_TEMPORAL_COMPARISONS = False
30
33
  INTERSECT_BINDS_TIGHTER_THAN_UNION_AND_EXCEPT = False
31
34
  NUMBERS_CAN_BE_UNDERSCORE_SEPARATED = True
32
35
  EXPRESSION_METADATA = EXPRESSION_METADATA.copy()
33
36
 
37
+ TIME_MAPPING = {
38
+ "%%": "%%",
39
+ "%f": "%S.%f_three",
40
+ }
41
+
34
42
  class Tokenizer(tokens.Tokenizer):
35
43
  IDENTIFIERS = ['"', ("[", "]"), "`"]
36
44
  HEX_STRINGS = [("x'", "'"), ("X'", "'"), ("0x", ""), ("0X", "")]
@@ -397,3 +397,11 @@ class StDistance(Expression, Func):
397
397
  class StPoint(Expression, Func):
398
398
  arg_types = {"this": True, "expression": True, "z": False, "m": False}
399
399
  _sql_names = ["ST_POINT", "ST_MAKEPOINT"]
400
+
401
+
402
+ class StX(Expression, Func):
403
+ arg_types = {"this": True, "expression": False}
404
+
405
+
406
+ class StY(Expression, Func):
407
+ arg_types = {"this": True, "expression": False}