sqlglot 27.14.0__tar.gz → 27.15.1__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 (227) hide show
  1. {sqlglot-27.14.0 → sqlglot-27.15.1}/CHANGELOG.md +151 -0
  2. {sqlglot-27.14.0 → sqlglot-27.15.1}/PKG-INFO +1 -1
  3. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/_version.py +3 -3
  4. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/bigquery.py +5 -3
  5. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/mysql.py +14 -7
  6. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/postgres.py +10 -0
  7. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/singlestore.py +7 -0
  8. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/snowflake.py +65 -3
  9. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/tsql.py +10 -0
  10. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/expressions.py +33 -4
  11. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/generator.py +2 -1
  12. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/optimizer/annotate_types.py +7 -3
  13. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/optimizer/qualify_columns.py +6 -2
  14. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/parser.py +22 -10
  15. sqlglot-27.15.1/sqlglot/serde.py +126 -0
  16. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/tokens.py +1 -0
  17. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot.egg-info/PKG-INFO +1 -1
  18. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_bigquery.py +11 -30
  19. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_dialect.py +30 -0
  20. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_mysql.py +13 -0
  21. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_postgres.py +8 -0
  22. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_singlestore.py +17 -0
  23. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_snowflake.py +28 -0
  24. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_tsql.py +13 -0
  25. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/identity.sql +2 -0
  26. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/annotate_functions.sql +252 -19
  27. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/qualify_columns.sql +10 -0
  28. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/test_optimizer.py +13 -0
  29. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/test_serde.py +10 -1
  30. sqlglot-27.14.0/sqlglot/serde.py +0 -118
  31. {sqlglot-27.14.0 → sqlglot-27.15.1}/.gitignore +0 -0
  32. {sqlglot-27.14.0 → sqlglot-27.15.1}/.gitpod.yml +0 -0
  33. {sqlglot-27.14.0 → sqlglot-27.15.1}/.pre-commit-config.yaml +0 -0
  34. {sqlglot-27.14.0 → sqlglot-27.15.1}/CONTRIBUTING.md +0 -0
  35. {sqlglot-27.14.0 → sqlglot-27.15.1}/LICENSE +0 -0
  36. {sqlglot-27.14.0 → sqlglot-27.15.1}/MANIFEST.in +0 -0
  37. {sqlglot-27.14.0 → sqlglot-27.15.1}/Makefile +0 -0
  38. {sqlglot-27.14.0 → sqlglot-27.15.1}/README.md +0 -0
  39. {sqlglot-27.14.0 → sqlglot-27.15.1}/pyproject.toml +0 -0
  40. {sqlglot-27.14.0 → sqlglot-27.15.1}/setup.cfg +0 -0
  41. {sqlglot-27.14.0 → sqlglot-27.15.1}/setup.py +0 -0
  42. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/__init__.py +0 -0
  43. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/__main__.py +0 -0
  44. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/_typing.py +0 -0
  45. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/__init__.py +0 -0
  46. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/athena.py +0 -0
  47. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/clickhouse.py +0 -0
  48. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/databricks.py +0 -0
  49. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/dialect.py +0 -0
  50. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/doris.py +0 -0
  51. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/dremio.py +0 -0
  52. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/drill.py +0 -0
  53. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/druid.py +0 -0
  54. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/duckdb.py +0 -0
  55. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/dune.py +0 -0
  56. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/exasol.py +0 -0
  57. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/fabric.py +0 -0
  58. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/hive.py +0 -0
  59. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/materialize.py +0 -0
  60. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/oracle.py +0 -0
  61. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/presto.py +0 -0
  62. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/prql.py +0 -0
  63. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/redshift.py +0 -0
  64. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/risingwave.py +0 -0
  65. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/spark.py +0 -0
  66. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/spark2.py +0 -0
  67. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/sqlite.py +0 -0
  68. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/starrocks.py +0 -0
  69. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/tableau.py +0 -0
  70. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/teradata.py +0 -0
  71. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/dialects/trino.py +0 -0
  72. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/diff.py +0 -0
  73. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/errors.py +0 -0
  74. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/executor/__init__.py +0 -0
  75. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/executor/context.py +0 -0
  76. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/executor/env.py +0 -0
  77. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/executor/python.py +0 -0
  78. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/executor/table.py +0 -0
  79. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/helper.py +0 -0
  80. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/jsonpath.py +0 -0
  81. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/lineage.py +0 -0
  82. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/optimizer/__init__.py +0 -0
  83. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/optimizer/canonicalize.py +0 -0
  84. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/optimizer/eliminate_ctes.py +0 -0
  85. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/optimizer/eliminate_joins.py +0 -0
  86. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
  87. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/optimizer/isolate_table_selects.py +0 -0
  88. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/optimizer/merge_subqueries.py +0 -0
  89. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/optimizer/normalize.py +0 -0
  90. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/optimizer/normalize_identifiers.py +0 -0
  91. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/optimizer/optimize_joins.py +0 -0
  92. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/optimizer/optimizer.py +0 -0
  93. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/optimizer/pushdown_predicates.py +0 -0
  94. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/optimizer/pushdown_projections.py +0 -0
  95. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/optimizer/qualify.py +0 -0
  96. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/optimizer/qualify_tables.py +0 -0
  97. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/optimizer/scope.py +0 -0
  98. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/optimizer/simplify.py +0 -0
  99. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/optimizer/unnest_subqueries.py +0 -0
  100. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/planner.py +0 -0
  101. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/py.typed +0 -0
  102. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/schema.py +0 -0
  103. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/time.py +0 -0
  104. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/transforms.py +0 -0
  105. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot/trie.py +0 -0
  106. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot.egg-info/SOURCES.txt +0 -0
  107. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot.egg-info/dependency_links.txt +0 -0
  108. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot.egg-info/requires.txt +0 -0
  109. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot.egg-info/top_level.txt +0 -0
  110. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglot.png +0 -0
  111. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglotrs/Cargo.lock +0 -0
  112. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglotrs/Cargo.toml +0 -0
  113. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglotrs/benches/dialect_settings.json +0 -0
  114. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglotrs/benches/long.rs +0 -0
  115. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglotrs/benches/token_type_settings.json +0 -0
  116. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglotrs/benches/tokenizer_dialect_settings.json +0 -0
  117. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglotrs/benches/tokenizer_settings.json +0 -0
  118. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglotrs/pyproject.toml +0 -0
  119. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglotrs/src/lib.rs +0 -0
  120. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglotrs/src/settings.rs +0 -0
  121. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglotrs/src/token.rs +0 -0
  122. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglotrs/src/tokenizer.rs +0 -0
  123. {sqlglot-27.14.0 → sqlglot-27.15.1}/sqlglotrs/src/trie.rs +0 -0
  124. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/__init__.py +0 -0
  125. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/__init__.py +0 -0
  126. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_athena.py +0 -0
  127. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_clickhouse.py +0 -0
  128. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_databricks.py +0 -0
  129. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_doris.py +0 -0
  130. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_dremio.py +0 -0
  131. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_drill.py +0 -0
  132. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_druid.py +0 -0
  133. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_duckdb.py +0 -0
  134. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_dune.py +0 -0
  135. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_exasol.py +0 -0
  136. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_fabric.py +0 -0
  137. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_hive.py +0 -0
  138. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_materialize.py +0 -0
  139. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_oracle.py +0 -0
  140. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_pipe_syntax.py +0 -0
  141. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_presto.py +0 -0
  142. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_prql.py +0 -0
  143. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_redshift.py +0 -0
  144. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_risingwave.py +0 -0
  145. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_spark.py +0 -0
  146. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_sqlite.py +0 -0
  147. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_starrocks.py +0 -0
  148. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_tableau.py +0 -0
  149. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_teradata.py +0 -0
  150. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/dialects/test_trino.py +0 -0
  151. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/jsonpath/LICENSE +0 -0
  152. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/jsonpath/cts.json +0 -0
  153. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/annotate_types.sql +0 -0
  154. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/canonicalize.sql +0 -0
  155. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
  156. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/eliminate_joins.sql +0 -0
  157. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
  158. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
  159. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
  160. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/normalize.sql +0 -0
  161. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
  162. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
  163. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/optimizer.sql +0 -0
  164. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
  165. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
  166. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/pushdown_projections.sql +0 -0
  167. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
  168. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
  169. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
  170. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
  171. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
  172. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/simplify.sql +0 -0
  173. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
  174. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
  175. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
  176. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
  177. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
  178. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
  179. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
  180. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
  181. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
  182. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
  183. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
  184. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
  185. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
  186. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
  187. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
  188. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
  189. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
  190. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
  191. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
  192. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
  193. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
  194. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
  195. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
  196. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
  197. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
  198. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
  199. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
  200. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
  201. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
  202. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
  203. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
  204. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
  205. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
  206. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
  207. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/optimizer/unnest_subqueries.sql +0 -0
  208. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/partial.sql +0 -0
  209. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/fixtures/pretty.sql +0 -0
  210. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/gen_fixtures.py +0 -0
  211. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/helpers.py +0 -0
  212. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/test_build.py +0 -0
  213. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/test_dialect_imports.py +0 -0
  214. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/test_diff.py +0 -0
  215. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/test_docs.py +0 -0
  216. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/test_executor.py +0 -0
  217. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/test_expressions.py +0 -0
  218. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/test_generator.py +0 -0
  219. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/test_helper.py +0 -0
  220. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/test_jsonpath.py +0 -0
  221. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/test_lineage.py +0 -0
  222. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/test_parser.py +0 -0
  223. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/test_schema.py +0 -0
  224. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/test_time.py +0 -0
  225. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/test_tokens.py +0 -0
  226. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/test_transforms.py +0 -0
  227. {sqlglot-27.14.0 → sqlglot-27.15.1}/tests/test_transpile.py +0 -0
