sqlglot 27.16.3__tar.gz → 27.18.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. {sqlglot-27.16.3 → sqlglot-27.18.0}/CHANGELOG.md +90 -0
  2. {sqlglot-27.16.3 → sqlglot-27.18.0}/PKG-INFO +3 -2
  3. {sqlglot-27.16.3 → sqlglot-27.18.0}/README.md +2 -1
  4. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/_version.py +3 -3
  5. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/__init__.py +1 -0
  6. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/clickhouse.py +2 -3
  7. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/dialect.py +9 -0
  8. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/duckdb.py +6 -0
  9. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/mysql.py +15 -0
  10. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/postgres.py +3 -1
  11. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/snowflake.py +54 -7
  12. sqlglot-27.18.0/sqlglot/dialects/solr.py +22 -0
  13. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/expressions.py +64 -0
  14. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/generator.py +31 -7
  15. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/optimizer/simplify.py +1 -1
  16. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/parser.py +71 -21
  17. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot.egg-info/PKG-INFO +3 -2
  18. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot.egg-info/SOURCES.txt +2 -0
  19. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_bigquery.py +4 -0
  20. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_clickhouse.py +1 -0
  21. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_mysql.py +17 -0
  22. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_postgres.py +26 -0
  23. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_presto.py +7 -0
  24. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_snowflake.py +57 -11
  25. sqlglot-27.18.0/tests/dialects/test_solr.py +12 -0
  26. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_trino.py +8 -0
  27. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_tsql.py +1 -0
  28. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/identity.sql +4 -0
  29. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/annotate_functions.sql +152 -0
  30. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/test_optimizer.py +10 -0
  31. {sqlglot-27.16.3 → sqlglot-27.18.0}/.gitignore +0 -0
  32. {sqlglot-27.16.3 → sqlglot-27.18.0}/.gitpod.yml +0 -0
  33. {sqlglot-27.16.3 → sqlglot-27.18.0}/.pre-commit-config.yaml +0 -0
  34. {sqlglot-27.16.3 → sqlglot-27.18.0}/CONTRIBUTING.md +0 -0
  35. {sqlglot-27.16.3 → sqlglot-27.18.0}/LICENSE +0 -0
  36. {sqlglot-27.16.3 → sqlglot-27.18.0}/MANIFEST.in +0 -0
  37. {sqlglot-27.16.3 → sqlglot-27.18.0}/Makefile +0 -0
  38. {sqlglot-27.16.3 → sqlglot-27.18.0}/pyproject.toml +0 -0
  39. {sqlglot-27.16.3 → sqlglot-27.18.0}/setup.cfg +0 -0
  40. {sqlglot-27.16.3 → sqlglot-27.18.0}/setup.py +0 -0
  41. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/__init__.py +0 -0
  42. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/__main__.py +0 -0
  43. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/_typing.py +0 -0
  44. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/athena.py +0 -0
  45. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/bigquery.py +0 -0
  46. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/databricks.py +0 -0
  47. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/doris.py +0 -0
  48. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/dremio.py +0 -0
  49. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/drill.py +0 -0
  50. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/druid.py +0 -0
  51. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/dune.py +0 -0
  52. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/exasol.py +0 -0
  53. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/fabric.py +0 -0
  54. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/hive.py +0 -0
  55. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/materialize.py +0 -0
  56. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/oracle.py +0 -0
  57. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/presto.py +0 -0
  58. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/prql.py +0 -0
  59. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/redshift.py +0 -0
  60. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/risingwave.py +0 -0
  61. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/singlestore.py +0 -0
  62. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/spark.py +0 -0
  63. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/spark2.py +0 -0
  64. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/sqlite.py +0 -0
  65. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/starrocks.py +0 -0
  66. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/tableau.py +0 -0
  67. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/teradata.py +0 -0
  68. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/trino.py +0 -0
  69. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/dialects/tsql.py +0 -0
  70. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/diff.py +0 -0
  71. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/errors.py +0 -0
  72. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/executor/__init__.py +0 -0
  73. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/executor/context.py +0 -0
  74. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/executor/env.py +0 -0
  75. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/executor/python.py +0 -0
  76. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/executor/table.py +0 -0
  77. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/helper.py +0 -0
  78. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/jsonpath.py +0 -0
  79. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/lineage.py +0 -0
  80. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/optimizer/__init__.py +0 -0
  81. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/optimizer/annotate_types.py +0 -0
  82. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/optimizer/canonicalize.py +0 -0
  83. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
  84. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/optimizer/eliminate_joins.py +0 -0
  85. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
  86. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
  87. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/optimizer/merge_subqueries.py +0 -0
  88. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/optimizer/normalize.py +0 -0
  89. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
  90. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/optimizer/optimize_joins.py +0 -0
  91. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/optimizer/optimizer.py +0 -0
  92. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/optimizer/pushdown_predicates.py +0 -0
  93. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/optimizer/pushdown_projections.py +0 -0
  94. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/optimizer/qualify.py +0 -0
  95. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/optimizer/qualify_columns.py +0 -0
  96. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/optimizer/qualify_tables.py +0 -0
  97. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/optimizer/scope.py +0 -0
  98. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/optimizer/unnest_subqueries.py +0 -0
  99. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/planner.py +0 -0
  100. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/py.typed +0 -0
  101. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/schema.py +0 -0
  102. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/serde.py +0 -0
  103. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/time.py +0 -0
  104. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/tokens.py +0 -0
  105. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/transforms.py +0 -0
  106. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot/trie.py +0 -0
  107. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot.egg-info/dependency_links.txt +0 -0
  108. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot.egg-info/requires.txt +0 -0
  109. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot.egg-info/top_level.txt +0 -0
  110. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglot.png +0 -0
  111. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglotrs/Cargo.lock +0 -0
  112. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglotrs/Cargo.toml +0 -0
  113. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglotrs/benches/dialect_settings.json +0 -0
  114. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglotrs/benches/long.rs +0 -0
  115. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglotrs/benches/token_type_settings.json +0 -0
  116. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglotrs/benches/tokenizer_dialect_settings.json +0 -0
  117. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglotrs/benches/tokenizer_settings.json +0 -0
  118. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglotrs/pyproject.toml +0 -0
  119. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglotrs/src/lib.rs +0 -0
  120. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglotrs/src/settings.rs +0 -0
  121. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglotrs/src/token.rs +0 -0
  122. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglotrs/src/tokenizer.rs +0 -0
  123. {sqlglot-27.16.3 → sqlglot-27.18.0}/sqlglotrs/src/trie.rs +0 -0
  124. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/__init__.py +0 -0
  125. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/__init__.py +0 -0
  126. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_athena.py +0 -0
  127. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_databricks.py +0 -0
  128. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_dialect.py +0 -0
  129. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_doris.py +0 -0
  130. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_dremio.py +0 -0
  131. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_drill.py +0 -0
  132. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_druid.py +0 -0
  133. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_duckdb.py +0 -0
  134. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_dune.py +0 -0
  135. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_exasol.py +0 -0
  136. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_fabric.py +0 -0
  137. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_hive.py +0 -0
  138. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_materialize.py +0 -0
  139. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_oracle.py +0 -0
  140. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_pipe_syntax.py +0 -0
  141. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_prql.py +0 -0
  142. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_redshift.py +0 -0
  143. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_risingwave.py +0 -0
  144. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_singlestore.py +0 -0
  145. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_spark.py +0 -0
  146. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_sqlite.py +0 -0
  147. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_starrocks.py +0 -0
  148. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_tableau.py +0 -0
  149. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/dialects/test_teradata.py +0 -0
  150. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/jsonpath/LICENSE +0 -0
  151. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/jsonpath/cts.json +0 -0
  152. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/annotate_types.sql +0 -0
  153. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/canonicalize.sql +0 -0
  154. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
  155. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/eliminate_joins.sql +0 -0
  156. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
  157. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
  158. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
  159. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/normalize.sql +0 -0
  160. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
  161. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
  162. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/optimizer.sql +0 -0
  163. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
  164. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
  165. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/pushdown_projections.sql +0 -0
  166. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/qualify_columns.sql +0 -0
  167. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
  168. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
  169. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
  170. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
  171. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
  172. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/simplify.sql +0 -0
  173. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
  174. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
  175. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
  176. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
  177. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
  178. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
  179. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
  180. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
  181. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
  182. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
  183. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
  184. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
  185. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
  186. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
  187. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
  188. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
  189. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
  190. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
  191. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
  192. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
  193. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
  194. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
  195. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
  196. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
  197. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
  198. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
  199. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
  200. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
  201. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
  202. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
  203. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
  204. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
  205. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
  206. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
  207. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/optimizer/unnest_subqueries.sql +0 -0
  208. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/partial.sql +0 -0
  209. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/fixtures/pretty.sql +0 -0
  210. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/gen_fixtures.py +0 -0
  211. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/helpers.py +0 -0
  212. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/test_build.py +0 -0
  213. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/test_dialect_imports.py +0 -0
  214. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/test_diff.py +0 -0
  215. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/test_docs.py +0 -0
  216. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/test_executor.py +0 -0
  217. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/test_expressions.py +0 -0
  218. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/test_generator.py +0 -0
  219. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/test_helper.py +0 -0
  220. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/test_jsonpath.py +0 -0
  221. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/test_lineage.py +0 -0
  222. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/test_parser.py +0 -0
  223. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/test_schema.py +0 -0
  224. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/test_serde.py +0 -0
  225. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/test_time.py +0 -0
  226. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/test_tokens.py +0 -0
  227. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/test_transforms.py +0 -0
  228. {sqlglot-27.16.3 → sqlglot-27.18.0}/tests/test_transpile.py +0 -0
