sqlglot 27.12.0__tar.gz → 27.13.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 (226) hide show
  1. {sqlglot-27.12.0 → sqlglot-27.13.1}/CHANGELOG.md +193 -0
  2. {sqlglot-27.12.0 → sqlglot-27.13.1}/PKG-INFO +1 -1
  3. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/_version.py +3 -3
  4. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/bigquery.py +8 -1
  5. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/dialect.py +13 -1
  6. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/dremio.py +4 -0
  7. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/mysql.py +11 -1
  8. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/oracle.py +2 -0
  9. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/postgres.py +1 -2
  10. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/singlestore.py +76 -2
  11. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/snowflake.py +27 -0
  12. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/spark.py +8 -0
  13. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/expressions.py +10 -6
  14. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/generator.py +24 -3
  15. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/parser.py +33 -18
  16. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/tokens.py +1 -2
  17. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot.egg-info/PKG-INFO +1 -1
  18. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_bigquery.py +76 -6
  19. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_dialect.py +13 -68
  20. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_duckdb.py +0 -9
  21. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_hive.py +0 -9
  22. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_mysql.py +6 -0
  23. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_oracle.py +6 -0
  24. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_postgres.py +31 -0
  25. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_presto.py +26 -0
  26. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_redshift.py +7 -1
  27. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_singlestore.py +104 -1
  28. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_snowflake.py +13 -1
  29. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/identity.sql +3 -0
  30. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/annotate_functions.sql +57 -1
  31. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/test_parser.py +1 -1
  32. {sqlglot-27.12.0 → sqlglot-27.13.1}/.gitignore +0 -0
  33. {sqlglot-27.12.0 → sqlglot-27.13.1}/.gitpod.yml +0 -0
  34. {sqlglot-27.12.0 → sqlglot-27.13.1}/.pre-commit-config.yaml +0 -0
  35. {sqlglot-27.12.0 → sqlglot-27.13.1}/CONTRIBUTING.md +0 -0
  36. {sqlglot-27.12.0 → sqlglot-27.13.1}/LICENSE +0 -0
  37. {sqlglot-27.12.0 → sqlglot-27.13.1}/MANIFEST.in +0 -0
  38. {sqlglot-27.12.0 → sqlglot-27.13.1}/Makefile +0 -0
  39. {sqlglot-27.12.0 → sqlglot-27.13.1}/README.md +0 -0
  40. {sqlglot-27.12.0 → sqlglot-27.13.1}/pyproject.toml +0 -0
  41. {sqlglot-27.12.0 → sqlglot-27.13.1}/setup.cfg +0 -0
  42. {sqlglot-27.12.0 → sqlglot-27.13.1}/setup.py +0 -0
  43. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/__init__.py +0 -0
  44. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/__main__.py +0 -0
  45. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/_typing.py +0 -0
  46. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/__init__.py +0 -0
  47. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/athena.py +0 -0
  48. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/clickhouse.py +0 -0
  49. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/databricks.py +0 -0
  50. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/doris.py +0 -0
  51. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/drill.py +0 -0
  52. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/druid.py +0 -0
  53. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/duckdb.py +0 -0
  54. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/dune.py +0 -0
  55. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/exasol.py +0 -0
  56. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/fabric.py +0 -0
  57. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/hive.py +0 -0
  58. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/materialize.py +0 -0
  59. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/presto.py +0 -0
  60. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/prql.py +0 -0
  61. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/redshift.py +0 -0
  62. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/risingwave.py +0 -0
  63. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/spark2.py +0 -0
  64. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/sqlite.py +0 -0
  65. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/starrocks.py +0 -0
  66. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/tableau.py +0 -0
  67. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/teradata.py +0 -0
  68. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/trino.py +0 -0
  69. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/dialects/tsql.py +0 -0
  70. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/diff.py +0 -0
  71. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/errors.py +0 -0
  72. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/executor/__init__.py +0 -0
  73. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/executor/context.py +0 -0
  74. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/executor/env.py +0 -0
  75. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/executor/python.py +0 -0
  76. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/executor/table.py +0 -0
  77. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/helper.py +0 -0
  78. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/jsonpath.py +0 -0
  79. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/lineage.py +0 -0
  80. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/optimizer/__init__.py +0 -0
  81. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/optimizer/annotate_types.py +0 -0
  82. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/optimizer/canonicalize.py +0 -0
  83. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/optimizer/eliminate_ctes.py +0 -0
  84. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/optimizer/eliminate_joins.py +0 -0
  85. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
  86. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/optimizer/isolate_table_selects.py +0 -0
  87. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/optimizer/merge_subqueries.py +0 -0
  88. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/optimizer/normalize.py +0 -0
  89. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/optimizer/normalize_identifiers.py +0 -0
  90. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/optimizer/optimize_joins.py +0 -0
  91. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/optimizer/optimizer.py +0 -0
  92. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/optimizer/pushdown_predicates.py +0 -0
  93. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/optimizer/pushdown_projections.py +0 -0
  94. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/optimizer/qualify.py +0 -0
  95. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/optimizer/qualify_columns.py +0 -0
  96. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/optimizer/qualify_tables.py +0 -0
  97. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/optimizer/scope.py +0 -0
  98. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/optimizer/simplify.py +0 -0
  99. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/optimizer/unnest_subqueries.py +0 -0
  100. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/planner.py +0 -0
  101. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/py.typed +0 -0
  102. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/schema.py +0 -0
  103. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/serde.py +0 -0
  104. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/time.py +0 -0
  105. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/transforms.py +0 -0
  106. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot/trie.py +0 -0
  107. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot.egg-info/SOURCES.txt +0 -0
  108. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot.egg-info/dependency_links.txt +0 -0
  109. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot.egg-info/requires.txt +0 -0
  110. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot.egg-info/top_level.txt +0 -0
  111. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglot.png +0 -0
  112. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglotrs/Cargo.lock +0 -0
  113. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglotrs/Cargo.toml +0 -0
  114. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglotrs/benches/dialect_settings.json +0 -0
  115. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglotrs/benches/long.rs +0 -0
  116. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglotrs/benches/token_type_settings.json +0 -0
  117. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglotrs/benches/tokenizer_dialect_settings.json +0 -0
  118. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglotrs/benches/tokenizer_settings.json +0 -0
  119. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglotrs/pyproject.toml +0 -0
  120. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglotrs/src/lib.rs +0 -0
  121. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglotrs/src/settings.rs +0 -0
  122. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglotrs/src/token.rs +0 -0
  123. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglotrs/src/tokenizer.rs +0 -0
  124. {sqlglot-27.12.0 → sqlglot-27.13.1}/sqlglotrs/src/trie.rs +0 -0
  125. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/__init__.py +0 -0
  126. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/__init__.py +0 -0
  127. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_athena.py +0 -0
  128. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_clickhouse.py +0 -0
  129. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_databricks.py +0 -0
  130. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_doris.py +0 -0
  131. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_dremio.py +0 -0
  132. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_drill.py +0 -0
  133. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_druid.py +0 -0
  134. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_dune.py +0 -0
  135. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_exasol.py +0 -0
  136. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_fabric.py +0 -0
  137. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_materialize.py +0 -0
  138. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_pipe_syntax.py +0 -0
  139. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_prql.py +0 -0
  140. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_risingwave.py +0 -0
  141. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_spark.py +0 -0
  142. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_sqlite.py +0 -0
  143. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_starrocks.py +0 -0
  144. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_tableau.py +0 -0
  145. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_teradata.py +0 -0
  146. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_trino.py +0 -0
  147. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/dialects/test_tsql.py +0 -0
  148. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/jsonpath/LICENSE +0 -0
  149. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/jsonpath/cts.json +0 -0
  150. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/annotate_types.sql +0 -0
  151. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/canonicalize.sql +0 -0
  152. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
  153. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/eliminate_joins.sql +0 -0
  154. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
  155. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
  156. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
  157. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/normalize.sql +0 -0
  158. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
  159. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
  160. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/optimizer.sql +0 -0
  161. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
  162. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
  163. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/pushdown_projections.sql +0 -0
  164. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/qualify_columns.sql +0 -0
  165. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
  166. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
  167. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
  168. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
  169. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
  170. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/simplify.sql +0 -0
  171. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
  172. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
  173. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
  174. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
  175. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
  176. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
  177. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
  178. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
  179. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
  180. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
  181. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
  182. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
  183. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
  184. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
  185. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
  186. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
  187. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
  188. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
  189. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
  190. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
  191. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
  192. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
  193. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
  194. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
  195. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
  196. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
  197. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
  198. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
  199. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
  200. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
  201. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
  202. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
  203. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
  204. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
  205. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/optimizer/unnest_subqueries.sql +0 -0
  206. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/partial.sql +0 -0
  207. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/fixtures/pretty.sql +0 -0
  208. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/gen_fixtures.py +0 -0
  209. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/helpers.py +0 -0
  210. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/test_build.py +0 -0
  211. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/test_dialect_imports.py +0 -0
  212. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/test_diff.py +0 -0
  213. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/test_docs.py +0 -0
  214. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/test_executor.py +0 -0
  215. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/test_expressions.py +0 -0
  216. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/test_generator.py +0 -0
  217. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/test_helper.py +0 -0
  218. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/test_jsonpath.py +0 -0
  219. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/test_lineage.py +0 -0
  220. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/test_optimizer.py +0 -0
  221. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/test_schema.py +0 -0
  222. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/test_serde.py +0 -0
  223. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/test_time.py +0 -0
  224. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/test_tokens.py +0 -0
  225. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/test_transforms.py +0 -0
  226. {sqlglot-27.12.0 → sqlglot-27.13.1}/tests/test_transpile.py +0 -0
@@ -1,6 +1,197 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## [v27.13.0] - 2025-09-08
5
+ ### :boom: BREAKING CHANGES
6
+ - due to [`3726b33`](https://github.com/tobymao/sqlglot/commit/3726b33bb6b4ab286617f510e96e1fbd27c429f3) - support nulls_first arg for array_sort *(PR [#5802](https://github.com/tobymao/sqlglot/pull/5802) by [@treysp](https://github.com/treysp))*:
7
+
8
+ support nulls_first arg for array_sort (#5802)
9
+
10
+ - due to [`cf1d1e3`](https://github.com/tobymao/sqlglot/commit/cf1d1e3e0ef9e6cd1b1c6128c63ddf06c30f1339) - annotate type for snowflake's REVERSE function *(PR [#5803](https://github.com/tobymao/sqlglot/pull/5803) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*:
11
+
12
+ annotate type for snowflake's REVERSE function (#5803)
13
+
14
+ - due to [`ad0b407`](https://github.com/tobymao/sqlglot/commit/ad0b407098e1611d4fc0e1f0916511337b9aefdb) - Mark 'BEGIN' as TokenType.BEGIN for transactions *(PR [#5826](https://github.com/tobymao/sqlglot/pull/5826) by [@VaggelisD](https://github.com/VaggelisD))*:
15
+
16
+ Mark 'BEGIN' as TokenType.BEGIN for transactions (#5826)
17
+
18
+ - due to [`0198282`](https://github.com/tobymao/sqlglot/commit/0198282a82bbf3e81476e164718d63fd1210acdc) - : Update tests for concat string function *(PR [#5809](https://github.com/tobymao/sqlglot/pull/5809) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
19
+
20
+ : Update tests for concat string function (#5809)
21
+
22
+ - due to [`db2c430`](https://github.com/tobymao/sqlglot/commit/db2c4303237a1244070c359245c398a724df6de2) - annoate the "contains" function *(PR [#5829](https://github.com/tobymao/sqlglot/pull/5829) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
23
+
24
+ annoate the "contains" function (#5829)
25
+
26
+
27
+ ### :sparkles: New Features
28
+ - [`cf1d1e3`](https://github.com/tobymao/sqlglot/commit/cf1d1e3e0ef9e6cd1b1c6128c63ddf06c30f1339) - **optimizer**: annotate type for snowflake's REVERSE function *(PR [#5803](https://github.com/tobymao/sqlglot/pull/5803) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
29
+ - [`1d07c52`](https://github.com/tobymao/sqlglot/commit/1d07c52badb2e392e6895cbb275d2224789366c9) - **SingleStore**: Implemented generation of CURRENT_DATETIME *(PR [#5816](https://github.com/tobymao/sqlglot/pull/5816) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
30
+ - [`cad4fd0`](https://github.com/tobymao/sqlglot/commit/cad4fd0c5b0ec90e693fa6883af0ab287b921019) - **singlestore**: Added handling of exp.JSONObject *(PR [#5817](https://github.com/tobymao/sqlglot/pull/5817) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
31
+ - [`e3cb076`](https://github.com/tobymao/sqlglot/commit/e3cb0766bd5c3ccb31ea52cfc76201f548798dc1) - **singlestore**: Implemented generation of exp.StandardHash *(PR [#5823](https://github.com/tobymao/sqlglot/pull/5823) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
32
+ - [`0198282`](https://github.com/tobymao/sqlglot/commit/0198282a82bbf3e81476e164718d63fd1210acdc) - **optimizer**: : Update tests for concat string function *(PR [#5809](https://github.com/tobymao/sqlglot/pull/5809) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
33
+ - [`4e8a436`](https://github.com/tobymao/sqlglot/commit/4e8a436c16f487a72bd1ac2432bcb1c46599d901) - **singlestore**: Added generation of exp.JSONExists *(PR [#5820](https://github.com/tobymao/sqlglot/pull/5820) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
34
+ - [`82bea49`](https://github.com/tobymao/sqlglot/commit/82bea49978ae459492b5127a2a52049826e2fd06) - **singlestore**: Refactored parsing of JSON_BUILD_OBJECT *(PR [#5828](https://github.com/tobymao/sqlglot/pull/5828) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
35
+ - [`f7d38c3`](https://github.com/tobymao/sqlglot/commit/f7d38c3a10c505346f04e39a2712d60b4c96370f) - **singlestore**: Implemented generation of exp.Stuff *(PR [#5825](https://github.com/tobymao/sqlglot/pull/5825) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
36
+ - [`030a5b5`](https://github.com/tobymao/sqlglot/commit/030a5b5ea03ecee869b07cfd27f4ea044732822e) - **singlestore**: Added generation of exp.JSONBExists *(PR [#5821](https://github.com/tobymao/sqlglot/pull/5821) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
37
+ - [`e58fef1`](https://github.com/tobymao/sqlglot/commit/e58fef1d6dc654a3b36461bcbea21c99cdc96477) - **singlestore**: Implemented parsing and generation of exp.MatchAgainst *(PR [#5822](https://github.com/tobymao/sqlglot/pull/5822) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
38
+ - [`e94f530`](https://github.com/tobymao/sqlglot/commit/e94f530af0e0cdad995b4c8dc5ed86953490d37f) - **singlestore**: Added handling of exp.JSONArray *(PR [#5818](https://github.com/tobymao/sqlglot/pull/5818) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
39
+ - [`1c42ef4`](https://github.com/tobymao/sqlglot/commit/1c42ef4374aeab8a1ee9848892d7f8c4511c7f04) - **singlestore**: Fixed parsing/generation of exp.JSONArrayAgg *(PR [#5819](https://github.com/tobymao/sqlglot/pull/5819) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
40
+ - [`67219f0`](https://github.com/tobymao/sqlglot/commit/67219f0606231514f430e146e2fdb99e796f718b) - **singlestore**: Added support of UTC_TIMESTAMP and CURRENT_TIMESTAMP *(PR [#5808](https://github.com/tobymao/sqlglot/pull/5808) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
41
+ - [`db2c430`](https://github.com/tobymao/sqlglot/commit/db2c4303237a1244070c359245c398a724df6de2) - **optimizer**: annoate the "contains" function *(PR [#5829](https://github.com/tobymao/sqlglot/pull/5829) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
42
+
43
+ ### :bug: Bug Fixes
44
+ - [`3726b33`](https://github.com/tobymao/sqlglot/commit/3726b33bb6b4ab286617f510e96e1fbd27c429f3) - **snowflake**: support nulls_first arg for array_sort *(PR [#5802](https://github.com/tobymao/sqlglot/pull/5802) by [@treysp](https://github.com/treysp))*
45
+ - [`3408de0`](https://github.com/tobymao/sqlglot/commit/3408de09e50d2510c1a6f511dc2dec357059044f) - parsing quoted built-in data types *(PR [#5810](https://github.com/tobymao/sqlglot/pull/5810) by [@treysp](https://github.com/treysp))*
46
+ - [`ad0b407`](https://github.com/tobymao/sqlglot/commit/ad0b407098e1611d4fc0e1f0916511337b9aefdb) - **postgres**: Mark 'BEGIN' as TokenType.BEGIN for transactions *(PR [#5826](https://github.com/tobymao/sqlglot/pull/5826) by [@VaggelisD](https://github.com/VaggelisD))*
47
+ - :arrow_lower_right: *fixes issue [#5815](https://github.com/tobymao/sqlglot/issues/5815) opened by [@karakanb](https://github.com/karakanb)*
48
+ - [`e1a1b5b`](https://github.com/tobymao/sqlglot/commit/e1a1b5befefb0ca30ac1310cecb82a44f6089034) - **snowflake**: transpile BigQuery's `&` to `BITAND` *(PR [#5827](https://github.com/tobymao/sqlglot/pull/5827) by [@YuvalOmerRep](https://github.com/YuvalOmerRep))*
49
+ - [`32d0278`](https://github.com/tobymao/sqlglot/commit/32d027827eaa7aa0cd9faf2ac1f84739f914050f) - parse and generation of BITWISE AGG funcs across dialects *(PR [#5831](https://github.com/tobymao/sqlglot/pull/5831) by [@geooo109](https://github.com/geooo109))*
50
+ - [`5f39a83`](https://github.com/tobymao/sqlglot/commit/5f39a83f1ff957aca57eb4745f83c296436acaac) - **bigquery**: properly generate `LIMIT` for `STRING_AGG` *(PR [#5830](https://github.com/tobymao/sqlglot/pull/5830) by [@georgesittas](https://github.com/georgesittas))*
51
+
52
+ ### :wrench: Chores
53
+ - [`164fec1`](https://github.com/tobymao/sqlglot/commit/164fec1b36e3c7df41e2e5a5ad6b226fc5f76305) - **optimizer**: test type annotation for snowflake CHARINDEX function *(PR [#5805](https://github.com/tobymao/sqlglot/pull/5805) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
54
+
55
+
56
+ ## [v27.12.0] - 2025-09-04
57
+ ### :boom: BREAKING CHANGES
58
+ - due to [`1c551d5`](https://github.com/tobymao/sqlglot/commit/1c551d5ed3315e314013c1f063deabd9d8613e5d) - parse and annotate type for bq TO_JSON *(PR [#5768](https://github.com/tobymao/sqlglot/pull/5768) by [@geooo109](https://github.com/geooo109))*:
59
+
60
+ parse and annotate type for bq TO_JSON (#5768)
61
+
62
+ - due to [`1707f2d`](https://github.com/tobymao/sqlglot/commit/1707f2d7f9d3b58e8c216db638f8e572f9fe6f13) - annotate type for ABS *(PR [#5770](https://github.com/tobymao/sqlglot/pull/5770) by [@geooo109](https://github.com/geooo109))*:
63
+
64
+ annotate type for ABS (#5770)
65
+
66
+ - due to [`69acc51`](https://github.com/tobymao/sqlglot/commit/69acc5142b2d4f0b30832c350aa49f16d1adabef) - annotate type for bq IS_INF, IS_NAN *(PR [#5771](https://github.com/tobymao/sqlglot/pull/5771) by [@geooo109](https://github.com/geooo109))*:
67
+
68
+ annotate type for bq IS_INF, IS_NAN (#5771)
69
+
70
+ - due to [`0da2076`](https://github.com/tobymao/sqlglot/commit/0da207652331920416b29e2cc67bdc3c3f964466) - annotate type for bq CBRT *(PR [#5772](https://github.com/tobymao/sqlglot/pull/5772) by [@geooo109](https://github.com/geooo109))*:
71
+
72
+ annotate type for bq CBRT (#5772)
73
+
74
+ - due to [`a4968cb`](https://github.com/tobymao/sqlglot/commit/a4968cb5693670c1a2e9cd2c86404dd90fd76160) - annotate type for bq RAND *(PR [#5774](https://github.com/tobymao/sqlglot/pull/5774) by [@geooo109](https://github.com/geooo109))*:
75
+
76
+ annotate type for bq RAND (#5774)
77
+
78
+ - due to [`3e63350`](https://github.com/tobymao/sqlglot/commit/3e63350bd1d58b510cecd1a573d27be3fd2565ce) - parse and annotate type for bq ACOS *(PR [#5776](https://github.com/tobymao/sqlglot/pull/5776) by [@geooo109](https://github.com/geooo109))*:
79
+
80
+ parse and annotate type for bq ACOS (#5776)
81
+
82
+ - due to [`2be9d01`](https://github.com/tobymao/sqlglot/commit/2be9d01830c778186dc274c94c6db0dd6c4116d1) - parse and annotate type for bq ACOSH *(PR [#5779](https://github.com/tobymao/sqlglot/pull/5779) by [@geooo109](https://github.com/geooo109))*:
83
+
84
+ parse and annotate type for bq ACOSH (#5779)
85
+
86
+ - due to [`b77d3da`](https://github.com/tobymao/sqlglot/commit/b77d3da8f2548858d2b9d8590fcde83e1ec62b8a) - remove `"EXCLUDE" -> TokenType.EXCEPT` in DuckDB, Snowflake *(PR [#5766](https://github.com/tobymao/sqlglot/pull/5766) by [@treysp](https://github.com/treysp))*:
87
+
88
+ remove `"EXCLUDE" -> TokenType.EXCEPT` in DuckDB, Snowflake (#5766)
89
+
90
+ - due to [`7da2f31`](https://github.com/tobymao/sqlglot/commit/7da2f31d6613f16585e98c3fa1f592c617ae40c9) - parse and annotate type for bq ASIN/H *(PR [#5783](https://github.com/tobymao/sqlglot/pull/5783) by [@geooo109](https://github.com/geooo109))*:
91
+
92
+ parse and annotate type for bq ASIN/H (#5783)
93
+
94
+ - due to [`341ea83`](https://github.com/tobymao/sqlglot/commit/341ea83a07c707fdbf565b8d9ef4b9b6341ed1d5) - parse and annotate type for bq ATAN/H/2 *(PR [#5784](https://github.com/tobymao/sqlglot/pull/5784) by [@geooo109](https://github.com/geooo109))*:
95
+
96
+ parse and annotate type for bq ATAN/H/2 (#5784)
97
+
98
+ - due to [`aa360cb`](https://github.com/tobymao/sqlglot/commit/aa360cb0e204aa056557ff8b15aa2d4f678430e6) - use regexp_like as it exists *(PR [#5781](https://github.com/tobymao/sqlglot/pull/5781) by [@jasonthomassql](https://github.com/jasonthomassql))*:
99
+
100
+ use regexp_like as it exists (#5781)
101
+
102
+ - due to [`c2a1ad4`](https://github.com/tobymao/sqlglot/commit/c2a1ad4050771401a5b26bcadd90060e4527fbff) - parse and annotate type for bq COT/H *(PR [#5786](https://github.com/tobymao/sqlglot/pull/5786) by [@geooo109](https://github.com/geooo109))*:
103
+
104
+ parse and annotate type for bq COT/H (#5786)
105
+
106
+ - due to [`316ae91`](https://github.com/tobymao/sqlglot/commit/316ae913d8b1a63f3071ebb1b826328108d74cef) - Added handling of UTC_DATE and exp.CurrentDate *(PR [#5785](https://github.com/tobymao/sqlglot/pull/5785) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*:
107
+
108
+ Added handling of UTC_DATE and exp.CurrentDate (#5785)
109
+
110
+ - due to [`2c6d237`](https://github.com/tobymao/sqlglot/commit/2c6d23742ea9fcc2b9c784315d3d5364e360fea5) - parse and annotate type for bq CSC/H *(PR [#5787](https://github.com/tobymao/sqlglot/pull/5787) by [@geooo109](https://github.com/geooo109))*:
111
+
112
+ parse and annotate type for bq CSC/H (#5787)
113
+
114
+ - due to [`8a35076`](https://github.com/tobymao/sqlglot/commit/8a350763c2337f6910a5f0e19af387ba488fcb70) - parse and annotate type for bq SEC/H *(PR [#5788](https://github.com/tobymao/sqlglot/pull/5788) by [@geooo109](https://github.com/geooo109))*:
115
+
116
+ parse and annotate type for bq SEC/H (#5788)
117
+
118
+ - due to [`79901cb`](https://github.com/tobymao/sqlglot/commit/79901cb506737ae1932fa44a705858d2597ee587) - parse and annotate type for bq SIN\H *(PR [#5790](https://github.com/tobymao/sqlglot/pull/5790) by [@geooo109](https://github.com/geooo109))*:
119
+
120
+ parse and annotate type for bq SIN\H (#5790)
121
+
122
+ - due to [`74fb547`](https://github.com/tobymao/sqlglot/commit/74fb5476def1b389da425885db56bd6592fd7f78) - parse and annotate type for bq RANGE_BUCKET *(PR [#5793](https://github.com/tobymao/sqlglot/pull/5793) by [@geooo109](https://github.com/geooo109))*:
123
+
124
+ parse and annotate type for bq RANGE_BUCKET (#5793)
125
+
126
+ - due to [`eca65e8`](https://github.com/tobymao/sqlglot/commit/eca65e8b79f65850b014a4cb7913ba4a5861dbe9) - parse and annotate type for bq COSINE/EUCLIDEAN_DISTANCE *(PR [#5792](https://github.com/tobymao/sqlglot/pull/5792) by [@geooo109](https://github.com/geooo109))*:
127
+
128
+ parse and annotate type for bq COSINE/EUCLIDEAN_DISTANCE (#5792)
129
+
130
+ - due to [`a180d3f`](https://github.com/tobymao/sqlglot/commit/a180d3f2f9f3938611027269028c03274aa1889c) - parse and annotate type for bq SAFE math funcs *(PR [#5797](https://github.com/tobymao/sqlglot/pull/5797) by [@geooo109](https://github.com/geooo109))*:
131
+
132
+ parse and annotate type for bq SAFE math funcs (#5797)
133
+
134
+ - due to [`fc7ad7a`](https://github.com/tobymao/sqlglot/commit/fc7ad7a4d953424b56542eacfe1835f5789921c7) - parse ALTER SESSION *(PR [#5734](https://github.com/tobymao/sqlglot/pull/5734) by [@tekumara](https://github.com/tekumara))*:
135
+
136
+ parse ALTER SESSION (#5734)
137
+
138
+ - due to [`8ec1a6c`](https://github.com/tobymao/sqlglot/commit/8ec1a6cf5a8edc2d834c713ce0fd8d87237f11ed) - annotate type for bq STRING_AGG *(PR [#5798](https://github.com/tobymao/sqlglot/pull/5798) by [@geooo109](https://github.com/geooo109))*:
139
+
140
+ annotate type for bq STRING_AGG (#5798)
141
+
142
+ - due to [`dd97bfa`](https://github.com/tobymao/sqlglot/commit/dd97bfa1dc2f86b727c55b06b3c54b18c02e360d) - annotate type for bq DATETIME_TRUNC *(PR [#5799](https://github.com/tobymao/sqlglot/pull/5799) by [@geooo109](https://github.com/geooo109))*:
143
+
144
+ annotate type for bq DATETIME_TRUNC (#5799)
145
+
146
+ - due to [`d3e9dda`](https://github.com/tobymao/sqlglot/commit/d3e9dda183695dd1e4a9832a6671bccc6db561a0) - annotate type for bq GENERATE_UUID *(commit by [@geooo109](https://github.com/geooo109))*:
147
+
148
+ annotate type for bq GENERATE_UUID
149
+
150
+
151
+ ### :sparkles: New Features
152
+ - [`1c551d5`](https://github.com/tobymao/sqlglot/commit/1c551d5ed3315e314013c1f063deabd9d8613e5d) - **optimizer**: parse and annotate type for bq TO_JSON *(PR [#5768](https://github.com/tobymao/sqlglot/pull/5768) by [@geooo109](https://github.com/geooo109))*
153
+ - [`a024d48`](https://github.com/tobymao/sqlglot/commit/a024d48fedd049796329050a1f51822dd1388695) - **singlestore**: Added generation of exp.TsOrDsDiff *(PR [#5769](https://github.com/tobymao/sqlglot/pull/5769) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
154
+ - [`1707f2d`](https://github.com/tobymao/sqlglot/commit/1707f2d7f9d3b58e8c216db638f8e572f9fe6f13) - **optimizer**: annotate type for ABS *(PR [#5770](https://github.com/tobymao/sqlglot/pull/5770) by [@geooo109](https://github.com/geooo109))*
155
+ - [`69acc51`](https://github.com/tobymao/sqlglot/commit/69acc5142b2d4f0b30832c350aa49f16d1adabef) - **optimizer**: annotate type for bq IS_INF, IS_NAN *(PR [#5771](https://github.com/tobymao/sqlglot/pull/5771) by [@geooo109](https://github.com/geooo109))*
156
+ - [`0da2076`](https://github.com/tobymao/sqlglot/commit/0da207652331920416b29e2cc67bdc3c3f964466) - **optimizer**: annotate type for bq CBRT *(PR [#5772](https://github.com/tobymao/sqlglot/pull/5772) by [@geooo109](https://github.com/geooo109))*
157
+ - [`a4968cb`](https://github.com/tobymao/sqlglot/commit/a4968cb5693670c1a2e9cd2c86404dd90fd76160) - **optimizer**: annotate type for bq RAND *(PR [#5774](https://github.com/tobymao/sqlglot/pull/5774) by [@geooo109](https://github.com/geooo109))*
158
+ - [`dd7781a`](https://github.com/tobymao/sqlglot/commit/dd7781a15b842a5826714958ed7af9024903cd1e) - **singlestore**: Fixed generation of exp.Collate *(PR [#5775](https://github.com/tobymao/sqlglot/pull/5775) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
159
+ - [`fb684cb`](https://github.com/tobymao/sqlglot/commit/fb684cbdb6178ddc441f598cc1a6e914291cd00e) - **singelstore**: Fixed generation of exp.RegexpILike *(PR [#5777](https://github.com/tobymao/sqlglot/pull/5777) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
160
+ - [`3e63350`](https://github.com/tobymao/sqlglot/commit/3e63350bd1d58b510cecd1a573d27be3fd2565ce) - **optimizer**: parse and annotate type for bq ACOS *(PR [#5776](https://github.com/tobymao/sqlglot/pull/5776) by [@geooo109](https://github.com/geooo109))*
161
+ - [`8705a78`](https://github.com/tobymao/sqlglot/commit/8705a787df034b4cecb4ba95e9599772c5561ba9) - **singlestore**: Fixed generation of exp.CastToStrType *(PR [#5778](https://github.com/tobymao/sqlglot/pull/5778) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
162
+ - [`e3c35ad`](https://github.com/tobymao/sqlglot/commit/e3c35ade797f46549cc803e1acd8816041713a10) - **singlestore**: Fixed generation of exp.UnicodeString *(PR [#5773](https://github.com/tobymao/sqlglot/pull/5773) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
163
+ - [`2be9d01`](https://github.com/tobymao/sqlglot/commit/2be9d01830c778186dc274c94c6db0dd6c4116d1) - **optimizer**: parse and annotate type for bq ACOSH *(PR [#5779](https://github.com/tobymao/sqlglot/pull/5779) by [@geooo109](https://github.com/geooo109))*
164
+ - [`7da2f31`](https://github.com/tobymao/sqlglot/commit/7da2f31d6613f16585e98c3fa1f592c617ae40c9) - **optimizer**: parse and annotate type for bq ASIN/H *(PR [#5783](https://github.com/tobymao/sqlglot/pull/5783) by [@geooo109](https://github.com/geooo109))*
165
+ - [`341ea83`](https://github.com/tobymao/sqlglot/commit/341ea83a07c707fdbf565b8d9ef4b9b6341ed1d5) - **optimizer**: parse and annotate type for bq ATAN/H/2 *(PR [#5784](https://github.com/tobymao/sqlglot/pull/5784) by [@geooo109](https://github.com/geooo109))*
166
+ - [`be54a45`](https://github.com/tobymao/sqlglot/commit/be54a458413ce3be6c321e5f4feb3e5df5ee6d08) - **singlestore**: Implemented generation of exp.Cbrt *(PR [#5782](https://github.com/tobymao/sqlglot/pull/5782) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
167
+ - [`aa360cb`](https://github.com/tobymao/sqlglot/commit/aa360cb0e204aa056557ff8b15aa2d4f678430e6) - **databricks**: use regexp_like as it exists *(PR [#5781](https://github.com/tobymao/sqlglot/pull/5781) by [@jasonthomassql](https://github.com/jasonthomassql))*
168
+ - [`c2a1ad4`](https://github.com/tobymao/sqlglot/commit/c2a1ad4050771401a5b26bcadd90060e4527fbff) - **optimizer**: parse and annotate type for bq COT/H *(PR [#5786](https://github.com/tobymao/sqlglot/pull/5786) by [@geooo109](https://github.com/geooo109))*
169
+ - [`316ae91`](https://github.com/tobymao/sqlglot/commit/316ae913d8b1a63f3071ebb1b826328108d74cef) - **singlestore**: Added handling of UTC_DATE and exp.CurrentDate *(PR [#5785](https://github.com/tobymao/sqlglot/pull/5785) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
170
+ - [`2c6d237`](https://github.com/tobymao/sqlglot/commit/2c6d23742ea9fcc2b9c784315d3d5364e360fea5) - **optimizer**: parse and annotate type for bq CSC/H *(PR [#5787](https://github.com/tobymao/sqlglot/pull/5787) by [@geooo109](https://github.com/geooo109))*
171
+ - [`8a35076`](https://github.com/tobymao/sqlglot/commit/8a350763c2337f6910a5f0e19af387ba488fcb70) - **optimizer**: parse and annotate type for bq SEC/H *(PR [#5788](https://github.com/tobymao/sqlglot/pull/5788) by [@geooo109](https://github.com/geooo109))*
172
+ - [`566bfb2`](https://github.com/tobymao/sqlglot/commit/566bfb2a64a64b74da63b3a89d68caf702ab6522) - **singlestore**: Added support of UTC_TIME and CURRENT_TIME *(PR [#5789](https://github.com/tobymao/sqlglot/pull/5789) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
173
+ - [`79901cb`](https://github.com/tobymao/sqlglot/commit/79901cb506737ae1932fa44a705858d2597ee587) - **optimizer**: parse and annotate type for bq SIN\H *(PR [#5790](https://github.com/tobymao/sqlglot/pull/5790) by [@geooo109](https://github.com/geooo109))*
174
+ - [`74fb547`](https://github.com/tobymao/sqlglot/commit/74fb5476def1b389da425885db56bd6592fd7f78) - **optimizer**: parse and annotate type for bq RANGE_BUCKET *(PR [#5793](https://github.com/tobymao/sqlglot/pull/5793) by [@geooo109](https://github.com/geooo109))*
175
+ - [`eca65e8`](https://github.com/tobymao/sqlglot/commit/eca65e8b79f65850b014a4cb7913ba4a5861dbe9) - **optimizer**: parse and annotate type for bq COSINE/EUCLIDEAN_DISTANCE *(PR [#5792](https://github.com/tobymao/sqlglot/pull/5792) by [@geooo109](https://github.com/geooo109))*
176
+ - [`a180d3f`](https://github.com/tobymao/sqlglot/commit/a180d3f2f9f3938611027269028c03274aa1889c) - **optimizer**: parse and annotate type for bq SAFE math funcs *(PR [#5797](https://github.com/tobymao/sqlglot/pull/5797) by [@geooo109](https://github.com/geooo109))*
177
+ - [`fc7ad7a`](https://github.com/tobymao/sqlglot/commit/fc7ad7a4d953424b56542eacfe1835f5789921c7) - **snowflake**: parse ALTER SESSION *(PR [#5734](https://github.com/tobymao/sqlglot/pull/5734) by [@tekumara](https://github.com/tekumara))*
178
+ - [`8ec1a6c`](https://github.com/tobymao/sqlglot/commit/8ec1a6cf5a8edc2d834c713ce0fd8d87237f11ed) - **optimizer**: annotate type for bq STRING_AGG *(PR [#5798](https://github.com/tobymao/sqlglot/pull/5798) by [@geooo109](https://github.com/geooo109))*
179
+ - [`dd97bfa`](https://github.com/tobymao/sqlglot/commit/dd97bfa1dc2f86b727c55b06b3c54b18c02e360d) - **optimizer**: annotate type for bq DATETIME_TRUNC *(PR [#5799](https://github.com/tobymao/sqlglot/pull/5799) by [@geooo109](https://github.com/geooo109))*
180
+ - [`d3e9dda`](https://github.com/tobymao/sqlglot/commit/d3e9dda183695dd1e4a9832a6671bccc6db561a0) - **optimizer**: annotate type for bq GENERATE_UUID *(commit by [@geooo109](https://github.com/geooo109))*
181
+
182
+ ### :bug: Bug Fixes
183
+ - [`d8f6a37`](https://github.com/tobymao/sqlglot/commit/d8f6a376ba1fcca48e4a65923dd7a319ce6cfb91) - **optimizer**: allow aliased negative integer literal as group by column *(PR [#5791](https://github.com/tobymao/sqlglot/pull/5791) by [@treysp](https://github.com/treysp))*
184
+ - [`1259576`](https://github.com/tobymao/sqlglot/commit/1259576283f1d45abb70ec40c60e500214a27b6f) - **hive**: DATE_SUB to DATE_ADD use parens if needed *(PR [#5796](https://github.com/tobymao/sqlglot/pull/5796) by [@geooo109](https://github.com/geooo109))*
185
+ - :arrow_lower_right: *fixes issue [#5794](https://github.com/tobymao/sqlglot/issues/5794) opened by [@mingelchan](https://github.com/mingelchan)*
186
+ - [`b0516b4`](https://github.com/tobymao/sqlglot/commit/b0516b4bc9cf2bba2cb57e6bb79ff09b5e2244e3) - **optimizer**: Do not qualify columns if a projection coflicts with a source *(PR [#5780](https://github.com/tobymao/sqlglot/pull/5780) by [@VaggelisD](https://github.com/VaggelisD))*
187
+ - :arrow_lower_right: *fixes issue [#5262](https://github.com/TobikoData/sqlmesh/issues/5262) opened by [@mChlopek](https://github.com/mChlopek)*
188
+ - [`8af0d40`](https://github.com/tobymao/sqlglot/commit/8af0d40055450f71b7e36e576f4a9a1104bc02b2) - **parser**: address edge case where `values` is used as an identifier *(PR [#5801](https://github.com/tobymao/sqlglot/pull/5801) by [@georgesittas](https://github.com/georgesittas))*
189
+
190
+ ### :wrench: Chores
191
+ - [`b77d3da`](https://github.com/tobymao/sqlglot/commit/b77d3da8f2548858d2b9d8590fcde83e1ec62b8a) - remove `"EXCLUDE" -> TokenType.EXCEPT` in DuckDB, Snowflake *(PR [#5766](https://github.com/tobymao/sqlglot/pull/5766) by [@treysp](https://github.com/treysp))*
192
+ - [`005564a`](https://github.com/tobymao/sqlglot/commit/005564ab28cb14be469f09e89b01275d6e25874e) - **snowflake**: refactor logic related to ALTER SESSION *(commit by [@georgesittas](https://github.com/georgesittas))*
193
+
194
+
4
195
  ## [v27.11.0] - 2025-09-03
5
196
  ### :boom: BREAKING CHANGES
6
197
  - due to [`baffd2c`](https://github.com/tobymao/sqlglot/commit/baffd2c0be9657683781f3f8831c47e32dbf68bb) - parse and annotate type for bq REGEXP_INSTR *(PR [#5710](https://github.com/tobymao/sqlglot/pull/5710) by [@geooo109](https://github.com/geooo109))*:
@@ -6970,3 +7161,5 @@ Changelog
6970
7161
  [v27.9.0]: https://github.com/tobymao/sqlglot/compare/v27.8.0...v27.9.0
6971
7162
  [v27.10.0]: https://github.com/tobymao/sqlglot/compare/v27.9.0...v27.10.0
6972
7163
  [v27.11.0]: https://github.com/tobymao/sqlglot/compare/v27.10.0...v27.11.0
7164
+ [v27.12.0]: https://github.com/tobymao/sqlglot/compare/v27.11.0...v27.12.0
7165
+ [v27.13.0]: https://github.com/tobymao/sqlglot/compare/v27.12.0...v27.13.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlglot
3
- Version: 27.12.0
3
+ Version: 27.13.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.12.0'
32
- __version_tuple__ = version_tuple = (27, 12, 0)
31
+ __version__ = version = '27.13.1'
32
+ __version_tuple__ = version_tuple = (27, 13, 1)
33
33
 
34
- __commit_id__ = commit_id = 'g8af0d4005'
34
+ __commit_id__ = commit_id = 'gc00f73bac'
@@ -572,7 +572,6 @@ class BigQuery(Dialect):
572
572
  e, exp.DataType.Type.VARCHAR
573
573
  ),
574
574
  exp.Concat: _annotate_concat,
575
- exp.Contains: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BOOLEAN),
576
575
  exp.Corr: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
577
576
  exp.Cot: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
578
577
  exp.CosineDistance: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
@@ -768,6 +767,10 @@ class BigQuery(Dialect):
768
767
  FUNCTIONS = {
769
768
  **parser.Parser.FUNCTIONS,
770
769
  "APPROX_TOP_COUNT": exp.ApproxTopK.from_arg_list,
770
+ "BIT_AND": exp.BitwiseAndAgg.from_arg_list,
771
+ "BIT_OR": exp.BitwiseOrAgg.from_arg_list,
772
+ "BIT_XOR": exp.BitwiseXorAgg.from_arg_list,
773
+ "BIT_COUNT": exp.BitwiseCountAgg.from_arg_list,
771
774
  "BOOL": exp.JSONBool.from_arg_list,
772
775
  "CONTAINS_SUBSTR": _build_contains_substring,
773
776
  "DATE": _build_date,
@@ -1273,6 +1276,10 @@ class BigQuery(Dialect):
1273
1276
  exp.ArrayContains: _array_contains_sql,
1274
1277
  exp.ArrayFilter: filter_array_using_unnest,
1275
1278
  exp.ArrayRemove: filter_array_using_unnest,
1279
+ exp.BitwiseAndAgg: rename_func("BIT_AND"),
1280
+ exp.BitwiseOrAgg: rename_func("BIT_OR"),
1281
+ exp.BitwiseXorAgg: rename_func("BIT_XOR"),
1282
+ exp.BitwiseCountAgg: rename_func("BIT_COUNT"),
1276
1283
  exp.ByteLength: rename_func("BYTE_LENGTH"),
1277
1284
  exp.Cast: transforms.preprocess([transforms.remove_precision_parameterized_types]),
1278
1285
  exp.CollateProperty: lambda self, e: (
@@ -818,6 +818,7 @@ class Dialect(metaclass=_Dialect):
818
818
  exp.Cast: lambda self, e: self._annotate_with_type(e, e.args["to"]),
819
819
  exp.Case: lambda self, e: self._annotate_by_args(e, "default", "ifs"),
820
820
  exp.Coalesce: lambda self, e: self._annotate_by_args(e, "this", "expressions"),
821
+ exp.Contains: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BOOLEAN),
821
822
  exp.Count: lambda self, e: self._annotate_with_type(
822
823
  e, exp.DataType.Type.BIGINT if e.args.get("big_int") else exp.DataType.Type.INT
823
824
  ),
@@ -2005,6 +2006,12 @@ def groupconcat_sql(
2005
2006
  on_overflow_sql = self.sql(expression, "on_overflow")
2006
2007
  on_overflow_sql = f" ON OVERFLOW {on_overflow_sql}" if (on_overflow and on_overflow_sql) else ""
2007
2008
 
2009
+ if isinstance(this, exp.Limit) and this.this:
2010
+ limit = this
2011
+ this = limit.this.pop()
2012
+ else:
2013
+ limit = None
2014
+
2008
2015
  order = this.find(exp.Order)
2009
2016
 
2010
2017
  if order and order.this:
@@ -2013,11 +2020,16 @@ def groupconcat_sql(
2013
2020
  args = self.format_args(this, f"{separator}{on_overflow_sql}")
2014
2021
  listagg: exp.Expression = exp.Anonymous(this=func_name, expressions=[args])
2015
2022
 
2023
+ modifiers = self.sql(limit)
2024
+
2016
2025
  if order:
2017
2026
  if within_group:
2018
2027
  listagg = exp.WithinGroup(this=listagg, expression=order)
2019
2028
  else:
2020
- listagg.set("expressions", [f"{args}{self.sql(expression=expression.this)}"])
2029
+ modifiers = f"{self.sql(order)}{modifiers}"
2030
+
2031
+ if modifiers:
2032
+ listagg.set("expressions", [f"{args}{modifiers}"])
2021
2033
 
2022
2034
  return self.sql(listagg)
2023
2035
 
@@ -167,6 +167,8 @@ class Dremio(Dialect):
167
167
  FUNCTIONS = {
168
168
  **parser.Parser.FUNCTIONS,
169
169
  "ARRAY_GENERATE_RANGE": exp.GenerateSeries.from_arg_list,
170
+ "BIT_AND": exp.BitwiseAndAgg.from_arg_list,
171
+ "BIT_OR": exp.BitwiseOrAgg.from_arg_list,
170
172
  "DATE_ADD": build_date_delta_with_cast_interval(exp.DateAdd),
171
173
  "DATE_FORMAT": build_formatted_time(exp.TimeToStr, "dremio"),
172
174
  "DATE_SUB": build_date_delta_with_cast_interval(exp.DateSub),
@@ -216,6 +218,8 @@ class Dremio(Dialect):
216
218
 
217
219
  TRANSFORMS = {
218
220
  **generator.Generator.TRANSFORMS,
221
+ exp.BitwiseAndAgg: rename_func("BIT_AND"),
222
+ exp.BitwiseOrAgg: rename_func("BIT_OR"),
219
223
  exp.ToChar: rename_func("TO_CHAR"),
220
224
  exp.TimeToStr: lambda self, e: self.func("TO_CHAR", e.this, self.format_time(e)),
221
225
  exp.DateAdd: _date_delta_sql("DATE_ADD"),
@@ -301,6 +301,10 @@ class MySQL(Dialect):
301
301
 
302
302
  FUNCTIONS = {
303
303
  **parser.Parser.FUNCTIONS,
304
+ "BIT_AND": exp.BitwiseAndAgg.from_arg_list,
305
+ "BIT_OR": exp.BitwiseOrAgg.from_arg_list,
306
+ "BIT_XOR": exp.BitwiseXorAgg.from_arg_list,
307
+ "BIT_COUNT": exp.BitwiseCountAgg.from_arg_list,
304
308
  "CONVERT_TZ": lambda args: exp.ConvertTimezone(
305
309
  source_tz=seq_get(args, 1), target_tz=seq_get(args, 2), timestamp=seq_get(args, 0)
306
310
  ),
@@ -691,7 +695,7 @@ class MySQL(Dialect):
691
695
  class Generator(generator.Generator):
692
696
  INTERVAL_ALLOWS_PLURAL_FORM = False
693
697
  LOCKING_READS_SUPPORTED = True
694
- NULL_ORDERING_SUPPORTED = None
698
+ NULL_ORDERING_SUPPORTED: t.Optional[bool] = None
695
699
  JOIN_HINTS = False
696
700
  TABLE_HINTS = True
697
701
  DUPLICATE_KEY_UPDATE_WITH_SET = False
@@ -712,6 +716,10 @@ class MySQL(Dialect):
712
716
  TRANSFORMS = {
713
717
  **generator.Generator.TRANSFORMS,
714
718
  exp.ArrayAgg: rename_func("GROUP_CONCAT"),
719
+ exp.BitwiseAndAgg: rename_func("BIT_AND"),
720
+ exp.BitwiseOrAgg: rename_func("BIT_OR"),
721
+ exp.BitwiseXorAgg: rename_func("BIT_XOR"),
722
+ exp.BitwiseCountAgg: rename_func("BIT_COUNT"),
715
723
  exp.CurrentDate: no_paren_current_date_sql,
716
724
  exp.DateDiff: _remove_ts_or_ds_to_date(
717
725
  lambda self, e: self.func("DATEDIFF", e.this, e.expression), ("this", "expression")
@@ -779,6 +787,8 @@ class MySQL(Dialect):
779
787
  exp.Week: _remove_ts_or_ds_to_date(),
780
788
  exp.WeekOfYear: _remove_ts_or_ds_to_date(rename_func("WEEKOFYEAR")),
781
789
  exp.Year: _remove_ts_or_ds_to_date(),
790
+ exp.UtcTimestamp: rename_func("UTC_TIMESTAMP"),
791
+ exp.UtcTime: rename_func("UTC_TIME"),
782
792
  }
783
793
 
784
794
  UNSIGNED_TYPE_MAPPING = {
@@ -338,6 +338,8 @@ class Oracle(Dialect):
338
338
  exp.Unicode: lambda self, e: f"ASCII(UNISTR({self.sql(e.this)}))",
339
339
  exp.UnixToTime: lambda self,
340
340
  e: f"TO_DATE('1970-01-01', 'YYYY-MM-DD') + ({self.sql(e, 'this')} / 86400)",
341
+ exp.UtcTimestamp: rename_func("UTC_TIMESTAMP"),
342
+ exp.UtcTime: rename_func("UTC_TIME"),
341
343
  }
342
344
 
343
345
  PROPERTIES_LOCATION = {
@@ -327,8 +327,7 @@ class Postgres(Dialect):
327
327
  "<@": TokenType.LT_AT,
328
328
  "|/": TokenType.PIPE_SLASH,
329
329
  "||/": TokenType.DPIPE_SLASH,
330
- "BEGIN": TokenType.COMMAND,
331
- "BEGIN TRANSACTION": TokenType.BEGIN,
330
+ "BEGIN": TokenType.BEGIN,
332
331
  "BIGSERIAL": TokenType.BIGSERIAL,
333
332
  "CONSTRAINT TRIGGER": TokenType.COMMAND,
334
333
  "CSTRING": TokenType.PSEUDO_TYPE,
@@ -22,11 +22,13 @@ from sqlglot.generator import unsupported_args
22
22
  from sqlglot.helper import seq_get
23
23
 
24
24
 
25
- def cast_to_time6(expression: t.Optional[exp.Expression]) -> exp.Cast:
25
+ def cast_to_time6(
26
+ expression: t.Optional[exp.Expression], time_type: DataType.Type = exp.DataType.Type.TIME
27
+ ) -> exp.Cast:
26
28
  return exp.Cast(
27
29
  this=expression,
28
30
  to=exp.DataType.build(
29
- exp.DataType.Type.TIME,
31
+ time_type,
30
32
  expressions=[exp.DataTypeParam(this=exp.Literal.number(6))],
31
33
  ),
32
34
  )
@@ -63,6 +65,7 @@ class SingleStore(MySQL):
63
65
  "TIMESTAMP": TokenType.TIMESTAMP,
64
66
  "UTC_DATE": TokenType.UTC_DATE,
65
67
  "UTC_TIME": TokenType.UTC_TIME,
68
+ "UTC_TIMESTAMP": TokenType.UTC_TIMESTAMP,
66
69
  ":>": TokenType.COLON_GT,
67
70
  "!:>": TokenType.NCOLON_GT,
68
71
  "::$": TokenType.DCOLONDOLLAR,
@@ -162,6 +165,8 @@ class SingleStore(MySQL):
162
165
  json_type="JSON",
163
166
  ),
164
167
  "JSON_PRETTY": exp.JSONFormat.from_arg_list,
168
+ "JSON_BUILD_ARRAY": lambda args: exp.JSONArray(expressions=args),
169
+ "JSON_BUILD_OBJECT": lambda args: exp.JSONObject(expressions=args),
165
170
  "DATE": exp.Date.from_arg_list,
166
171
  "DAYNAME": lambda args: exp.TimeToStr(
167
172
  this=seq_get(args, 0),
@@ -199,10 +204,19 @@ class SingleStore(MySQL):
199
204
  ),
200
205
  }
201
206
 
207
+ FUNCTION_PARSERS: t.Dict[str, t.Callable] = {
208
+ **MySQL.Parser.FUNCTION_PARSERS,
209
+ "JSON_AGG": lambda self: exp.JSONArrayAgg(
210
+ this=self._parse_term(),
211
+ order=self._parse_order(),
212
+ ),
213
+ }
214
+
202
215
  NO_PAREN_FUNCTIONS = {
203
216
  **MySQL.Parser.NO_PAREN_FUNCTIONS,
204
217
  TokenType.UTC_DATE: exp.UtcDate,
205
218
  TokenType.UTC_TIME: exp.UtcTime,
219
+ TokenType.UTC_TIMESTAMP: exp.UtcTimestamp,
206
220
  }
207
221
 
208
222
  CAST_COLUMN_OPERATORS = {TokenType.COLON_GT, TokenType.NCOLON_GT}
@@ -237,6 +251,8 @@ class SingleStore(MySQL):
237
251
 
238
252
  class Generator(MySQL.Generator):
239
253
  SUPPORTS_UESCAPE = False
254
+ NULL_ORDERING_SUPPORTED = True
255
+ MATCH_AGAINST_TABLE_PREFIX = "TABLE "
240
256
 
241
257
  @staticmethod
242
258
  def _unicode_substitute(m: re.Match[str]) -> str:
@@ -339,6 +355,11 @@ class SingleStore(MySQL):
339
355
  if e.unit is not None
340
356
  else self.func("DATEDIFF", e.this, e.expression),
341
357
  exp.TimestampTrunc: unsupported_args("zone")(timestamptrunc_sql()),
358
+ exp.CurrentDatetime: lambda self, e: self.sql(
359
+ cast_to_time6(
360
+ exp.CurrentTimestamp(this=exp.Literal.number(6)), exp.DataType.Type.DATETIME
361
+ )
362
+ ),
342
363
  exp.JSONExtract: unsupported_args(
343
364
  "only_json_types",
344
365
  "expressions",
@@ -354,6 +375,21 @@ class SingleStore(MySQL):
354
375
  exp.JSONPathSubscript: lambda self, e: self.json_path_part(e.this),
355
376
  exp.JSONPathRoot: lambda *_: "",
356
377
  exp.JSONFormat: unsupported_args("options", "is_json")(rename_func("JSON_PRETTY")),
378
+ exp.JSONArrayAgg: unsupported_args("null_handling", "return_type", "strict")(
379
+ lambda self, e: self.func("JSON_AGG", e.this, suffix=f"{self.sql(e, 'order')})")
380
+ ),
381
+ exp.JSONArray: unsupported_args("null_handling", "return_type", "strict")(
382
+ rename_func("JSON_BUILD_ARRAY")
383
+ ),
384
+ exp.JSONBExists: lambda self, e: self.func(
385
+ "BSON_MATCH_ANY_EXISTS", e.this, e.args.get("path")
386
+ ),
387
+ exp.JSONExists: unsupported_args("passing", "on_condition")(
388
+ lambda self, e: self.func("JSON_MATCH_ANY_EXISTS", e.this, e.args.get("path"))
389
+ ),
390
+ exp.JSONObject: unsupported_args(
391
+ "null_handling", "unique_keys", "return_type", "encoding"
392
+ )(rename_func("JSON_BUILD_OBJECT")),
357
393
  exp.DayOfWeekIso: lambda self, e: f"(({self.func('DAYOFWEEK', e.this)} % 7) + 1)",
358
394
  exp.DayOfMonth: rename_func("DAY"),
359
395
  exp.Hll: rename_func("APPROX_COUNT_DISTINCT"),
@@ -417,11 +453,20 @@ class SingleStore(MySQL):
417
453
  ),
418
454
  "RLIKE",
419
455
  ),
456
+ exp.Stuff: lambda self, e: self.func(
457
+ "CONCAT",
458
+ self.func("SUBSTRING", e.this, exp.Literal.number(1), e.args.get("start") - 1),
459
+ e.expression,
460
+ self.func("SUBSTRING", e.this, e.args.get("start") + e.args.get("length")),
461
+ ),
420
462
  exp.Reduce: unsupported_args("finish")(
421
463
  lambda self, e: self.func(
422
464
  "REDUCE", e.args.get("initial"), e.this, e.args.get("merge")
423
465
  )
424
466
  ),
467
+ exp.MatchAgainst: unsupported_args("modifier")(
468
+ lambda self, e: super().matchagainst_sql(e)
469
+ ),
425
470
  }
426
471
  TRANSFORMS.pop(exp.JSONExtractScalar)
427
472
  TRANSFORMS.pop(exp.CurrentDate)
@@ -1667,3 +1712,32 @@ class SingleStore(MySQL):
1667
1712
  self.unsupported("CurrentTime with timezone is not supported in SingleStore")
1668
1713
 
1669
1714
  return self.func("CURRENT_TIME")
1715
+
1716
+ def currenttimestamp_sql(self, expression: exp.CurrentTimestamp) -> str:
1717
+ arg = expression.this
1718
+ if arg:
1719
+ if isinstance(arg, exp.Literal) and arg.name.lower() == "utc":
1720
+ return self.func("UTC_TIMESTAMP")
1721
+ if isinstance(arg, exp.Literal) and arg.is_number:
1722
+ return self.func("CURRENT_TIMESTAMP", arg)
1723
+ self.unsupported("CurrentTimestamp with timezone is not supported in SingleStore")
1724
+
1725
+ return self.func("CURRENT_TIMESTAMP")
1726
+
1727
+ def standardhash_sql(self, expression: exp.StandardHash) -> str:
1728
+ hash_function = expression.expression
1729
+ if hash_function is None:
1730
+ return self.func("SHA", expression.this)
1731
+ if isinstance(hash_function, exp.Literal):
1732
+ if hash_function.name.lower() == "sha":
1733
+ return self.func("SHA", expression.this)
1734
+ if hash_function.name.lower() == "md5":
1735
+ return self.func("MD5", expression.this)
1736
+
1737
+ self.unsupported(
1738
+ f"{hash_function.this} hash method is not supported in SingleStore"
1739
+ )
1740
+ return self.func("SHA", expression.this)
1741
+
1742
+ self.unsupported("STANDARD_HASH function is not supported in SingleStore")
1743
+ return self.func("SHA", expression.this)
@@ -496,6 +496,15 @@ class Snowflake(Dialect):
496
496
  ALTER_TABLE_ADD_REQUIRED_FOR_EACH_COLUMN = False
497
497
  TRY_CAST_REQUIRES_STRING = True
498
498
 
499
+ ANNOTATORS = {
500
+ **Dialect.ANNOTATORS,
501
+ **{
502
+ expr_type: lambda self, e: self._annotate_by_args(e, "this")
503
+ for expr_type in (exp.Reverse,)
504
+ },
505
+ exp.ConcatWs: lambda self, e: self._annotate_by_args(e, "expressions"),
506
+ }
507
+
499
508
  TIME_MAPPING = {
500
509
  "YYYY": "%Y",
501
510
  "yyyy": "%Y",
@@ -574,6 +583,7 @@ class Snowflake(Dialect):
574
583
  end=exp.Sub(this=seq_get(args, 1), expression=exp.Literal.number(1)),
575
584
  step=seq_get(args, 2),
576
585
  ),
586
+ "ARRAY_SORT": exp.SortArray.from_arg_list,
577
587
  "BITXOR": _build_bitwise(exp.BitwiseXor, "BITXOR"),
578
588
  "BIT_XOR": _build_bitwise(exp.BitwiseXor, "BITXOR"),
579
589
  "BITOR": _build_bitwise(exp.BitwiseOr, "BITOR"),
@@ -582,6 +592,18 @@ class Snowflake(Dialect):
582
592
  "BIT_SHIFTLEFT": _build_bitwise(exp.BitwiseLeftShift, "BIT_SHIFTLEFT"),
583
593
  "BITSHIFTRIGHT": _build_bitwise(exp.BitwiseRightShift, "BITSHIFTRIGHT"),
584
594
  "BIT_SHIFTRIGHT": _build_bitwise(exp.BitwiseRightShift, "BIT_SHIFTRIGHT"),
595
+ "BITANDAGG": exp.BitwiseAndAgg.from_arg_list,
596
+ "BITAND_AGG": exp.BitwiseAndAgg.from_arg_list,
597
+ "BIT_AND_AGG": exp.BitwiseAndAgg.from_arg_list,
598
+ "BIT_ANDAGG": exp.BitwiseAndAgg.from_arg_list,
599
+ "BITORAGG": exp.BitwiseOrAgg.from_arg_list,
600
+ "BITOR_AGG": exp.BitwiseOrAgg.from_arg_list,
601
+ "BIT_OR_AGG": exp.BitwiseOrAgg.from_arg_list,
602
+ "BIT_ORAGG": exp.BitwiseOrAgg.from_arg_list,
603
+ "BITXORAGG": exp.BitwiseXorAgg.from_arg_list,
604
+ "BITXOR_AGG": exp.BitwiseXorAgg.from_arg_list,
605
+ "BIT_XOR_AGG": exp.BitwiseXorAgg.from_arg_list,
606
+ "BIT_XORAGG": exp.BitwiseXorAgg.from_arg_list,
585
607
  "BOOLXOR": _build_bitwise(exp.Xor, "BOOLXOR"),
586
608
  "DATE": _build_datetime("DATE", exp.DataType.Type.DATE),
587
609
  "DATE_TRUNC": _date_trunc_to_time,
@@ -1200,6 +1222,10 @@ class Snowflake(Dialect):
1200
1222
  ),
1201
1223
  exp.BitwiseOr: rename_func("BITOR"),
1202
1224
  exp.BitwiseXor: rename_func("BITXOR"),
1225
+ exp.BitwiseAnd: rename_func("BITAND"),
1226
+ exp.BitwiseAndAgg: rename_func("BITANDAGG"),
1227
+ exp.BitwiseOrAgg: rename_func("BITORAGG"),
1228
+ exp.BitwiseXorAgg: rename_func("BITXORAGG"),
1203
1229
  exp.BitwiseLeftShift: rename_func("BITSHIFTLEFT"),
1204
1230
  exp.BitwiseRightShift: rename_func("BITSHIFTRIGHT"),
1205
1231
  exp.Create: transforms.preprocess([_flatten_structured_types_unless_iceberg]),
@@ -1272,6 +1298,7 @@ class Snowflake(Dialect):
1272
1298
  ]
1273
1299
  ),
1274
1300
  exp.SHA: rename_func("SHA1"),
1301
+ exp.SortArray: rename_func("ARRAY_SORT"),
1275
1302
  exp.StarMap: rename_func("OBJECT_CONSTRUCT"),
1276
1303
  exp.StartsWith: rename_func("STARTSWITH"),
1277
1304
  exp.EndsWith: rename_func("ENDSWITH"),
@@ -125,6 +125,10 @@ class Spark(Spark2):
125
125
  FUNCTIONS = {
126
126
  **Spark2.Parser.FUNCTIONS,
127
127
  "ANY_VALUE": _build_with_ignore_nulls(exp.AnyValue),
128
+ "BIT_AND": exp.BitwiseAndAgg.from_arg_list,
129
+ "BIT_OR": exp.BitwiseOrAgg.from_arg_list,
130
+ "BIT_XOR": exp.BitwiseXorAgg.from_arg_list,
131
+ "BIT_COUNT": exp.BitwiseCountAgg.from_arg_list,
128
132
  "DATE_ADD": _build_dateadd,
129
133
  "DATEADD": _build_dateadd,
130
134
  "TIMESTAMPADD": _build_dateadd,
@@ -189,6 +193,10 @@ class Spark(Spark2):
189
193
  exp.ArrayConstructCompact: lambda self, e: self.func(
190
194
  "ARRAY_COMPACT", self.func("ARRAY", *e.expressions)
191
195
  ),
196
+ exp.BitwiseAndAgg: rename_func("BIT_AND"),
197
+ exp.BitwiseOrAgg: rename_func("BIT_OR"),
198
+ exp.BitwiseXorAgg: rename_func("BIT_XOR"),
199
+ exp.BitwiseCountAgg: rename_func("BIT_COUNT"),
192
200
  exp.Create: preprocess(
193
201
  [
194
202
  remove_unique_constraints,