@@ -1,6 +1,155 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## [v27.15.0] - 2025-09-17
5
+ ### :boom: BREAKING CHANGES
6
+ - due to [`96ae7a3`](https://github.com/tobymao/sqlglot/commit/96ae7a3bcbf9de1932150baa0bd704d4ce05c9f7) - Annotate and add tests for snowflake REPEAT and SPLIT functions *(PR [#5875](https://github.com/tobymao/sqlglot/pull/5875) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
7
+
8
+ Annotate and add tests for snowflake REPEAT and SPLIT functions (#5875)
9
+
10
+ - due to [`f2d3bf7`](https://github.com/tobymao/sqlglot/commit/f2d3bf74e804e5a5e2ac6ca94210ba04df07e7f3) - annotate types for Snowflake UUID_STRING function *(PR [#5881](https://github.com/tobymao/sqlglot/pull/5881) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*:
11
+
12
+ annotate types for Snowflake UUID_STRING function (#5881)
13
+
14
+ - due to [`ec80ff3`](https://github.com/tobymao/sqlglot/commit/ec80ff34957c3e3f80c44175383b06cf72988a68) - make dump a list instead of a nested dict to avoid all recursion errors *(PR [#5885](https://github.com/tobymao/sqlglot/pull/5885) by [@tobymao](https://github.com/tobymao))*:
15
+
16
+ make dump a list instead of a nested dict to avoid all recursion errors (#5885)
17
+
18
+ - due to [`2fdaccd`](https://github.com/tobymao/sqlglot/commit/2fdaccd1a9045bda3d529025a4706c397b8a836f) - annotate types for Snowflake SHA1, SHA2 functions *(PR [#5884](https://github.com/tobymao/sqlglot/pull/5884) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*:
19
+
20
+ annotate types for Snowflake SHA1, SHA2 functions (#5884)
21
+
22
+ - due to [`faba309`](https://github.com/tobymao/sqlglot/commit/faba30905390e5efaf0ba9a05aab9ac2724b1b85) - annotate types for Snowflake AI_AGG function *(PR [#5894](https://github.com/tobymao/sqlglot/pull/5894) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*:
23
+
24
+ annotate types for Snowflake AI_AGG function (#5894)
25
+
26
+ - due to [`304bec5`](https://github.com/tobymao/sqlglot/commit/304bec5f7342501ad28ea4cd0a4b9aa092f2192f) - Annotate snowflake MD5 functions *(PR [#5883](https://github.com/tobymao/sqlglot/pull/5883) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
27
+
28
+ Annotate snowflake MD5 functions (#5883)
29
+
30
+ - due to [`c0180ec`](https://github.com/tobymao/sqlglot/commit/c0180ec163a43836fed754efcb6f26ad37cdae50) - annotate types for Snowflake AI_SUMMARIZE_AGG function *(PR [#5902](https://github.com/tobymao/sqlglot/pull/5902) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*:
31
+
32
+ annotate types for Snowflake AI_SUMMARIZE_AGG function (#5902)
33
+
34
+ - due to [`f5409df`](https://github.com/tobymao/sqlglot/commit/f5409df64ed6069880669878db687e4b98c3e280) - use column name in struct type annotation *(PR [#5903](https://github.com/tobymao/sqlglot/pull/5903) by [@georgesittas](https://github.com/georgesittas))*:
35
+
36
+ use column name in struct type annotation (#5903)
37
+
38
+
39
+ ### :sparkles: New Features
40
+ - [`cd818ba`](https://github.com/tobymao/sqlglot/commit/cd818bad51e93ec349b97675e4c1f5bd7c4c1522) - **singlestore**: Fixed generation/parsing of computed collumns *(PR [#5878](https://github.com/tobymao/sqlglot/pull/5878) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
41
+ - [`5d1f241`](https://github.com/tobymao/sqlglot/commit/5d1f241209197419111e9eda37fb6f2a5ec2bc4b) - **tsql**: support JSON_ARRAYAGG *(PR [#5879](https://github.com/tobymao/sqlglot/pull/5879) by [@geooo109](https://github.com/geooo109))*
42
+ - [`96ae7a3`](https://github.com/tobymao/sqlglot/commit/96ae7a3bcbf9de1932150baa0bd704d4ce05c9f7) - **optimizer**: Annotate and add tests for snowflake REPEAT and SPLIT functions *(PR [#5875](https://github.com/tobymao/sqlglot/pull/5875) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
43
+ - [`0fe6a25`](https://github.com/tobymao/sqlglot/commit/0fe6a25e366dcbc5a4a0878b285d147a6aa00412) - **postgres**: support JSON_AGG *(PR [#5880](https://github.com/tobymao/sqlglot/pull/5880) by [@geooo109](https://github.com/geooo109))*
44
+ - [`854eeeb`](https://github.com/tobymao/sqlglot/commit/854eeeb5b25954cc26b91135d58eb8370271f1de) - **optimizer**: annotate types for Snowflake REGEXP_LIKE, REGEXP_REPLACE, REGEXP_SUBSTR functions *(PR [#5876](https://github.com/tobymao/sqlglot/pull/5876) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
45
+ - [`f2d3bf7`](https://github.com/tobymao/sqlglot/commit/f2d3bf74e804e5a5e2ac6ca94210ba04df07e7f3) - **optimizer**: annotate types for Snowflake UUID_STRING function *(PR [#5881](https://github.com/tobymao/sqlglot/pull/5881) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
46
+ - [`5b9463a`](https://github.com/tobymao/sqlglot/commit/5b9463ad11a49c821585985c35394ebb30e827dd) - **mysql**: add support for binary `MOD` operator fixes [#5887](https://github.com/tobymao/sqlglot/pull/5887) *(commit by [@georgesittas](https://github.com/georgesittas))*
47
+ - [`d24eabc`](https://github.com/tobymao/sqlglot/commit/d24eabcbe30dc0f7c2dbae346e429efef58b5680) - **bigquery**: Add support for ML.GENERATE_TEXT_EMBEDDING(...) *(PR [#5891](https://github.com/tobymao/sqlglot/pull/5891) by [@VaggelisD](https://github.com/VaggelisD))*
48
+ - [`950a3fa`](https://github.com/tobymao/sqlglot/commit/950a3fa6d6307f7713f40117655da2f9710ebfa9) - **mysql**: SOUNDS LIKE, SUBSTR *(PR [#5886](https://github.com/tobymao/sqlglot/pull/5886) by [@vuvova](https://github.com/vuvova))*
49
+ - [`688afc5`](https://github.com/tobymao/sqlglot/commit/688afc55ab08588636eba92893c603ca68e43e6e) - **singlestore**: Fixed generation of exp.National *(PR [#5890](https://github.com/tobymao/sqlglot/pull/5890) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
50
+ - [`c77147e`](https://github.com/tobymao/sqlglot/commit/c77147ebaafa6942f80af75dd6c2d7a62a7e6fe2) - **parser**: Extend support for `IS UNKOWN` across all dialects *(PR [#5888](https://github.com/tobymao/sqlglot/pull/5888) by [@VaggelisD](https://github.com/VaggelisD))*
51
+ - [`ec80ff3`](https://github.com/tobymao/sqlglot/commit/ec80ff34957c3e3f80c44175383b06cf72988a68) - make dump a list instead of a nested dict to avoid all recursion errors *(PR [#5885](https://github.com/tobymao/sqlglot/pull/5885) by [@tobymao](https://github.com/tobymao))*
52
+ - [`2fdaccd`](https://github.com/tobymao/sqlglot/commit/2fdaccd1a9045bda3d529025a4706c397b8a836f) - **optimizer**: annotate types for Snowflake SHA1, SHA2 functions *(PR [#5884](https://github.com/tobymao/sqlglot/pull/5884) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
53
+ - [`faba309`](https://github.com/tobymao/sqlglot/commit/faba30905390e5efaf0ba9a05aab9ac2724b1b85) - **optimizer**: annotate types for Snowflake AI_AGG function *(PR [#5894](https://github.com/tobymao/sqlglot/pull/5894) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
54
+ - [`dd27844`](https://github.com/tobymao/sqlglot/commit/dd2784435c7bdd2ceaaaaa359fcd112ad1f8190c) - **snowflake**: transpile `BYTE_LENGTH` *(PR [#5899](https://github.com/tobymao/sqlglot/pull/5899) by [@ozadari](https://github.com/ozadari))*
55
+ - [`304bec5`](https://github.com/tobymao/sqlglot/commit/304bec5f7342501ad28ea4cd0a4b9aa092f2192f) - **optimizer**: Annotate snowflake MD5 functions *(PR [#5883](https://github.com/tobymao/sqlglot/pull/5883) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
56
+ - [`ec3006d`](https://github.com/tobymao/sqlglot/commit/ec3006d815951fdc1a80d6722ce6f1176417d595) - **optimizer**: Add tests for snowflake NOT ILIKE and NOT LIKE *(PR [#5901](https://github.com/tobymao/sqlglot/pull/5901) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
57
+ - [`c0180ec`](https://github.com/tobymao/sqlglot/commit/c0180ec163a43836fed754efcb6f26ad37cdae50) - **optimizer**: annotate types for Snowflake AI_SUMMARIZE_AGG function *(PR [#5902](https://github.com/tobymao/sqlglot/pull/5902) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
58
+
59
+ ### :bug: Bug Fixes
60
+ - [`1d9e357`](https://github.com/tobymao/sqlglot/commit/1d9e357fb7549635ca25c6c42299880d7864e074) - **optimizer**: expand columns on the LHS of recursive CTEs *(PR [#5872](https://github.com/tobymao/sqlglot/pull/5872) by [@geooo109](https://github.com/geooo109))*
61
+ - :arrow_lower_right: *fixes issue [#5814](https://github.com/tobymao/sqlglot/issues/5814) opened by [@suresh-summation](https://github.com/suresh-summation)*
62
+ - [`7fcc52a`](https://github.com/tobymao/sqlglot/commit/7fcc52a22241c480c22b3e6f843e7a210c75a0ec) - **parser**: Require an explicit alias in EXCLUDE/RENAME/REPLACE star ops *(PR [#5892](https://github.com/tobymao/sqlglot/pull/5892) by [@VaggelisD](https://github.com/VaggelisD))*
63
+ - [`5fdcc65`](https://github.com/tobymao/sqlglot/commit/5fdcc651277ba4e86e11d0c5952a56e40299a998) - **snowflake**: parse OCTET_LENGTH *(PR [#5900](https://github.com/tobymao/sqlglot/pull/5900) by [@geooo109](https://github.com/geooo109))*
64
+ - [`f5409df`](https://github.com/tobymao/sqlglot/commit/f5409df64ed6069880669878db687e4b98c3e280) - **optimizer**: use column name in struct type annotation *(PR [#5903](https://github.com/tobymao/sqlglot/pull/5903) by [@georgesittas](https://github.com/georgesittas))*
65
+ - [`74886d8`](https://github.com/tobymao/sqlglot/commit/74886d82f70c9317af51c77b322e67a6aa260a5e) - **snowflake**: transpile BQ UNNEST with alias *(PR [#5897](https://github.com/tobymao/sqlglot/pull/5897) by [@geooo109](https://github.com/geooo109))*
66
+ - :arrow_lower_right: *fixes issue [#5895](https://github.com/tobymao/sqlglot/issues/5895) opened by [@YuvalOmerRep](https://github.com/YuvalOmerRep)*
67
+
68
+
69
+ ## [v27.14.0] - 2025-09-11
70
+ ### :boom: BREAKING CHANGES
71
+ - due to [`9c8a600`](https://github.com/tobymao/sqlglot/commit/9c8a6001f41816035f391d046eb9692d6f13cefc) - correct parsing of TO_VARCHAR *(PR [#5840](https://github.com/tobymao/sqlglot/pull/5840) by [@geooo109](https://github.com/geooo109))*:
72
+
73
+ correct parsing of TO_VARCHAR (#5840)
74
+
75
+ - due to [`1e9aef1`](https://github.com/tobymao/sqlglot/commit/1e9aef1bb20f4dc5e9c03d59cb3165c235c11ce1) - convert NULL annotations to UNKNOWN *(PR [#5842](https://github.com/tobymao/sqlglot/pull/5842) by [@georgesittas](https://github.com/georgesittas))*:
76
+
77
+ convert NULL annotations to UNKNOWN (#5842)
78
+
79
+ - due to [`44c9e70`](https://github.com/tobymao/sqlglot/commit/44c9e70bd8c9421035eb0e87e4286061ec5d2fa8) - add tests for snowflake STARTSWITH function *(PR [#5847](https://github.com/tobymao/sqlglot/pull/5847) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
80
+
81
+ add tests for snowflake STARTSWITH function (#5847)
82
+
83
+ - due to [`0779c2d`](https://github.com/tobymao/sqlglot/commit/0779c2d4e8ce0228592de6882763940783fa5e87) - support BIT_X aggregates again for duckdb, postgres *(PR [#5851](https://github.com/tobymao/sqlglot/pull/5851) by [@georgesittas](https://github.com/georgesittas))*:
84
+
85
+ support BIT_X aggregates again for duckdb, postgres (#5851)
86
+
87
+ - due to [`c50d6e3`](https://github.com/tobymao/sqlglot/commit/c50d6e3c7b96f00d27c34a02c8e0dced21e6c373) - annotate type for snowflake LEFT, RIGHT and SUBSTRING functions *(PR [#5849](https://github.com/tobymao/sqlglot/pull/5849) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
88
+
89
+ annotate type for snowflake LEFT, RIGHT and SUBSTRING functions (#5849)
90
+
91
+ - due to [`e441e16`](https://github.com/tobymao/sqlglot/commit/e441e16991626c2da2d38bc9c3a2b408e3f773bd) - make dump/pickling non-recursive to avoid hitting stack limits *(PR [#5850](https://github.com/tobymao/sqlglot/pull/5850) by [@tobymao](https://github.com/tobymao))*:
92
+
93
+ make dump/pickling non-recursive to avoid hitting stack limits (#5850)
94
+
95
+ - due to [`b128339`](https://github.com/tobymao/sqlglot/commit/b12833977e2a395712481cf11e293fdbd70fd4ce) - annotate and add tests for snowflake LENGTH and LOWER functions *(PR [#5856](https://github.com/tobymao/sqlglot/pull/5856) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
96
+
97
+ annotate and add tests for snowflake LENGTH and LOWER functions (#5856)
98
+
99
+ - due to [`134957a`](https://github.com/tobymao/sqlglot/commit/134957af11c55a4ab16f58d0725d6bb8ab23eb28) - annotate types for Snowflake TRIM function *(PR [#5811](https://github.com/tobymao/sqlglot/pull/5811) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*:
100
+
101
+ annotate types for Snowflake TRIM function (#5811)
102
+
103
+ - due to [`d3cd6bf`](https://github.com/tobymao/sqlglot/commit/d3cd6bf6e5fbaa490868ee3cd2cc99dd5e40a396) - Annotate and add tests for snowflake REPLACE and SPACE functions *(PR [#5871](https://github.com/tobymao/sqlglot/pull/5871) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
104
+
105
+ Annotate and add tests for snowflake REPLACE and SPACE functions (#5871)
106
+
107
+
108
+ ### :sparkles: New Features
109
+ - [`a398fb4`](https://github.com/tobymao/sqlglot/commit/a398fb4df28c868f4cfc34530044b9d7b78e2e90) - **singlestore**: Splitted truncation of multiple tables into several queries *(PR [#5839](https://github.com/tobymao/sqlglot/pull/5839) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
110
+ - [`cd27c96`](https://github.com/tobymao/sqlglot/commit/cd27c96fe85aba5f54116f38649edd8db064a5e6) - **snowflake**: transpile `TO_HEX` from bigquery *(PR [#5838](https://github.com/tobymao/sqlglot/pull/5838) by [@YuvalOmerRep](https://github.com/YuvalOmerRep))*
111
+ - [`d2e4ab7`](https://github.com/tobymao/sqlglot/commit/d2e4ab7df41ae3601e9b66e1338db3d851729339) - **snowflake**: add tests for endswith function *(PR [#5846](https://github.com/tobymao/sqlglot/pull/5846) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
112
+ - [`c50d6e3`](https://github.com/tobymao/sqlglot/commit/c50d6e3c7b96f00d27c34a02c8e0dced21e6c373) - **optimizer**: annotate type for snowflake LEFT, RIGHT and SUBSTRING functions *(PR [#5849](https://github.com/tobymao/sqlglot/pull/5849) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
113
+ - [`ca6c8f7`](https://github.com/tobymao/sqlglot/commit/ca6c8f753ba8458544439e20671f0981c98d168d) - **singlestore**: Improved parsting/generation of exp.Show *(PR [#5853](https://github.com/tobymao/sqlglot/pull/5853) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
114
+ - [`722eceb`](https://github.com/tobymao/sqlglot/commit/722ecebfa43aa5948031edd1828b6482a241d9ef) - **snowflake**: MD5Digest transpiling to MD5_BINARY *(PR [#5855](https://github.com/tobymao/sqlglot/pull/5855) by [@YuvalOmerRep](https://github.com/YuvalOmerRep))*
115
+ - [`b128339`](https://github.com/tobymao/sqlglot/commit/b12833977e2a395712481cf11e293fdbd70fd4ce) - **optimizer**: annotate and add tests for snowflake LENGTH and LOWER functions *(PR [#5856](https://github.com/tobymao/sqlglot/pull/5856) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
116
+ - [`134957a`](https://github.com/tobymao/sqlglot/commit/134957af11c55a4ab16f58d0725d6bb8ab23eb28) - **optimizer**: annotate types for Snowflake TRIM function *(PR [#5811](https://github.com/tobymao/sqlglot/pull/5811) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
117
+ - [`0475dae`](https://github.com/tobymao/sqlglot/commit/0475dae21231b85407bf778fd9f1abaecdeb68de) - **singlestore**: Marked several exp.Describe args as unsupported *(PR [#5861](https://github.com/tobymao/sqlglot/pull/5861) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
118
+ - [`7a07b41`](https://github.com/tobymao/sqlglot/commit/7a07b41b2357149adc6afb50bb98e37e6a3175f1) - **optimizer**: Add tests for snowflake LTRIM and RTRIM functions *(PR [#5857](https://github.com/tobymao/sqlglot/pull/5857) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
119
+ - [`fb90666`](https://github.com/tobymao/sqlglot/commit/fb90666ff3e710d70815a68defde3dc85aeef7b3) - **singlestore**: Added collate handling to exp.AlterColumn *(PR [#5864](https://github.com/tobymao/sqlglot/pull/5864) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
120
+ - [`2f27692`](https://github.com/tobymao/sqlglot/commit/2f276929d6b6f788eb5b3ee0b1a8a8c108833474) - **snowflake**: JSONFormat transpiling to TO_JSON *(PR [#5860](https://github.com/tobymao/sqlglot/pull/5860) by [@YuvalOmerRep](https://github.com/YuvalOmerRep))*
121
+ - [`487c811`](https://github.com/tobymao/sqlglot/commit/487c8119cbfaf2783f5f17ec90c8e69e4432a4fa) - **singlestore**: Fixed parsing/generation of exp.RenameColumn *(PR [#5865](https://github.com/tobymao/sqlglot/pull/5865) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
122
+ - [`76cf4d8`](https://github.com/tobymao/sqlglot/commit/76cf4d892a6d011a2e0020fb1ea82518d4f49e71) - **bigquery**: add support for ML.TRANSLATE func *(PR [#5859](https://github.com/tobymao/sqlglot/pull/5859) by [@geooo109](https://github.com/geooo109))*
123
+ - [`a899eb1`](https://github.com/tobymao/sqlglot/commit/a899eb188d5e354d3ed56d1e7c32861eecf3e906) - **singlestore**: Fixed parsing and generation of VECTOR type *(PR [#5854](https://github.com/tobymao/sqlglot/pull/5854) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
124
+ - [`0acf076`](https://github.com/tobymao/sqlglot/commit/0acf0769773061fca3ec03125a5d43a4aa9c8e4b) - **postgres**: Support `?|` JSONB operator *(PR [#5866](https://github.com/tobymao/sqlglot/pull/5866) by [@VaggelisD](https://github.com/VaggelisD))*
125
+ - [`bd4b278`](https://github.com/tobymao/sqlglot/commit/bd4b2780c32ee52d25b6539d7b4479b6a7f80d18) - **optimizer**: annotate types for Snowflake UPPER function *(PR [#5812](https://github.com/tobymao/sqlglot/pull/5812) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
126
+ - [`edab189`](https://github.com/tobymao/sqlglot/commit/edab1890e2c790b737be4995a31667448eff148e) - **postgres**: Support ?& JSONB operator *(PR [#5867](https://github.com/tobymao/sqlglot/pull/5867) by [@VaggelisD](https://github.com/VaggelisD))*
127
+ - [`960ec06`](https://github.com/tobymao/sqlglot/commit/960ec069eb275b7b8cc6705dbbb1143159f06237) - **postgres**: Support #- JSONB operator *(PR [#5868](https://github.com/tobymao/sqlglot/pull/5868) by [@VaggelisD](https://github.com/VaggelisD))*
128
+ - [`d3cd6bf`](https://github.com/tobymao/sqlglot/commit/d3cd6bf6e5fbaa490868ee3cd2cc99dd5e40a396) - **optimizer**: Annotate and add tests for snowflake REPLACE and SPACE functions *(PR [#5871](https://github.com/tobymao/sqlglot/pull/5871) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
129
+ - [`ba22531`](https://github.com/tobymao/sqlglot/commit/ba2253113ea5a7c76c8df7ec9b6faf37da698fa4) - **bigquery**: Add support for ML.FORECAST(...) *(PR [#5873](https://github.com/tobymao/sqlglot/pull/5873) by [@VaggelisD](https://github.com/VaggelisD))*
130
+
131
+ ### :bug: Bug Fixes
132
+ - [`9c8a600`](https://github.com/tobymao/sqlglot/commit/9c8a6001f41816035f391d046eb9692d6f13cefc) - **snowflake**: correct parsing of TO_VARCHAR *(PR [#5840](https://github.com/tobymao/sqlglot/pull/5840) by [@geooo109](https://github.com/geooo109))*
133
+ - :arrow_lower_right: *fixes issue [#5837](https://github.com/tobymao/sqlglot/issues/5837) opened by [@ultrabear](https://github.com/ultrabear)*
134
+ - [`f3d07fd`](https://github.com/tobymao/sqlglot/commit/f3d07fd8a106b034f64bb100291671c0fe39a106) - **snowflake**: Enable parsing of COPY INTO without files list *(PR [#5841](https://github.com/tobymao/sqlglot/pull/5841) by [@whummer](https://github.com/whummer))*
135
+ - [`0ffb1fa`](https://github.com/tobymao/sqlglot/commit/0ffb1faac3b32aad845306eed0e000ff0d055554) - **duckdb**: transpile joins without ON/USING to CROSS JOIN *(PR [#5804](https://github.com/tobymao/sqlglot/pull/5804) by [@geooo109](https://github.com/geooo109))*
136
+ - :arrow_lower_right: *fixes issue [#5795](https://github.com/tobymao/sqlglot/issues/5795) opened by [@kyle-cheung](https://github.com/kyle-cheung)*
137
+ - [`1e9aef1`](https://github.com/tobymao/sqlglot/commit/1e9aef1bb20f4dc5e9c03d59cb3165c235c11ce1) - **optimizer**: convert NULL annotations to UNKNOWN *(PR [#5842](https://github.com/tobymao/sqlglot/pull/5842) by [@georgesittas](https://github.com/georgesittas))*
138
+ - [`bbcf0d4`](https://github.com/tobymao/sqlglot/commit/bbcf0d4404ea014f08319c44313719b4377adcdb) - **duckdb**: support trailing commas before `FOR` in pivot, fixes [#5843](https://github.com/tobymao/sqlglot/pull/5843) *(commit by [@georgesittas](https://github.com/georgesittas))*
139
+ - [`ad8a408`](https://github.com/tobymao/sqlglot/commit/ad8a408a4e3e26e32472fc55c67b44687992ae47) - **parser**: more robust nested pipe syntax *(PR [#5845](https://github.com/tobymao/sqlglot/pull/5845) by [@geooo109](https://github.com/geooo109))*
140
+ - [`44c9e70`](https://github.com/tobymao/sqlglot/commit/44c9e70bd8c9421035eb0e87e4286061ec5d2fa8) - **optimizer**: add tests for snowflake STARTSWITH function *(PR [#5847](https://github.com/tobymao/sqlglot/pull/5847) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
141
+ - [`0779c2d`](https://github.com/tobymao/sqlglot/commit/0779c2d4e8ce0228592de6882763940783fa5e87) - support BIT_X aggregates again for duckdb, postgres *(PR [#5851](https://github.com/tobymao/sqlglot/pull/5851) by [@georgesittas](https://github.com/georgesittas))*
142
+ - [`d131aab`](https://github.com/tobymao/sqlglot/commit/d131aab6815bf77d444a763d9bb4028d8f0e742d) - **redshift**: convert FETCH clauses to LIMIT for Redshift dialect *(PR [#5848](https://github.com/tobymao/sqlglot/pull/5848) by [@tomasmontielp](https://github.com/tomasmontielp))*
143
+ - [`b22c4ec`](https://github.com/tobymao/sqlglot/commit/b22c4ecf4c032d89ca737f01d614102aa9c2b1ed) - **fabric**: UUID to UNIQUEIDENTIFIER *(PR [#5863](https://github.com/tobymao/sqlglot/pull/5863) by [@fresioAS](https://github.com/fresioAS))*
144
+ - [`03d4f49`](https://github.com/tobymao/sqlglot/commit/03d4f49d92cd034d37074359b8c2cf96c5c3f5cf) - **clickhouse**: arrays are 1-indexed *(PR [#5862](https://github.com/tobymao/sqlglot/pull/5862) by [@joeyutong](https://github.com/joeyutong))*
145
+
146
+ ### :recycle: Refactors
147
+ - [`e441e16`](https://github.com/tobymao/sqlglot/commit/e441e16991626c2da2d38bc9c3a2b408e3f773bd) - make dump/pickling non-recursive to avoid hitting stack limits *(PR [#5850](https://github.com/tobymao/sqlglot/pull/5850) by [@tobymao](https://github.com/tobymao))*
148
+
149
+ ### :wrench: Chores
150
+ - [`b244f30`](https://github.com/tobymao/sqlglot/commit/b244f30524846bd08d03a73410ae9b4674254ecd) - move `exp.Contains` to `BOOLEAN` entry in `TYPE_TO_EXPRESSIONS` *(commit by [@georgesittas](https://github.com/georgesittas))*
151
+
152
+
4
153
  ## [v27.13.2] - 2025-09-08
5
154
  ### :bug: Bug Fixes
6
155
  - [`5e7979f`](https://github.com/tobymao/sqlglot/commit/5e7979f3cf5f7996e198ddd81069d49a4a3b9391) - select session *(PR [#5836](https://github.com/tobymao/sqlglot/pull/5836) by [@tobymao](https://github.com/tobymao))*
@@ -7178,3 +7327,5 @@ Changelog
7178
7327
  [v27.13.0]: https://github.com/tobymao/sqlglot/compare/v27.12.0...v27.13.0
7179
7328
  [v27.13.1]: https://github.com/tobymao/sqlglot/compare/v27.13.0...v27.13.1
7180
7329
  [v27.13.2]: https://github.com/tobymao/sqlglot/compare/v27.13.1...v27.13.2
7330
+ [v27.14.0]: https://github.com/tobymao/sqlglot/compare/v27.13.2...v27.14.0
7331
+ [v27.15.0]: https://github.com/tobymao/sqlglot/compare/v27.14.0...v27.15.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlglot
3
- Version: 27.14.0
3
+ Version: 27.15.1
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
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '27.14.0'
32
- __version_tuple__ = version_tuple = (27, 14, 0)
31
+ __version__ = version = '27.15.1'
32
+ __version_tuple__ = version_tuple = (27, 15, 1)
33
33
 
34
- __commit_id__ = commit_id = 'gb244f3052'
34
+ __commit_id__ = commit_id = 'g1ee026d22'
@@ -863,6 +863,9 @@ class BigQuery(Dialect):
863
863
  "TRANSLATE": lambda self: self._parse_translate(),
864
864
  "FEATURES_AT_TIME": lambda self: self._parse_features_at_time(),
865
865
  "GENERATE_EMBEDDING": lambda self: self._parse_ml(exp.GenerateEmbedding),
866
+ "GENERATE_TEXT_EMBEDDING": lambda self: self._parse_ml(
867
+ exp.GenerateEmbedding, is_text=True
868
+ ),
866
869
  "VECTOR_SEARCH": lambda self: self._parse_vector_search(),
867
870
  "FORECAST": lambda self: self._parse_ml(exp.MLForecast),
868
871
  }
@@ -894,8 +897,6 @@ class BigQuery(Dialect):
894
897
  RANGE_PARSERS = parser.Parser.RANGE_PARSERS.copy()
895
898
  RANGE_PARSERS.pop(TokenType.OVERLAPS)
896
899
 
897
- NULL_TOKENS = {TokenType.NULL, TokenType.UNKNOWN}
898
-
899
900
  DASHED_TABLE_PART_FOLLOW_TOKENS = {TokenType.DOT, TokenType.L_PAREN, TokenType.R_PAREN}
900
901
 
901
902
  STATEMENT_PARSERS = {
@@ -1148,7 +1149,7 @@ class BigQuery(Dialect):
1148
1149
 
1149
1150
  return expr
1150
1151
 
1151
- def _parse_ml(self, expr_type: t.Type[E]) -> E:
1152
+ def _parse_ml(self, expr_type: t.Type[E], **kwargs) -> E:
1152
1153
  self._match_text_seq("MODEL")
1153
1154
  this = self._parse_table()
1154
1155
 
@@ -1167,6 +1168,7 @@ class BigQuery(Dialect):
1167
1168
  this=this,
1168
1169
  expression=expression,
1169
1170
  params_struct=self._parse_bitwise(),
1171
+ **kwargs,
1170
1172
  )
1171
1173
 
1172
1174
  def _parse_translate(self) -> exp.Translate | exp.MLTranslate:
@@ -191,10 +191,8 @@ class MySQL(Dialect):
191
191
 
192
192
  KEYWORDS = {
193
193
  **tokens.Tokenizer.KEYWORDS,
194
- "CHARSET": TokenType.CHARACTER_SET,
195
- # The DESCRIBE and EXPLAIN statements are synonyms.
196
- # https://dev.mysql.com/doc/refman/8.4/en/explain.html
197
194
  "BLOB": TokenType.BLOB,
195
+ "CHARSET": TokenType.CHARACTER_SET,
198
196
  "DISTINCTROW": TokenType.DISTINCT,
199
197
  "EXPLAIN": TokenType.DESCRIBE,
200
198
  "FORCE": TokenType.FORCE,
@@ -204,17 +202,19 @@ class MySQL(Dialect):
204
202
  "LONGBLOB": TokenType.LONGBLOB,
205
203
  "LONGTEXT": TokenType.LONGTEXT,
206
204
  "MEDIUMBLOB": TokenType.MEDIUMBLOB,
207
- "TINYBLOB": TokenType.TINYBLOB,
208
- "TINYTEXT": TokenType.TINYTEXT,
209
- "MEDIUMTEXT": TokenType.MEDIUMTEXT,
210
205
  "MEDIUMINT": TokenType.MEDIUMINT,
206
+ "MEDIUMTEXT": TokenType.MEDIUMTEXT,
211
207
  "MEMBER OF": TokenType.MEMBER_OF,
208
+ "MOD": TokenType.MOD,
212
209
  "SEPARATOR": TokenType.SEPARATOR,
213
210
  "SERIAL": TokenType.SERIAL,
214
- "START": TokenType.BEGIN,
215
211
  "SIGNED": TokenType.BIGINT,
216
212
  "SIGNED INTEGER": TokenType.BIGINT,
213
+ "SOUNDS LIKE": TokenType.SOUNDS_LIKE,
214
+ "START": TokenType.BEGIN,
217
215
  "TIMESTAMP": TokenType.TIMESTAMPTZ,
216
+ "TINYBLOB": TokenType.TINYBLOB,
217
+ "TINYTEXT": TokenType.TINYTEXT,
218
218
  "UNLOCK TABLES": TokenType.COMMAND,
219
219
  "UNSIGNED": TokenType.UBIGINT,
220
220
  "UNSIGNED INTEGER": TokenType.UBIGINT,
@@ -271,6 +271,7 @@ class MySQL(Dialect):
271
271
  FUNC_TOKENS = {
272
272
  *parser.Parser.FUNC_TOKENS,
273
273
  TokenType.DATABASE,
274
+ TokenType.MOD,
274
275
  TokenType.SCHEMA,
275
276
  TokenType.VALUES,
276
277
  }
@@ -292,6 +293,11 @@ class MySQL(Dialect):
292
293
 
293
294
  RANGE_PARSERS = {
294
295
  **parser.Parser.RANGE_PARSERS,
296
+ TokenType.SOUNDS_LIKE: lambda self, this: self.expression(
297
+ exp.EQ,
298
+ this=self.expression(exp.Soundex, this=this),
299
+ expression=self.expression(exp.Soundex, this=self._parse_term()),
300
+ ),
295
301
  TokenType.MEMBER_OF: lambda self, this: self.expression(
296
302
  exp.JSONArrayContains,
297
303
  this=this,
@@ -359,6 +365,7 @@ class MySQL(Dialect):
359
365
  exp.Anonymous, this="VALUES", expressions=[self._parse_id_var()]
360
366
  ),
361
367
  "JSON_VALUE": lambda self: self._parse_json_value(),
368
+ "SUBSTR": lambda self: self._parse_substring(),
362
369
  }
363
370
 
364
371
  STATEMENT_PARSERS = {
@@ -424,6 +424,11 @@ class Postgres(Dialect):
424
424
  FUNCTION_PARSERS = {
425
425
  **parser.Parser.FUNCTION_PARSERS,
426
426
  "DATE_PART": lambda self: self._parse_date_part(),
427
+ "JSON_AGG": lambda self: self.expression(
428
+ exp.JSONArrayAgg,
429
+ this=self._parse_bitwise(),
430
+ order=self._parse_order(),
431
+ ),
427
432
  "JSONB_EXISTS": lambda self: self._parse_jsonb_exists(),
428
433
  }
429
434
 
@@ -608,6 +613,11 @@ class Postgres(Dialect):
608
613
  self, e, func_name="STRING_AGG", within_group=False
609
614
  ),
610
615
  exp.IntDiv: rename_func("DIV"),
616
+ exp.JSONArrayAgg: lambda self, e: self.func(
617
+ "JSON_AGG",
618
+ self.sql(e, "this"),
619
+ suffix=f"{self.sql(e, 'order')})",
620
+ ),
611
621
  exp.JSONExtract: _json_extract_sql("JSON_EXTRACT_PATH", "->"),
612
622
  exp.JSONExtractScalar: _json_extract_sql("JSON_EXTRACT_PATH_TEXT", "->>"),
613
623
  exp.JSONBExtract: lambda self, e: self.binary(e, "#>"),
@@ -527,6 +527,7 @@ class SingleStore(MySQL):
527
527
  e.expression,
528
528
  self.func("SUBSTRING", e.this, e.args.get("start") + e.args.get("length")),
529
529
  ),
530
+ exp.National: lambda self, e: self.national_sql(e, prefix=""),
530
531
  exp.Reduce: unsupported_args("finish")(
531
532
  lambda self, e: self.func(
532
533
  "REDUCE", e.args.get("initial"), e.this, e.args.get("merge")
@@ -1862,3 +1863,9 @@ class SingleStore(MySQL):
1862
1863
  collate = self.sql(expression, "collate")
1863
1864
  collate = f" COLLATE {collate}" if collate else ""
1864
1865
  return f"{alter}{collate}"
1866
+
1867
+ def computedcolumnconstraint_sql(self, expression: exp.ComputedColumnConstraint) -> str:
1868
+ this = self.sql(expression, "this")
1869
+ not_null = " NOT NULL" if expression.args.get("not_null") else ""
1870
+ type = self.sql(expression, "data_type") or "AUTO"
1871
+ return f"AS {this} PERSISTED {type}{not_null}"
@@ -6,6 +6,7 @@ from sqlglot import exp, generator, jsonpath, parser, tokens, transforms
6
6
  from sqlglot.dialects.dialect import (
7
7
  Dialect,
8
8
  NormalizationStrategy,
9
+ annotate_with_type_lambda,
9
10
  build_timetostr_or_tochar,
10
11
  binary_from_function,
11
12
  build_default_decimal_type,
@@ -377,6 +378,7 @@ def _qualify_unnested_columns(expression: exp.Expression) -> exp.Expression:
377
378
 
378
379
  taken_source_names = set(scope.sources)
379
380
  column_source: t.Dict[str, exp.Identifier] = {}
381
+ unnest_to_identifier: t.Dict[exp.Unnest, exp.Identifier] = {}
380
382
 
381
383
  unnest_identifier: t.Optional[exp.Identifier] = None
382
384
  orig_expression = expression.copy()
@@ -429,6 +431,7 @@ def _qualify_unnested_columns(expression: exp.Expression) -> exp.Expression:
429
431
  if not isinstance(unnest_identifier, exp.Identifier):
430
432
  return orig_expression
431
433
 
434
+ unnest_to_identifier[unnest] = unnest_identifier
432
435
  column_source.update({c.lower(): unnest_identifier for c in unnest_columns})
433
436
 
434
437
  for column in scope.columns:
@@ -442,6 +445,15 @@ def _qualify_unnested_columns(expression: exp.Expression) -> exp.Expression:
442
445
  and len(scope.sources) == 1
443
446
  and column.name.lower() != unnest_identifier.name.lower()
444
447
  ):
448
+ unnest_ancestor = column.find_ancestor(exp.Unnest, exp.Select)
449
+ ancestor_identifier = unnest_to_identifier.get(unnest_ancestor)
450
+ if (
451
+ isinstance(unnest_ancestor, exp.Unnest)
452
+ and ancestor_identifier
453
+ and ancestor_identifier.name.lower() == unnest_identifier.name.lower()
454
+ ):
455
+ continue
456
+
445
457
  table = unnest_identifier
446
458
 
447
459
  column.set("table", table and table.copy())
@@ -506,8 +518,49 @@ class Snowflake(Dialect):
506
518
  ALTER_TABLE_ADD_REQUIRED_FOR_EACH_COLUMN = False
507
519
  TRY_CAST_REQUIRES_STRING = True
508
520
 
521
+ TYPE_TO_EXPRESSIONS = {
522
+ **Dialect.TYPE_TO_EXPRESSIONS,
523
+ exp.DataType.Type.INT: {
524
+ *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.INT],
525
+ exp.Length,
526
+ },
527
+ exp.DataType.Type.VARCHAR: {
528
+ *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.VARCHAR],
529
+ exp.MD5,
530
+ exp.AIAgg,
531
+ exp.AISummarizeAgg,
532
+ exp.RegexpExtract,
533
+ exp.RegexpReplace,
534
+ exp.Repeat,
535
+ exp.Replace,
536
+ exp.SHA,
537
+ exp.SHA2,
538
+ exp.Space,
539
+ exp.Uuid,
540
+ },
541
+ exp.DataType.Type.BINARY: {
542
+ *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.BINARY],
543
+ exp.MD5Digest,
544
+ exp.SHA1Digest,
545
+ exp.SHA2Digest,
546
+ },
547
+ exp.DataType.Type.BIGINT: {
548
+ *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.BIGINT],
549
+ exp.MD5NumberLower64,
550
+ exp.MD5NumberUpper64,
551
+ },
552
+ exp.DataType.Type.ARRAY: {
553
+ exp.Split,
554
+ },
555
+ }
556
+
509
557
  ANNOTATORS = {
510
558
  **Dialect.ANNOTATORS,
559
+ **{
560
+ expr_type: annotate_with_type_lambda(data_type)
561
+ for data_type, expressions in TYPE_TO_EXPRESSIONS.items()
562
+ for expr_type in expressions
563
+ },
511
564
  **{
512
565
  expr_type: lambda self, e: self._annotate_by_args(e, "this")
513
566
  for expr_type in (
@@ -517,10 +570,7 @@ class Snowflake(Dialect):
517
570
  )
518
571
  },
519
572
  exp.ConcatWs: lambda self, e: self._annotate_by_args(e, "expressions"),
520
- exp.Length: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.INT),
521
- exp.Replace: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
522
573
  exp.Reverse: _annotate_reverse,
523
- exp.Space: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
524
574
  }
525
575
 
526
576
  TIME_MAPPING = {
@@ -640,6 +690,10 @@ class Snowflake(Dialect):
640
690
  ),
641
691
  "HEX_DECODE_BINARY": exp.Unhex.from_arg_list,
642
692
  "IFF": exp.If.from_arg_list,
693
+ "MD5_HEX": exp.MD5.from_arg_list,
694
+ "MD5_BINARY": exp.MD5Digest.from_arg_list,
695
+ "MD5_NUMBER_LOWER64": exp.MD5NumberLower64.from_arg_list,
696
+ "MD5_NUMBER_UPPER64": exp.MD5NumberUpper64.from_arg_list,
643
697
  "LAST_DAY": lambda args: exp.LastDay(
644
698
  this=seq_get(args, 0), unit=map_date_part(seq_get(args, 1))
645
699
  ),
@@ -647,12 +701,17 @@ class Snowflake(Dialect):
647
701
  "LENGTH": lambda args: exp.Length(this=seq_get(args, 0), binary=True),
648
702
  "NULLIFZERO": _build_if_from_nullifzero,
649
703
  "OBJECT_CONSTRUCT": _build_object_construct,
704
+ "OCTET_LENGTH": exp.ByteLength.from_arg_list,
650
705
  "REGEXP_EXTRACT_ALL": _build_regexp_extract(exp.RegexpExtractAll),
651
706
  "REGEXP_REPLACE": _build_regexp_replace,
652
707
  "REGEXP_SUBSTR": _build_regexp_extract(exp.RegexpExtract),
653
708
  "REGEXP_SUBSTR_ALL": _build_regexp_extract(exp.RegexpExtractAll),
654
709
  "REPLACE": build_replace_with_optional_replacement,
655
710
  "RLIKE": exp.RegexpLike.from_arg_list,
711
+ "SHA1_BINARY": exp.SHA1Digest.from_arg_list,
712
+ "SHA1_HEX": exp.SHA.from_arg_list,
713
+ "SHA2_BINARY": exp.SHA2Digest.from_arg_list,
714
+ "SHA2_HEX": exp.SHA2.from_arg_list,
656
715
  "SQUARE": lambda args: exp.Pow(this=seq_get(args, 0), expression=exp.Literal.number(2)),
657
716
  "TABLE": lambda args: exp.TableFromRows(this=seq_get(args, 0)),
658
717
  "TIMEADD": _build_date_time_add(exp.TimeAdd),
@@ -1318,6 +1377,8 @@ class Snowflake(Dialect):
1318
1377
  ),
1319
1378
  exp.SHA: rename_func("SHA1"),
1320
1379
  exp.MD5Digest: rename_func("MD5_BINARY"),
1380
+ exp.MD5NumberLower64: rename_func("MD5_NUMBER_LOWER64"),
1381
+ exp.MD5NumberUpper64: rename_func("MD5_NUMBER_UPPER64"),
1321
1382
  exp.LowerHex: rename_func("TO_CHAR"),
1322
1383
  exp.SortArray: rename_func("ARRAY_SORT"),
1323
1384
  exp.StarMap: rename_func("OBJECT_CONSTRUCT"),
@@ -1356,6 +1417,7 @@ class Snowflake(Dialect):
1356
1417
  exp.VarMap: lambda self, e: var_map_sql(self, e, "OBJECT_CONSTRUCT"),
1357
1418
  exp.WeekOfYear: rename_func("WEEKOFYEAR"),
1358
1419
  exp.Xor: rename_func("BOOLXOR"),
1420
+ exp.ByteLength: rename_func("OCTET_LENGTH"),
1359
1421
  }
1360
1422
 
1361
1423
  SUPPORTED_JSON_PATH_PARTS = {
@@ -650,6 +650,16 @@ class TSQL(Dialect):
650
650
  "NEXT": lambda self: self._parse_next_value_for(),
651
651
  }
652
652
 
653
+ FUNCTION_PARSERS: t.Dict[str, t.Callable] = {
654
+ **parser.Parser.FUNCTION_PARSERS,
655
+ "JSON_ARRAYAGG": lambda self: self.expression(
656
+ exp.JSONArrayAgg,
657
+ this=self._parse_bitwise(),
658
+ order=self._parse_order(),
659
+ null_handling=self._parse_on_handling("NULL", "NULL", "ABSENT"),
660
+ ),
661
+ }
662
+
653
663
  # The DCOLON (::) operator serves as a scope resolution (exp.ScopeResolution) operator in T-SQL
654
664
  COLUMN_OPERATORS = {
655
665
  **parser.Parser.COLUMN_OPERATORS,
@@ -134,7 +134,7 @@ class Expression(metaclass=_Expression):
134
134
 
135
135
  return hash((self.__class__, self.hashable_args))
136
136
 
137
- def __reduce__(self) -> t.Tuple[t.Callable, t.Tuple[t.Dict[str, t.Any]]]:
137
+ def __reduce__(self) -> t.Tuple[t.Callable, t.Tuple[t.List[t.Dict[str, t.Any]]]]:
138
138
  from sqlglot.serde import dump, load
139
139
 
140
140
  return (load, (dump(self),))
@@ -264,7 +264,7 @@ class Expression(metaclass=_Expression):
264
264
  return self.type is not None and self.type.is_type(*dtypes)
265
265
 
266
266
  def is_leaf(self) -> bool:
267
- return not any(isinstance(v, (Expression, list)) for v in self.args.values())
267
+ return not any(isinstance(v, (Expression, list)) and v for v in self.args.values())
268
268
 
269
269
  @property
270
270
  def meta(self) -> t.Dict[str, t.Any]:
@@ -2065,7 +2065,7 @@ class ProjectionPolicyColumnConstraint(ColumnConstraintKind):
2065
2065
  # computed column expression
2066
2066
  # https://learn.microsoft.com/en-us/sql/t-sql/statements/create-table-transact-sql?view=sql-server-ver16
2067
2067
  class ComputedColumnConstraint(ColumnConstraintKind):
2068
- arg_types = {"this": True, "persisted": False, "not_null": False}
2068
+ arg_types = {"this": True, "persisted": False, "not_null": False, "data_type": False}
2069
2069
 
2070
2070
 
2071
2071
  class Constraint(Expression):
@@ -5766,6 +5766,15 @@ class ArrayUniqueAgg(AggFunc):
5766
5766
  pass
5767
5767
 
5768
5768
 
5769
+ class AIAgg(AggFunc):
5770
+ arg_types = {"this": True, "expression": True}
5771
+ _sql_names = ["AI_AGG"]
5772
+
5773
+
5774
+ class AISummarizeAgg(AggFunc):
5775
+ _sql_names = ["AI_SUMMARIZE_AGG"]
5776
+
5777
+
5769
5778
  class ArrayAll(Func):
5770
5779
  arg_types = {"this": True, "expression": True}
5771
5780
 
@@ -6951,6 +6960,16 @@ class MD5Digest(Func):
6951
6960
  _sql_names = ["MD5_DIGEST"]
6952
6961
 
6953
6962
 
6963
+ # https://docs.snowflake.com/en/sql-reference/functions/md5_number_lower64
6964
+ class MD5NumberLower64(Func):
6965
+ pass
6966
+
6967
+
6968
+ # https://docs.snowflake.com/en/sql-reference/functions/md5_number_upper64
6969
+ class MD5NumberUpper64(Func):
6970
+ pass
6971
+
6972
+
6954
6973
  class Median(AggFunc):
6955
6974
  pass
6956
6975
 
@@ -7001,7 +7020,7 @@ class FeaturesAtTime(Func):
7001
7020
 
7002
7021
  # https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-generate-embedding
7003
7022
  class GenerateEmbedding(Func):
7004
- arg_types = {"this": True, "expression": True, "params_struct": False}
7023
+ arg_types = {"this": True, "expression": True, "params_struct": False, "is_text": False}
7005
7024
 
7006
7025
 
7007
7026
  class MLForecast(Func):
@@ -7201,6 +7220,16 @@ class SHA2(Func):
7201
7220
  arg_types = {"this": True, "length": False}
7202
7221
 
7203
7222
 
7223
+ # Represents the variant of the SHA1 function that returns a binary value
7224
+ class SHA1Digest(Func):
7225
+ pass
7226
+
7227
+
7228
+ # Represents the variant of the SHA2 function that returns a binary value
7229
+ class SHA2Digest(Func):
7230
+ arg_types = {"this": True, "length": False}
7231
+
7232
+
7204
7233
  class Sign(Func):
7205
7234
  _sql_names = ["SIGN", "SIGNUM"]
7206
7235
 
@@ -4235,7 +4235,8 @@ class Generator(metaclass=_Generator):
4235
4235
  return self._ml_sql(expression, "PREDICT")
4236
4236
 
4237
4237
  def generateembedding_sql(self, expression: exp.GenerateEmbedding) -> str:
4238
- return self._ml_sql(expression, "GENERATE_EMBEDDING")
4238
+ name = "GENERATE_TEXT_EMBEDDING" if expression.args.get("is_text") else "GENERATE_EMBEDDING"
4239
+ return self._ml_sql(expression, name)
4239
4240
 
4240
4241
  def mltranslate_sql(self, expression: exp.MLTranslate) -> str:
4241
4242
  return self._ml_sql(expression, "TRANSLATE")
@@ -593,14 +593,18 @@ class TypeAnnotator(metaclass=_TypeAnnotator):
593
593
  def _annotate_struct_value(
594
594
  self, expression: exp.Expression
595
595
  ) -> t.Optional[exp.DataType] | exp.ColumnDef:
596
- alias = expression.args.get("alias")
597
- if alias:
596
+ # Case: STRUCT(key AS value)
597
+ if alias := expression.args.get("alias"):
598
598
  return exp.ColumnDef(this=alias.copy(), kind=expression.type)
599
599
 
600
- # Case: key = value or key := value
600
+ # Case: STRUCT(key = value) or STRUCT(key := value)
601
601
  if expression.expression:
602
602
  return exp.ColumnDef(this=expression.this.copy(), kind=expression.expression.type)
603
603
 
604
+ # Case: STRUCT(c)
605
+ if isinstance(expression, exp.Column):
606
+ return exp.ColumnDef(this=expression.this.copy(), kind=expression.type)
607
+
604
608
  return expression.type
605
609
 
606
610
  def _annotate_struct(self, expression: exp.Struct) -> exp.Struct: