sqlglot 27.17.0__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.17.0 → sqlglot-27.18.0}/CHANGELOG.md +84 -0
  2. {sqlglot-27.17.0 → sqlglot-27.18.0}/PKG-INFO +3 -2
  3. {sqlglot-27.17.0 → sqlglot-27.18.0}/README.md +2 -1
  4. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/_version.py +3 -3
  5. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/__init__.py +1 -0
  6. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/dialect.py +9 -0
  7. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/mysql.py +15 -0
  8. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/snowflake.py +23 -7
  9. sqlglot-27.18.0/sqlglot/dialects/solr.py +22 -0
  10. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/expressions.py +19 -0
  11. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/optimizer/simplify.py +1 -1
  12. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/parser.py +25 -17
  13. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot.egg-info/PKG-INFO +3 -2
  14. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot.egg-info/SOURCES.txt +2 -0
  15. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_mysql.py +17 -0
  16. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_snowflake.py +16 -7
  17. sqlglot-27.18.0/tests/dialects/test_solr.py +12 -0
  18. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/identity.sql +2 -0
  19. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/annotate_functions.sql +36 -0
  20. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/test_optimizer.py +10 -0
  21. {sqlglot-27.17.0 → sqlglot-27.18.0}/.gitignore +0 -0
  22. {sqlglot-27.17.0 → sqlglot-27.18.0}/.gitpod.yml +0 -0
  23. {sqlglot-27.17.0 → sqlglot-27.18.0}/.pre-commit-config.yaml +0 -0
  24. {sqlglot-27.17.0 → sqlglot-27.18.0}/CONTRIBUTING.md +0 -0
  25. {sqlglot-27.17.0 → sqlglot-27.18.0}/LICENSE +0 -0
  26. {sqlglot-27.17.0 → sqlglot-27.18.0}/MANIFEST.in +0 -0
  27. {sqlglot-27.17.0 → sqlglot-27.18.0}/Makefile +0 -0
  28. {sqlglot-27.17.0 → sqlglot-27.18.0}/pyproject.toml +0 -0
  29. {sqlglot-27.17.0 → sqlglot-27.18.0}/setup.cfg +0 -0
  30. {sqlglot-27.17.0 → sqlglot-27.18.0}/setup.py +0 -0
  31. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/__init__.py +0 -0
  32. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/__main__.py +0 -0
  33. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/_typing.py +0 -0
  34. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/athena.py +0 -0
  35. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/bigquery.py +0 -0
  36. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/clickhouse.py +0 -0
  37. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/databricks.py +0 -0
  38. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/doris.py +0 -0
  39. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/dremio.py +0 -0
  40. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/drill.py +0 -0
  41. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/druid.py +0 -0
  42. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/duckdb.py +0 -0
  43. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/dune.py +0 -0
  44. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/exasol.py +0 -0
  45. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/fabric.py +0 -0
  46. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/hive.py +0 -0
  47. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/materialize.py +0 -0
  48. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/oracle.py +0 -0
  49. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/postgres.py +0 -0
  50. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/presto.py +0 -0
  51. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/prql.py +0 -0
  52. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/redshift.py +0 -0
  53. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/risingwave.py +0 -0
  54. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/singlestore.py +0 -0
  55. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/spark.py +0 -0
  56. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/spark2.py +0 -0
  57. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/sqlite.py +0 -0
  58. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/starrocks.py +0 -0
  59. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/tableau.py +0 -0
  60. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/teradata.py +0 -0
  61. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/trino.py +0 -0
  62. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/dialects/tsql.py +0 -0
  63. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/diff.py +0 -0
  64. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/errors.py +0 -0
  65. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/executor/__init__.py +0 -0
  66. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/executor/context.py +0 -0
  67. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/executor/env.py +0 -0
  68. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/executor/python.py +0 -0
  69. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/executor/table.py +0 -0
  70. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/generator.py +0 -0
  71. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/helper.py +0 -0
  72. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/jsonpath.py +0 -0
  73. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/lineage.py +0 -0
  74. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/optimizer/__init__.py +0 -0
  75. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/optimizer/annotate_types.py +0 -0
  76. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/optimizer/canonicalize.py +0 -0
  77. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
  78. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/optimizer/eliminate_joins.py +0 -0
  79. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
  80. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
  81. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/optimizer/merge_subqueries.py +0 -0
  82. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/optimizer/normalize.py +0 -0
  83. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
  84. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/optimizer/optimize_joins.py +0 -0
  85. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/optimizer/optimizer.py +0 -0
  86. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/optimizer/pushdown_predicates.py +0 -0
  87. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/optimizer/pushdown_projections.py +0 -0
  88. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/optimizer/qualify.py +0 -0
  89. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/optimizer/qualify_columns.py +0 -0
  90. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/optimizer/qualify_tables.py +0 -0
  91. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/optimizer/scope.py +0 -0
  92. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/optimizer/unnest_subqueries.py +0 -0
  93. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/planner.py +0 -0
  94. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/py.typed +0 -0
  95. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/schema.py +0 -0
  96. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/serde.py +0 -0
  97. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/time.py +0 -0
  98. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/tokens.py +0 -0
  99. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/transforms.py +0 -0
  100. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot/trie.py +0 -0
  101. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot.egg-info/dependency_links.txt +0 -0
  102. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot.egg-info/requires.txt +0 -0
  103. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot.egg-info/top_level.txt +0 -0
  104. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglot.png +0 -0
  105. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglotrs/Cargo.lock +0 -0
  106. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglotrs/Cargo.toml +0 -0
  107. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglotrs/benches/dialect_settings.json +0 -0
  108. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglotrs/benches/long.rs +0 -0
  109. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglotrs/benches/token_type_settings.json +0 -0
  110. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglotrs/benches/tokenizer_dialect_settings.json +0 -0
  111. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglotrs/benches/tokenizer_settings.json +0 -0
  112. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglotrs/pyproject.toml +0 -0
  113. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglotrs/src/lib.rs +0 -0
  114. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglotrs/src/settings.rs +0 -0
  115. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglotrs/src/token.rs +0 -0
  116. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglotrs/src/tokenizer.rs +0 -0
  117. {sqlglot-27.17.0 → sqlglot-27.18.0}/sqlglotrs/src/trie.rs +0 -0
  118. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/__init__.py +0 -0
  119. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/__init__.py +0 -0
  120. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_athena.py +0 -0
  121. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_bigquery.py +0 -0
  122. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_clickhouse.py +0 -0
  123. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_databricks.py +0 -0
  124. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_dialect.py +0 -0
  125. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_doris.py +0 -0
  126. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_dremio.py +0 -0
  127. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_drill.py +0 -0
  128. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_druid.py +0 -0
  129. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_duckdb.py +0 -0
  130. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_dune.py +0 -0
  131. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_exasol.py +0 -0
  132. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_fabric.py +0 -0
  133. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_hive.py +0 -0
  134. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_materialize.py +0 -0
  135. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_oracle.py +0 -0
  136. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_pipe_syntax.py +0 -0
  137. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_postgres.py +0 -0
  138. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_presto.py +0 -0
  139. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_prql.py +0 -0
  140. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_redshift.py +0 -0
  141. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_risingwave.py +0 -0
  142. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_singlestore.py +0 -0
  143. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_spark.py +0 -0
  144. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_sqlite.py +0 -0
  145. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_starrocks.py +0 -0
  146. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_tableau.py +0 -0
  147. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_teradata.py +0 -0
  148. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_trino.py +0 -0
  149. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/dialects/test_tsql.py +0 -0
  150. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/jsonpath/LICENSE +0 -0
  151. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/jsonpath/cts.json +0 -0
  152. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/annotate_types.sql +0 -0
  153. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/canonicalize.sql +0 -0
  154. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
  155. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/eliminate_joins.sql +0 -0
  156. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
  157. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
  158. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
  159. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/normalize.sql +0 -0
  160. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
  161. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
  162. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/optimizer.sql +0 -0
  163. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
  164. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
  165. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/pushdown_projections.sql +0 -0
  166. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/qualify_columns.sql +0 -0
  167. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
  168. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
  169. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
  170. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
  171. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
  172. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/simplify.sql +0 -0
  173. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
  174. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
  175. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
  176. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
  177. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
  178. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
  179. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
  180. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
  181. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
  182. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
  183. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
  184. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
  185. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
  186. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
  187. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
  188. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
  189. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
  190. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
  191. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
  192. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
  193. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
  194. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
  195. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
  196. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
  197. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
  198. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
  199. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
  200. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
  201. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
  202. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
  203. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
  204. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
  205. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
  206. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
  207. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/optimizer/unnest_subqueries.sql +0 -0
  208. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/partial.sql +0 -0
  209. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/fixtures/pretty.sql +0 -0
  210. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/gen_fixtures.py +0 -0
  211. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/helpers.py +0 -0
  212. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/test_build.py +0 -0
  213. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/test_dialect_imports.py +0 -0
  214. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/test_diff.py +0 -0
  215. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/test_docs.py +0 -0
  216. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/test_executor.py +0 -0
  217. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/test_expressions.py +0 -0
  218. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/test_generator.py +0 -0
  219. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/test_helper.py +0 -0
  220. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/test_jsonpath.py +0 -0
  221. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/test_lineage.py +0 -0
  222. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/test_parser.py +0 -0
  223. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/test_schema.py +0 -0
  224. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/test_serde.py +0 -0
  225. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/test_time.py +0 -0
  226. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/test_tokens.py +0 -0
  227. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/test_transforms.py +0 -0
  228. {sqlglot-27.17.0 → sqlglot-27.18.0}/tests/test_transpile.py +0 -0
@@ -1,6 +1,89 @@
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
+
4
87
  ## [v27.16.3] - 2025-09-18
5
88
  ### :bug: Bug Fixes
6
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))*
@@ -7393,3 +7476,4 @@ Changelog
7393
7476
  [v27.16.1]: https://github.com/tobymao/sqlglot/compare/v27.16.0...v27.16.1
7394
7477
  [v27.16.2]: https://github.com/tobymao/sqlglot/compare/v27.16.1...v27.16.2
7395
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.17.0
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.17.0'
32
- __version_tuple__ = version_tuple = (27, 17, 0)
31
+ __version__ = version = '27.18.0'
32
+ __version_tuple__ = version_tuple = (27, 18, 0)
33
33
 
34
- __commit_id__ = commit_id = 'g0dc0015a3'
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",
@@ -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
@@ -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 = ["--", "#", ("/*", "*/")]
@@ -535,17 +535,20 @@ class Snowflake(Dialect):
535
535
  exp.Length,
536
536
  exp.BitLength,
537
537
  exp.Levenshtein,
538
+ exp.JarowinklerSimilarity,
538
539
  },
539
540
  exp.DataType.Type.VARCHAR: {
540
541
  *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.VARCHAR],
541
542
  exp.Base64DecodeString,
542
543
  exp.Base64Encode,
544
+ exp.DecompressString,
543
545
  exp.MD5,
544
546
  exp.AIAgg,
545
547
  exp.AIClassify,
546
548
  exp.AISummarizeAgg,
547
549
  exp.Chr,
548
550
  exp.Collate,
551
+ exp.Collation,
549
552
  exp.HexDecodeString,
550
553
  exp.HexEncode,
551
554
  exp.Initcap,
@@ -562,6 +565,7 @@ class Snowflake(Dialect):
562
565
  *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.BINARY],
563
566
  exp.Base64DecodeBinary,
564
567
  exp.Compress,
568
+ exp.DecompressBinary,
565
569
  exp.MD5Digest,
566
570
  exp.SHA1Digest,
567
571
  exp.SHA2Digest,
@@ -588,7 +592,9 @@ class Snowflake(Dialect):
588
592
  expr_type: lambda self, e: self._annotate_by_args(e, "this")
589
593
  for expr_type in (
590
594
  exp.Left,
595
+ exp.Pad,
591
596
  exp.Right,
597
+ exp.Stuff,
592
598
  exp.Substring,
593
599
  )
594
600
  },
@@ -1503,13 +1509,23 @@ class Snowflake(Dialect):
1503
1509
 
1504
1510
  def datatype_sql(self, expression: exp.DataType) -> str:
1505
1511
  expressions = expression.expressions
1506
- if (
1507
- expressions
1508
- and expression.is_type(*exp.DataType.STRUCT_TYPES)
1509
- and any(isinstance(field_type, exp.DataType) for field_type in expressions)
1510
- ):
1511
- # The correct syntax is OBJECT [ (<key> <value_type [NOT NULL] [, ...]) ]
1512
- 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))
1513
1529
 
1514
1530
  return super().datatype_sql(expression)
1515
1531
 
@@ -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"]
@@ -6483,6 +6491,7 @@ class HexDecodeString(Func):
6483
6491
  pass
6484
6492
 
6485
6493
 
6494
+ # https://docs.snowflake.com/en/sql-reference/functions/hex_encode
6486
6495
  class HexEncode(Func):
6487
6496
  arg_types = {"this": True, "case": False}
6488
6497
 
@@ -6493,6 +6502,16 @@ class Compress(Func):
6493
6502
  arg_types = {"this": True, "method": False}
6494
6503
 
6495
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
+
6496
6515
  class LowerHex(Hex):
6497
6516
  pass
6498
6517
 
@@ -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:
@@ -3123,21 +3123,26 @@ class Parser(metaclass=_Parser):
3123
3123
  )
3124
3124
 
3125
3125
  def _parse_update(self) -> exp.Update:
3126
- this = self._parse_table(joins=True, alias_tokens=self.UPDATE_ALIAS_TOKENS)
3127
- expressions = self._match(TokenType.SET) and self._parse_csv(self._parse_equality)
3128
- returning = self._parse_returning()
3129
- return self.expression(
3130
- exp.Update,
3131
- **{ # type: ignore
3132
- "this": this,
3133
- "expressions": expressions,
3134
- "from": self._parse_from(joins=True),
3135
- "where": self._parse_where(),
3136
- "returning": returning or self._parse_returning(),
3137
- "order": self._parse_order(),
3138
- "limit": self._parse_limit(),
3139
- },
3140
- )
3126
+ kwargs: t.Dict[str, t.Any] = {
3127
+ "this": self._parse_table(joins=True, alias_tokens=self.UPDATE_ALIAS_TOKENS),
3128
+ }
3129
+ while self._curr:
3130
+ if self._match(TokenType.SET):
3131
+ kwargs["expressions"] = self._parse_csv(self._parse_equality)
3132
+ elif self._match(TokenType.RETURNING, advance=False):
3133
+ kwargs["returning"] = self._parse_returning()
3134
+ elif self._match(TokenType.FROM, advance=False):
3135
+ kwargs["from"] = self._parse_from(joins=True)
3136
+ elif self._match(TokenType.WHERE, advance=False):
3137
+ kwargs["where"] = self._parse_where()
3138
+ elif self._match(TokenType.ORDER_BY, advance=False):
3139
+ kwargs["order"] = self._parse_order()
3140
+ elif self._match(TokenType.LIMIT, advance=False):
3141
+ kwargs["limit"] = self._parse_limit()
3142
+ else:
3143
+ break
3144
+
3145
+ return self.expression(exp.Update, **kwargs)
3141
3146
 
3142
3147
  def _parse_use(self) -> exp.Use:
3143
3148
  return self.expression(
@@ -4240,9 +4245,11 @@ class Parser(metaclass=_Parser):
4240
4245
  )
4241
4246
 
4242
4247
  def _parse_unnest(self, with_alias: bool = True) -> t.Optional[exp.Unnest]:
4243
- if not self._match(TokenType.UNNEST):
4248
+ if not self._match_pair(TokenType.UNNEST, TokenType.L_PAREN, advance=False):
4244
4249
  return None
4245
4250
 
4251
+ self._advance()
4252
+
4246
4253
  expressions = self._parse_wrapped_csv(self._parse_equality)
4247
4254
  offset = self._match_pair(TokenType.WITH, TokenType.ORDINALITY)
4248
4255
 
@@ -5104,7 +5111,8 @@ class Parser(metaclass=_Parser):
5104
5111
  isinstance(this, exp.Column)
5105
5112
  and not this.table
5106
5113
  and not this.this.quoted
5107
- and this.name.upper() in ("IS", "ROWS")
5114
+ and self._curr
5115
+ and self._curr.text.upper() not in self.dialect.VALID_INTERVAL_UNITS
5108
5116
  ):
5109
5117
  self._retreat(index)
5110
5118
  return None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlglot
3
- Version: 27.17.0
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 |
@@ -61,6 +61,7 @@ sqlglot/dialects/redshift.py
61
61
  sqlglot/dialects/risingwave.py
62
62
  sqlglot/dialects/singlestore.py
63
63
  sqlglot/dialects/snowflake.py
64
+ sqlglot/dialects/solr.py
64
65
  sqlglot/dialects/spark.py
65
66
  sqlglot/dialects/spark2.py
66
67
  sqlglot/dialects/sqlite.py
@@ -154,6 +155,7 @@ tests/dialects/test_redshift.py
154
155
  tests/dialects/test_risingwave.py
155
156
  tests/dialects/test_singlestore.py
156
157
  tests/dialects/test_snowflake.py
158
+ tests/dialects/test_solr.py
157
159
  tests/dialects/test_spark.py
158
160
  tests/dialects/test_sqlite.py
159
161
  tests/dialects/test_starrocks.py
@@ -1486,3 +1486,20 @@ COMMENT='客户账户表'"""
1486
1486
  self.validate_identity("x % y").assert_is(exp.Mod)
1487
1487
  self.validate_identity("x MOD y", "x % y").assert_is(exp.Mod)
1488
1488
  self.validate_identity("MOD(x, y)", "x % y").assert_is(exp.Mod)
1489
+
1490
+ def test_valid_interval_units(self):
1491
+ for unit in (
1492
+ "SECOND_MICROSECOND",
1493
+ "MINUTE_MICROSECOND",
1494
+ "MINUTE_SECOND",
1495
+ "HOUR_MICROSECOND",
1496
+ "HOUR_SECOND",
1497
+ "HOUR_MINUTE",
1498
+ "DAY_MICROSECOND",
1499
+ "DAY_SECOND",
1500
+ "DAY_MINUTE",
1501
+ "DAY_HOUR",
1502
+ "YEAR_MONTH",
1503
+ ):
1504
+ with self.subTest(f"Testing INTERVAL unit: {unit}"):
1505
+ self.validate_identity(f"DATE_ADD(base_date, INTERVAL day_interval {unit})")
@@ -37,6 +37,11 @@ class TestSnowflake(Validator):
37
37
  self.validate_identity("SELECT HEX_ENCODE('Hello World', 0)")
38
38
  self.validate_identity("SELECT CHR(8364)")
39
39
  self.validate_identity("SELECT COMPRESS('Hello World', 'ZLIB')")
40
+ self.validate_identity("SELECT DECOMPRESS_BINARY('compressed_data', 'SNAPPY')")
41
+ self.validate_identity("SELECT DECOMPRESS_STRING('compressed_data', 'ZSTD')")
42
+ self.validate_identity("SELECT LPAD('Hello', 10, '*')")
43
+ self.validate_identity("SELECT LPAD(tbl.bin_col, 10)")
44
+ self.validate_identity("SELECT JAROWINKLER_SIMILARITY('hello', 'world')")
40
45
  self.validate_identity("SELECT {*} FROM my_table")
41
46
  self.validate_identity("SELECT {my_table.*} FROM my_table")
42
47
  self.validate_identity("SELECT {* ILIKE 'col1%'} FROM my_table")
@@ -77,9 +82,6 @@ class TestSnowflake(Validator):
77
82
  self.validate_identity("SELECT AI_AGG(review, 'Summarize the reviews')")
78
83
  self.validate_identity("SELECT AI_SUMMARIZE_AGG(review)")
79
84
  self.validate_identity("SELECT AI_CLASSIFY('text', ['travel', 'cooking'])")
80
- self.validate_identity(
81
- "SELECT AI_CLASSIFY('text', ['travel', 'cooking'], OBJECT_CONSTRUCT('output_mode', 'multi'))"
82
- )
83
85
  self.validate_identity("SELECT OBJECT_CONSTRUCT()")
84
86
  self.validate_identity("SELECT DAYOFMONTH(CURRENT_TIMESTAMP())")
85
87
  self.validate_identity("SELECT DAYOFYEAR(CURRENT_TIMESTAMP())")
@@ -104,10 +106,6 @@ class TestSnowflake(Validator):
104
106
  self.validate_identity("SELECT CONVERT_TIMEZONE('UTC', 'America/Los_Angeles', col)")
105
107
  self.validate_identity("ALTER TABLE a SWAP WITH b")
106
108
  self.validate_identity("SELECT MATCH_CONDITION")
107
- self.validate_identity(
108
- "SELECT * REPLACE (CAST(col AS TEXT) AS scol) FROM t",
109
- "SELECT * REPLACE (CAST(col AS VARCHAR) AS scol) FROM t",
110
- )
111
109
  self.validate_identity("1 /* /* */")
112
110
  self.validate_identity("TO_TIMESTAMP(col, fmt)")
113
111
  self.validate_identity("SELECT TO_CHAR(CAST('12:05:05' AS TIME))")
@@ -116,6 +114,9 @@ class TestSnowflake(Validator):
116
114
  self.validate_identity("SELECT GET_PATH(foo, 'bar')")
117
115
  self.validate_identity("SELECT a, exclude, b FROM xxx")
118
116
  self.validate_identity("SELECT ARRAY_SORT(x, TRUE, FALSE)")
117
+ self.validate_identity(
118
+ "SELECT AI_CLASSIFY('text', ['travel', 'cooking'], OBJECT_CONSTRUCT('output_mode', 'multi'))"
119
+ )
119
120
  self.validate_identity(
120
121
  "SELECT * FROM table AT (TIMESTAMP => '2024-07-24') UNPIVOT(a FOR b IN (c)) AS pivot_table"
121
122
  )
@@ -146,6 +147,14 @@ class TestSnowflake(Validator):
146
147
  self.validate_identity(
147
148
  """SELECT TO_TIMESTAMP('2025-01-16T14:45:30.123+0500', 'yyyy-mm-DD"T"hh24:mi:ss.ff3TZHTZM')"""
148
149
  )
150
+ self.validate_identity(
151
+ "UPDATE sometesttable u FROM (SELECT 5195 AS new_count, '01bee1e5-0000-d31e-0000-e80ef02b9f27' query_id ) b SET qry_hash_count = new_count WHERE u.sample_query_id = b.query_id",
152
+ "UPDATE sometesttable AS u SET qry_hash_count = new_count FROM (SELECT 5195 AS new_count, '01bee1e5-0000-d31e-0000-e80ef02b9f27' AS query_id) AS b WHERE u.sample_query_id = b.query_id",
153
+ )
154
+ self.validate_identity(
155
+ "SELECT * REPLACE (CAST(col AS TEXT) AS scol) FROM t",
156
+ "SELECT * REPLACE (CAST(col AS VARCHAR) AS scol) FROM t",
157
+ )
149
158
  self.validate_identity(
150
159
  "GET(value, 'foo')::VARCHAR",
151
160
  "CAST(GET(value, 'foo') AS VARCHAR)",
@@ -0,0 +1,12 @@
1
+ from sqlglot import exp
2
+ from tests.dialects.test_dialect import Validator
3
+
4
+
5
+ class TestSolr(Validator):
6
+ dialect = "solr"
7
+
8
+ def test_solr(self):
9
+ self.validate_identity("SELECT `default`.column FROM t")
10
+ self.failureException('SELECT "column" FROM t')
11
+ self.validate_identity("SELECT column FROM t WHERE column = 'val'")
12
+ self.validate_identity("a || b", "a OR b").assert_is(exp.Or)
@@ -936,3 +936,5 @@ SELECT test.Unknown FROM test
936
936
  SELECT lock
937
937
  SELECT a FROM test GROUP BY GROUPING SETS ((x + y, z))
938
938
  SELECT (LEAD(foo1, 1, 0)) OVER (PARTITION BY foo2 ORDER BY foo3) FROM t
939
+ SELECT LAST_VALUE(CASE WHEN interval <> 'foo' THEN interval END) IGNORE NULLS FROM t
940
+ WITH UNNEST AS (SELECT 1 AS UNNEST) SELECT UNNEST FROM UNNEST
@@ -1631,6 +1631,30 @@ BINARY;
1631
1631
  COMPRESS('Hello World', 'zlib(1)');
1632
1632
  BINARY;
1633
1633
 
1634
+ # dialect: snowflake
1635
+ DECOMPRESS_BINARY('compressed_data', 'SNAPPY');
1636
+ BINARY;
1637
+
1638
+ # dialect: snowflake
1639
+ DECOMPRESS_STRING('compressed_data', 'ZSTD');
1640
+ VARCHAR;
1641
+
1642
+ # dialect: snowflake
1643
+ LPAD('Hello', 10, '*');
1644
+ VARCHAR;
1645
+
1646
+ # dialect: snowflake
1647
+ LPAD(tbl.str_col, 10);
1648
+ VARCHAR;
1649
+
1650
+ # dialect: snowflake
1651
+ LPAD(tbl.bin_col, 10, 0x20);
1652
+ BINARY;
1653
+
1654
+ # dialect: snowflake
1655
+ COLLATION('hello');
1656
+ VARCHAR;
1657
+
1634
1658
  # dialect: snowflake
1635
1659
  CONCAT('Hello', 'World!');
1636
1660
  VARCHAR;
@@ -1727,6 +1751,18 @@ VARCHAR;
1727
1751
  INITCAP(tbl.str_col);
1728
1752
  VARCHAR;
1729
1753
 
1754
+ # dialect: snowflake
1755
+ JAROWINKLER_SIMILARITY('hello', 'world');
1756
+ INT;
1757
+
1758
+ # dialect: snowflake
1759
+ INSERT('abc', 1, 2, 'Z');
1760
+ VARCHAR;
1761
+
1762
+ # dialect: snowflake
1763
+ INSERT(tbl.bin_col, 1, 2, tbl.bin_col);
1764
+ BINARY;
1765
+
1730
1766
  # dialect: snowflake
1731
1767
  LEAST(x::DECIMAL(18, 2));
1732
1768
  DECIMAL(18, 2);