@@ -1,6 +1,94 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## [v27.17.0] - 2025-09-23
5
+ ### :boom: BREAKING CHANGES
6
+ - due to [`f4ad258`](https://github.com/tobymao/sqlglot/commit/f4ad25882951de4e4442dfd5189a56d5a1c5e630) - Annotate types for Snowflake BASE64_DECODE_BINARY function *(PR [#5917](https://github.com/tobymao/sqlglot/pull/5917) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
7
+
8
+ Annotate types for Snowflake BASE64_DECODE_BINARY function (#5917)
9
+
10
+ - due to [`6d0e3f8`](https://github.com/tobymao/sqlglot/commit/6d0e3f8dcae7ed1a7659ece69b1f94cec5e7300e) - Add parser support to ilike like function versions. *(PR [#5915](https://github.com/tobymao/sqlglot/pull/5915) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
11
+
12
+ Add parser support to ilike like function versions. (#5915)
13
+
14
+ - due to [`22c7ed7`](https://github.com/tobymao/sqlglot/commit/22c7ed7734b41ca544bb67bcc1ca4151f6d5f05f) - parse tuple *(PR [#5920](https://github.com/tobymao/sqlglot/pull/5920) by [@geooo109](https://github.com/geooo109))*:
15
+
16
+ parse tuple (#5920)
17
+
18
+ - due to [`fc5624e`](https://github.com/tobymao/sqlglot/commit/fc5624eca43d2855ac350c92d85b184a6893d5ca) - annotate types for Snowflake ASCII function *(PR [#5926](https://github.com/tobymao/sqlglot/pull/5926) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*:
19
+
20
+ annotate types for Snowflake ASCII function (#5926)
21
+
22
+ - due to [`4e81690`](https://github.com/tobymao/sqlglot/commit/4e8169045edcaa28ae43abeb07370df63846fbfd) - annotate type for Snowflake COLLATE function *(PR [#5931](https://github.com/tobymao/sqlglot/pull/5931) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*:
23
+
24
+ annotate type for Snowflake COLLATE function (#5931)
25
+
26
+ - due to [`f07d35d`](https://github.com/tobymao/sqlglot/commit/f07d35d29104c6203efaab738118d1903614b83c) - annotate type for Snowflake CHR function *(PR [#5929](https://github.com/tobymao/sqlglot/pull/5929) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*:
27
+
28
+ annotate type for Snowflake CHR function (#5929)
29
+
30
+ - due to [`f8c0ee4`](https://github.com/tobymao/sqlglot/commit/f8c0ee4d3c1a4d4a92b897d1cc85f9904c8e566b) - Add function and annotate snowflake hex decode string and binary functions *(PR [#5928](https://github.com/tobymao/sqlglot/pull/5928) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
31
+
32
+ Add function and annotate snowflake hex decode string and binary functions (#5928)
33
+
34
+ - due to [`66f9501`](https://github.com/tobymao/sqlglot/commit/66f9501d76d087798bad93e578273ab2a45e2575) - annotate types for Snowflake BIT_LENGTH function *(PR [#5927](https://github.com/tobymao/sqlglot/pull/5927) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*:
35
+
36
+ annotate types for Snowflake BIT_LENGTH function (#5927)
37
+
38
+ - due to [`7878437`](https://github.com/tobymao/sqlglot/commit/78784370712df65a2e1e79a1c2b441131ed7222a) - annotate snowflake's `BASE64_DECODE_STRING`, `BASE64_ENCODE` *(PR [#5922](https://github.com/tobymao/sqlglot/pull/5922) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
39
+
40
+ annotate snowflake's `BASE64_DECODE_STRING`, `BASE64_ENCODE` (#5922)
41
+
42
+ - due to [`9bcad04`](https://github.com/tobymao/sqlglot/commit/9bcad040bd51dd03821c68eea1a73534fc7a81b7) - Annotate type for HEX ENCODE function. *(PR [#5936](https://github.com/tobymao/sqlglot/pull/5936) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
43
+
44
+ Annotate type for HEX ENCODE function. (#5936)
45
+
46
+ - due to [`590928f`](https://github.com/tobymao/sqlglot/commit/590928f4637306e8cf3f1302d5dd5d5dbc76e7e0) - annotate type for Snowflake INITCAP function *(PR [#5941](https://github.com/tobymao/sqlglot/pull/5941) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*:
47
+
48
+ annotate type for Snowflake INITCAP function (#5941)
49
+
50
+ - due to [`ac04de1`](https://github.com/tobymao/sqlglot/commit/ac04de1944c7a976406581b489b3cf9b11dafb77) - annotate type for Snowflake EDITDISTANCE function *(PR [#5940](https://github.com/tobymao/sqlglot/pull/5940) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*:
51
+
52
+ annotate type for Snowflake EDITDISTANCE function (#5940)
53
+
54
+ - due to [`9e28af8`](https://github.com/tobymao/sqlglot/commit/9e28af8a52ced951ecf7f4e85a6305e20a13de1f) - Annotate type for snowflake COMPRESS function *(PR [#5938](https://github.com/tobymao/sqlglot/pull/5938) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
55
+
56
+ Annotate type for snowflake COMPRESS function (#5938)
57
+
58
+
59
+ ### :sparkles: New Features
60
+ - [`f4ad258`](https://github.com/tobymao/sqlglot/commit/f4ad25882951de4e4442dfd5189a56d5a1c5e630) - **optimizer**: Annotate types for Snowflake BASE64_DECODE_BINARY function *(PR [#5917](https://github.com/tobymao/sqlglot/pull/5917) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
61
+ - [`6d0e3f8`](https://github.com/tobymao/sqlglot/commit/6d0e3f8dcae7ed1a7659ece69b1f94cec5e7300e) - **optimizer**: Add parser support to ilike like function versions. *(PR [#5915](https://github.com/tobymao/sqlglot/pull/5915) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
62
+ - [`fc5624e`](https://github.com/tobymao/sqlglot/commit/fc5624eca43d2855ac350c92d85b184a6893d5ca) - **optimizer**: annotate types for Snowflake ASCII function *(PR [#5926](https://github.com/tobymao/sqlglot/pull/5926) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
63
+ - [`4e81690`](https://github.com/tobymao/sqlglot/commit/4e8169045edcaa28ae43abeb07370df63846fbfd) - **optimizer**: annotate type for Snowflake COLLATE function *(PR [#5931](https://github.com/tobymao/sqlglot/pull/5931) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
64
+ - [`f07d35d`](https://github.com/tobymao/sqlglot/commit/f07d35d29104c6203efaab738118d1903614b83c) - **optimizer**: annotate type for Snowflake CHR function *(PR [#5929](https://github.com/tobymao/sqlglot/pull/5929) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
65
+ - [`f8c0ee4`](https://github.com/tobymao/sqlglot/commit/f8c0ee4d3c1a4d4a92b897d1cc85f9904c8e566b) - **optimizer**: Add function and annotate snowflake hex decode string and binary functions *(PR [#5928](https://github.com/tobymao/sqlglot/pull/5928) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
66
+ - [`66f9501`](https://github.com/tobymao/sqlglot/commit/66f9501d76d087798bad93e578273ab2a45e2575) - **optimizer**: annotate types for Snowflake BIT_LENGTH function *(PR [#5927](https://github.com/tobymao/sqlglot/pull/5927) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
67
+ - [`f4c810e`](https://github.com/tobymao/sqlglot/commit/f4c810e043d9379e94efb185e368e27ad9c15715) - transpile Trino `FORMAT` to DuckDB and Snowflake, closes [#5933](https://github.com/tobymao/sqlglot/pull/5933) *(commit by [@georgesittas](https://github.com/georgesittas))*
68
+ - [`7878437`](https://github.com/tobymao/sqlglot/commit/78784370712df65a2e1e79a1c2b441131ed7222a) - **optimizer**: annotate snowflake's `BASE64_DECODE_STRING`, `BASE64_ENCODE` *(PR [#5922](https://github.com/tobymao/sqlglot/pull/5922) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
69
+ - [`9bcad04`](https://github.com/tobymao/sqlglot/commit/9bcad040bd51dd03821c68eea1a73534fc7a81b7) - **optimizer**: Annotate type for HEX ENCODE function. *(PR [#5936](https://github.com/tobymao/sqlglot/pull/5936) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
70
+ - [`590928f`](https://github.com/tobymao/sqlglot/commit/590928f4637306e8cf3f1302d5dd5d5dbc76e7e0) - **optimizer**: annotate type for Snowflake INITCAP function *(PR [#5941](https://github.com/tobymao/sqlglot/pull/5941) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
71
+ - [`ac04de1`](https://github.com/tobymao/sqlglot/commit/ac04de1944c7a976406581b489b3cf9b11dafb77) - **optimizer**: annotate type for Snowflake EDITDISTANCE function *(PR [#5940](https://github.com/tobymao/sqlglot/pull/5940) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
72
+ - [`a385990`](https://github.com/tobymao/sqlglot/commit/a38599080932a8b54a169df8b7a69650cb47b6bc) - **parser**: support wrapped aggregate functions *(PR [#5943](https://github.com/tobymao/sqlglot/pull/5943) by [@geooo109](https://github.com/geooo109))*
73
+ - [`9e28af8`](https://github.com/tobymao/sqlglot/commit/9e28af8a52ced951ecf7f4e85a6305e20a13de1f) - **optimizer**: Annotate type for snowflake COMPRESS function *(PR [#5938](https://github.com/tobymao/sqlglot/pull/5938) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
74
+
75
+ ### :bug: Bug Fixes
76
+ - [`6807a32`](https://github.com/tobymao/sqlglot/commit/6807a32cccf984dc13a30b815750b2c41374b845) - escape byte string delimiters *(PR [#5916](https://github.com/tobymao/sqlglot/pull/5916) by [@georgesittas](https://github.com/georgesittas))*
77
+ - [`22c7ed7`](https://github.com/tobymao/sqlglot/commit/22c7ed7734b41ca544bb67bcc1ca4151f6d5f05f) - **clickhouse**: parse tuple *(PR [#5920](https://github.com/tobymao/sqlglot/pull/5920) by [@geooo109](https://github.com/geooo109))*
78
+ - :arrow_lower_right: *fixes issue [#5913](https://github.com/tobymao/sqlglot/issues/5913) opened by [@tiagoskaneta](https://github.com/tiagoskaneta)*
79
+ - [`223160b`](https://github.com/tobymao/sqlglot/commit/223160bd7914d51e9ec1abb8d0f1053e13a65c98) - **parser**: NULLABLE as an identifier *(PR [#5921](https://github.com/tobymao/sqlglot/pull/5921) by [@geooo109](https://github.com/geooo109))*
80
+ - :arrow_lower_right: *fixes issue [#5919](https://github.com/tobymao/sqlglot/issues/5919) opened by [@baruchoxman](https://github.com/baruchoxman)*
81
+ - [`42cfc79`](https://github.com/tobymao/sqlglot/commit/42cfc79ce120dee83084e2bb6b8bbd19f45bf06f) - **snowflake**: parse DAYOFWEEKISO *(PR [#5925](https://github.com/tobymao/sqlglot/pull/5925) by [@geooo109](https://github.com/geooo109))*
82
+ - :arrow_lower_right: *fixes issue [#5924](https://github.com/tobymao/sqlglot/issues/5924) opened by [@baruchoxman](https://github.com/baruchoxman)*
83
+ - [`0be2cb4`](https://github.com/tobymao/sqlglot/commit/0be2cb448ee1a5ac020ac47e9944875c30e42632) - **postgres**: support `DISTINCT` qualifier in `JSON_AGG` fixes [#5935](https://github.com/tobymao/sqlglot/pull/5935) *(commit by [@georgesittas](https://github.com/georgesittas))*
84
+ - [`e34b2e1`](https://github.com/tobymao/sqlglot/commit/e34b2e14d1f87d095955765173a5e17fc9985220) - allow grouping set parser to consume more syntax fixes [#5937](https://github.com/tobymao/sqlglot/pull/5937) *(commit by [@georgesittas](https://github.com/georgesittas))*
85
+
86
+
87
+ ## [v27.16.3] - 2025-09-18
88
+ ### :bug: Bug Fixes
89
+ - [`d127051`](https://github.com/tobymao/sqlglot/commit/d1270517c3e124ca59caf29e4506eb3848f7452e) - precedence issue with column operator parsing *(PR [#5914](https://github.com/tobymao/sqlglot/pull/5914) by [@georgesittas](https://github.com/georgesittas))*
90
+
91
+
4
92
  ## [v27.16.2] - 2025-09-18
5
93
  ### :wrench: Chores
6
94
  - [`837890c`](https://github.com/tobymao/sqlglot/commit/837890c7e8bcc3695541bbe32fd8088eee70fea3) - handle badly formed binary expressions gracefully in type inference *(commit by [@georgesittas](https://github.com/georgesittas))*
@@ -7387,3 +7475,5 @@ Changelog
7387
7475
  [v27.16.0]: https://github.com/tobymao/sqlglot/compare/v27.15.3...v27.16.0
7388
7476
  [v27.16.1]: https://github.com/tobymao/sqlglot/compare/v27.16.0...v27.16.1
7389
7477
  [v27.16.2]: https://github.com/tobymao/sqlglot/compare/v27.16.1...v27.16.2
7478
+ [v27.16.3]: https://github.com/tobymao/sqlglot/compare/v27.16.2...v27.16.3
7479
+ [v27.17.0]: https://github.com/tobymao/sqlglot/compare/v27.16.3...v27.17.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlglot
3
- Version: 27.16.3
3
+ Version: 27.18.0
4
4
  Summary: An easily customizable SQL parser and transpiler
5
5
  Author-email: Toby Mao <toby.mao@gmail.com>
6
6
  License-Expression: MIT
@@ -39,7 +39,7 @@ Dynamic: provides-extra
39
39
 
40
40
  ![SQLGlot logo](sqlglot.png)
41
41
 
42
- SQLGlot is a no-dependency SQL parser, transpiler, optimizer, and engine. It can be used to format SQL or translate between [30 different dialects](https://github.com/tobymao/sqlglot/blob/main/sqlglot/dialects/__init__.py) like [DuckDB](https://duckdb.org/), [Presto](https://prestodb.io/) / [Trino](https://trino.io/), [Spark](https://spark.apache.org/) / [Databricks](https://www.databricks.com/), [Snowflake](https://www.snowflake.com/en/), and [BigQuery](https://cloud.google.com/bigquery/). It aims to read a wide variety of SQL inputs and output syntactically and semantically correct SQL in the targeted dialects.
42
+ SQLGlot is a no-dependency SQL parser, transpiler, optimizer, and engine. It can be used to format SQL or translate between [31 different dialects](https://github.com/tobymao/sqlglot/blob/main/sqlglot/dialects/__init__.py) like [DuckDB](https://duckdb.org/), [Presto](https://prestodb.io/) / [Trino](https://trino.io/), [Spark](https://spark.apache.org/) / [Databricks](https://www.databricks.com/), [Snowflake](https://www.snowflake.com/en/), and [BigQuery](https://cloud.google.com/bigquery/). It aims to read a wide variety of SQL inputs and output syntactically and semantically correct SQL in the targeted dialects.
43
43
 
44
44
  It is a very comprehensive generic SQL parser with a robust [test suite](https://github.com/tobymao/sqlglot/blob/main/tests/). It is also quite [performant](#benchmarks), while being written purely in Python.
45
45
 
@@ -613,6 +613,7 @@ x + interval '1' month
613
613
  | RisingWave | Community |
614
614
  | SingleStore | Community |
615
615
  | Snowflake | Official |
616
+ | Solr | Community |
616
617
  | Spark | Official |
617
618
  | SQLite | Official |
618
619
  | StarRocks | Official |
@@ -1,6 +1,6 @@
1
1
  ![SQLGlot logo](sqlglot.png)
2
2
 
3
- SQLGlot is a no-dependency SQL parser, transpiler, optimizer, and engine. It can be used to format SQL or translate between [30 different dialects](https://github.com/tobymao/sqlglot/blob/main/sqlglot/dialects/__init__.py) like [DuckDB](https://duckdb.org/), [Presto](https://prestodb.io/) / [Trino](https://trino.io/), [Spark](https://spark.apache.org/) / [Databricks](https://www.databricks.com/), [Snowflake](https://www.snowflake.com/en/), and [BigQuery](https://cloud.google.com/bigquery/). It aims to read a wide variety of SQL inputs and output syntactically and semantically correct SQL in the targeted dialects.
3
+ SQLGlot is a no-dependency SQL parser, transpiler, optimizer, and engine. It can be used to format SQL or translate between [31 different dialects](https://github.com/tobymao/sqlglot/blob/main/sqlglot/dialects/__init__.py) like [DuckDB](https://duckdb.org/), [Presto](https://prestodb.io/) / [Trino](https://trino.io/), [Spark](https://spark.apache.org/) / [Databricks](https://www.databricks.com/), [Snowflake](https://www.snowflake.com/en/), and [BigQuery](https://cloud.google.com/bigquery/). It aims to read a wide variety of SQL inputs and output syntactically and semantically correct SQL in the targeted dialects.
4
4
 
5
5
  It is a very comprehensive generic SQL parser with a robust [test suite](https://github.com/tobymao/sqlglot/blob/main/tests/). It is also quite [performant](#benchmarks), while being written purely in Python.
6
6
 
@@ -574,6 +574,7 @@ x + interval '1' month
574
574
  | RisingWave | Community |
575
575
  | SingleStore | Community |
576
576
  | Snowflake | Official |
577
+ | Solr | Community |
577
578
  | Spark | Official |
578
579
  | SQLite | Official |
579
580
  | StarRocks | Official |
@@ -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.16.3'
32
- __version_tuple__ = version_tuple = (27, 16, 3)
31
+ __version__ = version = '27.18.0'
32
+ __version_tuple__ = version_tuple = (27, 18, 0)
33
33
 
34
- __commit_id__ = commit_id = 'gd1270517c'
34
+ __commit_id__ = commit_id = 'g980f99a4c'
@@ -88,6 +88,7 @@ DIALECTS = [
88
88
  "RisingWave",
89
89
  "SingleStore",
90
90
  "Snowflake",
91
+ "Solr",
91
92
  "Spark",
92
93
  "Spark2",
93
94
  "SQLite",
@@ -332,7 +332,6 @@ class ClickHouse(Dialect):
332
332
  "PARSEDATETIME": _build_datetime_format(exp.ParseDatetime),
333
333
  "RANDCANONICAL": exp.Rand.from_arg_list,
334
334
  "STR_TO_DATE": _build_str_to_date,
335
- "TUPLE": exp.Struct.from_arg_list,
336
335
  "TIMESTAMP_SUB": build_date_delta(exp.TimestampSub, default_unit=None),
337
336
  "TIMESTAMPSUB": build_date_delta(exp.TimestampSub, default_unit=None),
338
337
  "TIMESTAMP_ADD": build_date_delta(exp.TimestampAdd, default_unit=None),
@@ -505,14 +504,13 @@ class ClickHouse(Dialect):
505
504
  }
506
505
  )(AGG_FUNCTIONS, AGG_FUNCTIONS_SUFFIXES)
507
506
 
508
- FUNCTIONS_WITH_ALIASED_ARGS = {*parser.Parser.FUNCTIONS_WITH_ALIASED_ARGS, "TUPLE"}
509
-
510
507
  FUNCTION_PARSERS = {
511
508
  **parser.Parser.FUNCTION_PARSERS,
512
509
  "ARRAYJOIN": lambda self: self.expression(exp.Explode, this=self._parse_expression()),
513
510
  "QUANTILE": lambda self: self._parse_quantile(),
514
511
  "MEDIAN": lambda self: self._parse_quantile(),
515
512
  "COLUMNS": lambda self: self._parse_columns(),
513
+ "TUPLE": lambda self: exp.Struct.from_arg_list(self._parse_function_args(alias=True)),
516
514
  }
517
515
 
518
516
  FUNCTION_PARSERS.pop("MATCH")
@@ -1126,6 +1124,7 @@ class ClickHouse(Dialect):
1126
1124
  exp.RegexpLike: lambda self, e: self.func("match", e.this, e.expression),
1127
1125
  exp.Rand: rename_func("randCanonical"),
1128
1126
  exp.StartsWith: rename_func("startsWith"),
1127
+ exp.Struct: rename_func("tuple"),
1129
1128
  exp.EndsWith: rename_func("endsWith"),
1130
1129
  exp.EuclideanDistance: rename_func("L2Distance"),
1131
1130
  exp.StrPosition: lambda self, e: strposition_sql(
@@ -99,6 +99,7 @@ class Dialects(str, Enum):
99
99
  REDSHIFT = "redshift"
100
100
  RISINGWAVE = "risingwave"
101
101
  SNOWFLAKE = "snowflake"
102
+ SOLR = "solr"
102
103
  SPARK = "spark"
103
104
  SPARK2 = "spark2"
104
105
  SQLITE = "sqlite"
@@ -291,6 +292,12 @@ class _Dialect(type):
291
292
  TokenType.SEMI,
292
293
  }
293
294
 
295
+ klass.VALID_INTERVAL_UNITS = {
296
+ *klass.VALID_INTERVAL_UNITS,
297
+ *klass.DATE_PART_MAPPING.keys(),
298
+ *klass.DATE_PART_MAPPING.values(),
299
+ }
300
+
294
301
  return klass
295
302
 
296
303
 
@@ -551,6 +558,8 @@ class Dialect(metaclass=_Dialect):
551
558
  IDENTIFIER_START = '"'
552
559
  IDENTIFIER_END = '"'
553
560
 
561
+ VALID_INTERVAL_UNITS: t.Set[str] = set()
562
+
554
563
  # Delimiters for bit, hex, byte and unicode literals
555
564
  BIT_START: t.Optional[str] = None
556
565
  BIT_END: t.Optional[str] = None
@@ -1296,3 +1296,9 @@ class DuckDB(Dialect):
1296
1296
  return self.sql(exp.Cast(this=func, to=this.type))
1297
1297
 
1298
1298
  return self.sql(func)
1299
+
1300
+ def format_sql(self, expression: exp.Format) -> str:
1301
+ if expression.name.lower() == "%s" and len(expression.expressions) == 1:
1302
+ return self.func("FORMAT", "'{}'", expression.expressions[0])
1303
+
1304
+ return self.function_fallback_sql(expression)
@@ -179,6 +179,21 @@ class MySQL(Dialect):
179
179
  "%W": "%A",
180
180
  }
181
181
 
182
+ VALID_INTERVAL_UNITS = {
183
+ *Dialect.VALID_INTERVAL_UNITS,
184
+ "SECOND_MICROSECOND",
185
+ "MINUTE_MICROSECOND",
186
+ "MINUTE_SECOND",
187
+ "HOUR_MICROSECOND",
188
+ "HOUR_SECOND",
189
+ "HOUR_MINUTE",
190
+ "DAY_MICROSECOND",
191
+ "DAY_SECOND",
192
+ "DAY_MINUTE",
193
+ "DAY_HOUR",
194
+ "YEAR_MONTH",
195
+ }
196
+
182
197
  class Tokenizer(tokens.Tokenizer):
183
198
  QUOTES = ["'", '"']
184
199
  COMMENTS = ["--", "#", ("/*", "*/")]
@@ -375,6 +375,8 @@ class Postgres(Dialect):
375
375
  VAR_SINGLE_TOKENS = {"$"}
376
376
 
377
377
  class Parser(parser.Parser):
378
+ SUPPORTS_OMITTED_INTERVAL_SPAN_UNIT = True
379
+
378
380
  PROPERTY_PARSERS = {
379
381
  **parser.Parser.PROPERTY_PARSERS,
380
382
  "SET": lambda self: self.expression(exp.SetConfigProperty, this=self._parse_set()),
@@ -426,7 +428,7 @@ class Postgres(Dialect):
426
428
  "DATE_PART": lambda self: self._parse_date_part(),
427
429
  "JSON_AGG": lambda self: self.expression(
428
430
  exp.JSONArrayAgg,
429
- this=self._parse_bitwise(),
431
+ this=self._parse_lambda(),
430
432
  order=self._parse_order(),
431
433
  ),
432
434
  "JSONB_EXISTS": lambda self: self._parse_jsonb_exists(),
@@ -324,6 +324,15 @@ def _build_regexp_extract(expr_type: t.Type[E]) -> t.Callable[[t.List], E]:
324
324
  return _builder
325
325
 
326
326
 
327
+ def _build_like(expr_type: t.Type[E]) -> t.Callable[[t.List], E | exp.Escape]:
328
+ def _builder(args: t.List) -> E | exp.Escape:
329
+ like_expr = expr_type(this=args[0], expression=args[1])
330
+ escape = seq_get(args, 2)
331
+ return exp.Escape(this=like_expr, expression=escape) if escape else like_expr
332
+
333
+ return _builder
334
+
335
+
327
336
  def _regexpextract_sql(self, expression: exp.RegexpExtract | exp.RegexpExtractAll) -> str:
328
337
  # Other dialects don't support all of the following parameters, so we need to
329
338
  # generate default values as necessary to ensure the transpilation is correct
@@ -522,14 +531,27 @@ class Snowflake(Dialect):
522
531
  **Dialect.TYPE_TO_EXPRESSIONS,
523
532
  exp.DataType.Type.INT: {
524
533
  *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.INT],
534
+ exp.Ascii,
525
535
  exp.Length,
536
+ exp.BitLength,
537
+ exp.Levenshtein,
538
+ exp.JarowinklerSimilarity,
526
539
  },
527
540
  exp.DataType.Type.VARCHAR: {
528
541
  *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.VARCHAR],
542
+ exp.Base64DecodeString,
543
+ exp.Base64Encode,
544
+ exp.DecompressString,
529
545
  exp.MD5,
530
546
  exp.AIAgg,
531
547
  exp.AIClassify,
532
548
  exp.AISummarizeAgg,
549
+ exp.Chr,
550
+ exp.Collate,
551
+ exp.Collation,
552
+ exp.HexDecodeString,
553
+ exp.HexEncode,
554
+ exp.Initcap,
533
555
  exp.RegexpExtract,
534
556
  exp.RegexpReplace,
535
557
  exp.Repeat,
@@ -541,9 +563,13 @@ class Snowflake(Dialect):
541
563
  },
542
564
  exp.DataType.Type.BINARY: {
543
565
  *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.BINARY],
566
+ exp.Base64DecodeBinary,
567
+ exp.Compress,
568
+ exp.DecompressBinary,
544
569
  exp.MD5Digest,
545
570
  exp.SHA1Digest,
546
571
  exp.SHA2Digest,
572
+ exp.Unhex,
547
573
  },
548
574
  exp.DataType.Type.BIGINT: {
549
575
  *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.BIGINT],
@@ -566,7 +592,9 @@ class Snowflake(Dialect):
566
592
  expr_type: lambda self, e: self._annotate_by_args(e, "this")
567
593
  for expr_type in (
568
594
  exp.Left,
595
+ exp.Pad,
569
596
  exp.Right,
597
+ exp.Stuff,
570
598
  exp.Substring,
571
599
  )
572
600
  },
@@ -678,6 +706,7 @@ class Snowflake(Dialect):
678
706
  "DATE_TRUNC": _date_trunc_to_time,
679
707
  "DATEADD": _build_date_time_add(exp.DateAdd),
680
708
  "DATEDIFF": _build_datediff,
709
+ "DAYOFWEEKISO": exp.DayOfWeekIso.from_arg_list,
681
710
  "DIV0": _build_if_from_div0,
682
711
  "EDITDISTANCE": lambda args: exp.Levenshtein(
683
712
  this=seq_get(args, 0), expression=seq_get(args, 1), max_dist=seq_get(args, 2)
@@ -746,6 +775,8 @@ class Snowflake(Dialect):
746
775
  "TO_JSON": exp.JSONFormat.from_arg_list,
747
776
  "VECTOR_L2_DISTANCE": exp.EuclideanDistance.from_arg_list,
748
777
  "ZEROIFNULL": _build_if_from_zeroifnull,
778
+ "LIKE": _build_like(exp.Like),
779
+ "ILIKE": _build_like(exp.ILike),
749
780
  }
750
781
  FUNCTIONS.pop("PREDICT")
751
782
 
@@ -1478,13 +1509,23 @@ class Snowflake(Dialect):
1478
1509
 
1479
1510
  def datatype_sql(self, expression: exp.DataType) -> str:
1480
1511
  expressions = expression.expressions
1481
- if (
1482
- expressions
1483
- and expression.is_type(*exp.DataType.STRUCT_TYPES)
1484
- and any(isinstance(field_type, exp.DataType) for field_type in expressions)
1485
- ):
1486
- # The correct syntax is OBJECT [ (<key> <value_type [NOT NULL] [, ...]) ]
1487
- return "OBJECT"
1512
+ if expressions and expression.is_type(*exp.DataType.STRUCT_TYPES):
1513
+ for field_type in expressions:
1514
+ # The correct syntax is OBJECT [ (<key> <value_type [NOT NULL] [, ...]) ]
1515
+ if isinstance(field_type, exp.DataType):
1516
+ return "OBJECT"
1517
+ if (
1518
+ isinstance(field_type, exp.ColumnDef)
1519
+ and field_type.this
1520
+ and field_type.this.is_string
1521
+ ):
1522
+ # Doing OBJECT('foo' VARCHAR) is invalid snowflake Syntax. Moreover, besides
1523
+ # converting 'foo' into an identifier, we also need to quote it because these
1524
+ # keys are case-sensitive. For example:
1525
+ #
1526
+ # WITH t AS (SELECT OBJECT_CONSTRUCT('x', 'y') AS c) SELECT c:x FROM t -- correct
1527
+ # WITH t AS (SELECT OBJECT_CONSTRUCT('x', 'y') AS c) SELECT c:X FROM t -- incorrect, returns NULL
1528
+ field_type.this.replace(exp.to_identifier(field_type.name, quoted=True))
1488
1529
 
1489
1530
  return super().datatype_sql(expression)
1490
1531
 
@@ -1816,3 +1857,9 @@ class Snowflake(Dialect):
1816
1857
 
1817
1858
  def modelattribute_sql(self, expression: exp.ModelAttribute) -> str:
1818
1859
  return f"{self.sql(expression, 'this')}!{self.sql(expression, 'expression')}"
1860
+
1861
+ def format_sql(self, expression: exp.Format) -> str:
1862
+ if expression.name.lower() == "%s" and len(expression.expressions) == 1:
1863
+ return self.func("TO_CHAR", expression.expressions[0])
1864
+
1865
+ return self.function_fallback_sql(expression)
@@ -0,0 +1,22 @@
1
+ from sqlglot import exp, parser, tokens
2
+ from sqlglot.dialects.dialect import Dialect, NormalizationStrategy
3
+ from sqlglot.tokens import TokenType
4
+
5
+
6
+ # https://solr.apache.org/guide/solr/latest/query-guide/sql-query.html
7
+
8
+
9
+ class Solr(Dialect):
10
+ NORMALIZATION_STRATEGY = NormalizationStrategy.CASE_INSENSITIVE
11
+ DPIPE_IS_STRING_CONCAT = False
12
+ SUPPORTS_SEMI_ANTI_JOIN = False
13
+
14
+ class Parser(parser.Parser):
15
+ DISJUNCTION = {
16
+ **parser.Parser.DISJUNCTION,
17
+ TokenType.DPIPE: exp.Or,
18
+ }
19
+
20
+ class Tokenizer(tokens.Tokenizer):
21
+ QUOTES = ["'"]
22
+ IDENTIFIERS = ["`"]
@@ -5531,6 +5531,10 @@ class EuclideanDistance(Func):
5531
5531
  arg_types = {"this": True, "expression": True}
5532
5532
 
5533
5533
 
5534
+ class JarowinklerSimilarity(Func):
5535
+ arg_types = {"this": True, "expression": True}
5536
+
5537
+
5534
5538
  class AggFunc(Func):
5535
5539
  pass
5536
5540
 
@@ -6022,6 +6026,10 @@ class Collate(Binary, Func):
6022
6026
  pass
6023
6027
 
6024
6028
 
6029
+ class Collation(Func):
6030
+ pass
6031
+
6032
+
6025
6033
  class Ceil(Func):
6026
6034
  arg_types = {"this": True, "decimals": False, "to": False}
6027
6035
  _sql_names = ["CEIL", "CEILING"]
@@ -6414,6 +6422,19 @@ class ToBase64(Func):
6414
6422
  pass
6415
6423
 
6416
6424
 
6425
+ # https://docs.snowflake.com/en/sql-reference/functions/base64_decode_binary
6426
+ class Base64DecodeBinary(Func):
6427
+ arg_types = {"this": True, "alphabet": False}
6428
+
6429
+
6430
+ class Base64DecodeString(Func):
6431
+ arg_types = {"this": True, "alphabet": False}
6432
+
6433
+
6434
+ class Base64Encode(Func):
6435
+ arg_types = {"this": True, "max_line_length": False, "alphabet": False}
6436
+
6437
+
6417
6438
  # https://trino.io/docs/current/functions/datetime.html#from_iso8601_timestamp
6418
6439
  class FromISO8601Timestamp(Func):
6419
6440
  _sql_names = ["FROM_ISO8601_TIMESTAMP"]
@@ -6465,6 +6486,32 @@ class Hex(Func):
6465
6486
  pass
6466
6487
 
6467
6488
 
6489
+ # https://docs.snowflake.com/en/sql-reference/functions/hex_decode_string
6490
+ class HexDecodeString(Func):
6491
+ pass
6492
+
6493
+
6494
+ # https://docs.snowflake.com/en/sql-reference/functions/hex_encode
6495
+ class HexEncode(Func):
6496
+ arg_types = {"this": True, "case": False}
6497
+
6498
+
6499
+ # T-SQL: https://learn.microsoft.com/en-us/sql/t-sql/functions/compress-transact-sql?view=sql-server-ver17
6500
+ # Snowflake: https://docs.snowflake.com/en/sql-reference/functions/compress
6501
+ class Compress(Func):
6502
+ arg_types = {"this": True, "method": False}
6503
+
6504
+
6505
+ # Snowflake: https://docs.snowflake.com/en/sql-reference/functions/decompress_binary
6506
+ class DecompressBinary(Func):
6507
+ arg_types = {"this": True, "method": True}
6508
+
6509
+
6510
+ # Snowflake: https://docs.snowflake.com/en/sql-reference/functions/decompress_string
6511
+ class DecompressString(Func):
6512
+ arg_types = {"this": True, "method": True}
6513
+
6514
+
6468
6515
  class LowerHex(Hex):
6469
6516
  pass
6470
6517
 
@@ -6871,6 +6918,10 @@ class Length(Func):
6871
6918
  _sql_names = ["LENGTH", "LEN", "CHAR_LENGTH", "CHARACTER_LENGTH"]
6872
6919
 
6873
6920
 
6921
+ class BitLength(Func):
6922
+ pass
6923
+
6924
+
6874
6925
  class Levenshtein(Func):
6875
6926
  arg_types = {
6876
6927
  "this": True,
@@ -8557,6 +8608,19 @@ def parse_identifier(name: str | Identifier, dialect: DialectType = None) -> Ide
8557
8608
 
8558
8609
  INTERVAL_STRING_RE = re.compile(r"\s*(-?[0-9]+(?:\.[0-9]+)?)\s*([a-zA-Z]+)\s*")
8559
8610
 
8611
+ # Matches day-time interval strings that contain
8612
+ # - A number of days (possibly negative or with decimals)
8613
+ # - At least one space
8614
+ # - Portions of a time-like signature, potentially negative
8615
+ # - Standard format [-]h+:m+:s+[.f+]
8616
+ # - Just minutes/seconds/frac seconds [-]m+:s+.f+
8617
+ # - Just hours, minutes, maybe colon [-]h+:m+[:]
8618
+ # - Just hours, maybe colon [-]h+[:]
8619
+ # - Just colon :
8620
+ INTERVAL_DAY_TIME_RE = re.compile(
8621
+ r"\s*-?\s*\d+(?:\.\d+)?\s+(?:-?(?:\d+:)?\d+:\d+(?:\.\d+)?|-?(?:\d+:){1,2}|:)\s*"
8622
+ )
8623
+
8560
8624
 
8561
8625
  def to_interval(interval: str | Literal) -> Interval:
8562
8626
  """Builds an interval expression from a string like '1 day' or '5 months'."""
@@ -727,6 +727,7 @@ class Generator(metaclass=_Generator):
727
727
  "dialect",
728
728
  "unsupported_messages",
729
729
  "_escaped_quote_end",
730
+ "_escaped_byte_quote_end",
730
731
  "_escaped_identifier_end",
731
732
  "_next_name",
732
733
  "_identifier_start",
@@ -773,6 +774,11 @@ class Generator(metaclass=_Generator):
773
774
  self._escaped_quote_end: str = (
774
775
  self.dialect.tokenizer_class.STRING_ESCAPES[0] + self.dialect.QUOTE_END
775
776
  )
777
+ self._escaped_byte_quote_end: str = (
778
+ self.dialect.tokenizer_class.STRING_ESCAPES[0] + self.dialect.BYTE_END
779
+ if self.dialect.BYTE_END
780
+ else ""
781
+ )
776
782
  self._escaped_identifier_end = self.dialect.IDENTIFIER_END * 2
777
783
 
778
784
  self._next_name = name_sequence("_t")
@@ -1376,7 +1382,13 @@ class Generator(metaclass=_Generator):
1376
1382
  def bytestring_sql(self, expression: exp.ByteString) -> str:
1377
1383
  this = self.sql(expression, "this")
1378
1384
  if self.dialect.BYTE_START:
1379
- return f"{self.dialect.BYTE_START}{this}{self.dialect.BYTE_END}"
1385
+ escaped_byte_string = self.escape_str(
1386
+ this,
1387
+ escape_backslash=False,
1388
+ delimiter=self.dialect.BYTE_END,
1389
+ escaped_delimiter=self._escaped_byte_quote_end,
1390
+ )
1391
+ return f"{self.dialect.BYTE_START}{escaped_byte_string}{self.dialect.BYTE_END}"
1380
1392
  return this
1381
1393
 
1382
1394
  def unicodestring_sql(self, expression: exp.UnicodeString) -> str:
@@ -2475,16 +2487,23 @@ class Generator(metaclass=_Generator):
2475
2487
  text = f"{self.dialect.QUOTE_START}{self.escape_str(text)}{self.dialect.QUOTE_END}"
2476
2488
  return text
2477
2489
 
2478
- def escape_str(self, text: str, escape_backslash: bool = True) -> str:
2490
+ def escape_str(
2491
+ self,
2492
+ text: str,
2493
+ escape_backslash: bool = True,
2494
+ delimiter: t.Optional[str] = None,
2495
+ escaped_delimiter: t.Optional[str] = None,
2496
+ ) -> str:
2479
2497
  if self.dialect.ESCAPED_SEQUENCES:
2480
2498
  to_escaped = self.dialect.ESCAPED_SEQUENCES
2481
2499
  text = "".join(
2482
2500
  to_escaped.get(ch, ch) if escape_backslash or ch != "\\" else ch for ch in text
2483
2501
  )
2484
2502
 
2485
- return self._replace_line_breaks(text).replace(
2486
- self.dialect.QUOTE_END, self._escaped_quote_end
2487
- )
2503
+ delimiter = delimiter or self.dialect.QUOTE_END
2504
+ escaped_delimiter = escaped_delimiter or self._escaped_quote_end
2505
+
2506
+ return self._replace_line_breaks(text).replace(delimiter, escaped_delimiter)
2488
2507
 
2489
2508
  def loaddata_sql(self, expression: exp.LoadData) -> str:
2490
2509
  local = " LOCAL" if expression.args.get("local") else ""
@@ -3256,14 +3275,19 @@ class Generator(metaclass=_Generator):
3256
3275
  return f"(SELECT {self.sql(unnest)})"
3257
3276
 
3258
3277
  def interval_sql(self, expression: exp.Interval) -> str:
3259
- unit = self.sql(expression, "unit")
3278
+ unit_expression = expression.args.get("unit")
3279
+ unit = self.sql(unit_expression) if unit_expression else ""
3260
3280
  if not self.INTERVAL_ALLOWS_PLURAL_FORM:
3261
3281
  unit = self.TIME_PART_SINGULARS.get(unit, unit)
3262
3282
  unit = f" {unit}" if unit else ""
3263
3283
 
3264
3284
  if self.SINGLE_STRING_INTERVAL:
3265
3285
  this = expression.this.name if expression.this else ""
3266
- return f"INTERVAL '{this}{unit}'" if this else f"INTERVAL{unit}"
3286
+ if this:
3287
+ if unit_expression and isinstance(unit_expression, exp.IntervalSpan):
3288
+ return f"INTERVAL '{this}'{unit}"
3289
+ return f"INTERVAL '{this}{unit}'"
3290
+ return f"INTERVAL{unit}"
3267
3291
 
3268
3292
  this = self.sql(expression, "this")
3269
3293
  if this:
@@ -1588,7 +1588,7 @@ class Gen:
1588
1588
  kvs = []
1589
1589
  arg_types = list(node.arg_types)[arg_index:] if arg_index else node.arg_types
1590
1590
 
1591
- for k in arg_types or arg_types:
1591
+ for k in arg_types:
1592
1592
  v = node.args.get(k)
1593
1593
 
1594
1594
  if v is not None: