sqlglot 27.26.0__tar.gz → 27.28.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.

Potentially problematic release.


This version of sqlglot might be problematic. Click here for more details.

Files changed (228) hide show
  1. {sqlglot-27.26.0 → sqlglot-27.28.0}/CHANGELOG.md +66 -0
  2. {sqlglot-27.26.0 → sqlglot-27.28.0}/PKG-INFO +2 -2
  3. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/_version.py +3 -3
  4. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/bigquery.py +111 -94
  5. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/clickhouse.py +6 -3
  6. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/dialect.py +1 -0
  7. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/duckdb.py +20 -1
  8. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/mysql.py +2 -2
  9. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/snowflake.py +58 -2
  10. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/spark.py +10 -2
  11. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/starrocks.py +3 -0
  12. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/tsql.py +9 -1
  13. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/expressions.py +57 -6
  14. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/generator.py +1 -0
  15. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/lineage.py +9 -3
  16. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/optimizer/qualify_columns.py +7 -1
  17. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/optimizer/simplify.py +6 -5
  18. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/parser.py +5 -3
  19. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot.egg-info/PKG-INFO +2 -2
  20. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot.egg-info/requires.txt +1 -1
  21. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglotrs/Cargo.lock +1 -1
  22. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglotrs/Cargo.toml +1 -1
  23. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_bigquery.py +17 -0
  24. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_clickhouse.py +4 -0
  25. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_dialect.py +9 -0
  26. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_duckdb.py +54 -0
  27. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_postgres.py +1 -0
  28. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_snowflake.py +58 -0
  29. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_spark.py +7 -0
  30. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_starrocks.py +10 -1
  31. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_tsql.py +6 -0
  32. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/identity.sql +6 -1
  33. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/annotate_functions.sql +232 -0
  34. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/simplify.sql +17 -1
  35. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/unnest_subqueries.sql +4 -1
  36. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/test_lineage.py +66 -0
  37. {sqlglot-27.26.0 → sqlglot-27.28.0}/.gitignore +0 -0
  38. {sqlglot-27.26.0 → sqlglot-27.28.0}/.gitpod.yml +0 -0
  39. {sqlglot-27.26.0 → sqlglot-27.28.0}/.pre-commit-config.yaml +0 -0
  40. {sqlglot-27.26.0 → sqlglot-27.28.0}/CONTRIBUTING.md +0 -0
  41. {sqlglot-27.26.0 → sqlglot-27.28.0}/LICENSE +0 -0
  42. {sqlglot-27.26.0 → sqlglot-27.28.0}/MANIFEST.in +0 -0
  43. {sqlglot-27.26.0 → sqlglot-27.28.0}/Makefile +0 -0
  44. {sqlglot-27.26.0 → sqlglot-27.28.0}/README.md +0 -0
  45. {sqlglot-27.26.0 → sqlglot-27.28.0}/pyproject.toml +0 -0
  46. {sqlglot-27.26.0 → sqlglot-27.28.0}/setup.cfg +0 -0
  47. {sqlglot-27.26.0 → sqlglot-27.28.0}/setup.py +0 -0
  48. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/__init__.py +0 -0
  49. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/__main__.py +0 -0
  50. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/_typing.py +0 -0
  51. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/__init__.py +0 -0
  52. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/athena.py +0 -0
  53. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/databricks.py +0 -0
  54. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/doris.py +0 -0
  55. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/dremio.py +0 -0
  56. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/drill.py +0 -0
  57. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/druid.py +0 -0
  58. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/dune.py +0 -0
  59. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/exasol.py +0 -0
  60. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/fabric.py +0 -0
  61. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/hive.py +0 -0
  62. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/materialize.py +0 -0
  63. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/oracle.py +0 -0
  64. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/postgres.py +0 -0
  65. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/presto.py +0 -0
  66. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/prql.py +0 -0
  67. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/redshift.py +0 -0
  68. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/risingwave.py +0 -0
  69. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/singlestore.py +0 -0
  70. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/solr.py +0 -0
  71. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/spark2.py +0 -0
  72. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/sqlite.py +0 -0
  73. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/tableau.py +0 -0
  74. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/teradata.py +0 -0
  75. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/dialects/trino.py +0 -0
  76. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/diff.py +0 -0
  77. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/errors.py +0 -0
  78. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/executor/__init__.py +0 -0
  79. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/executor/context.py +0 -0
  80. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/executor/env.py +0 -0
  81. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/executor/python.py +0 -0
  82. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/executor/table.py +0 -0
  83. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/helper.py +0 -0
  84. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/jsonpath.py +0 -0
  85. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/optimizer/__init__.py +0 -0
  86. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/optimizer/annotate_types.py +0 -0
  87. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/optimizer/canonicalize.py +0 -0
  88. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
  89. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/optimizer/eliminate_joins.py +0 -0
  90. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
  91. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
  92. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/optimizer/merge_subqueries.py +0 -0
  93. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/optimizer/normalize.py +0 -0
  94. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
  95. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/optimizer/optimize_joins.py +0 -0
  96. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/optimizer/optimizer.py +0 -0
  97. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/optimizer/pushdown_predicates.py +0 -0
  98. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/optimizer/pushdown_projections.py +0 -0
  99. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/optimizer/qualify.py +0 -0
  100. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/optimizer/qualify_tables.py +0 -0
  101. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/optimizer/scope.py +0 -0
  102. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/optimizer/unnest_subqueries.py +0 -0
  103. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/planner.py +0 -0
  104. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/py.typed +0 -0
  105. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/schema.py +0 -0
  106. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/serde.py +0 -0
  107. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/time.py +0 -0
  108. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/tokens.py +0 -0
  109. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/transforms.py +0 -0
  110. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot/trie.py +0 -0
  111. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot.egg-info/SOURCES.txt +0 -0
  112. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot.egg-info/dependency_links.txt +0 -0
  113. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot.egg-info/top_level.txt +0 -0
  114. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglot.png +0 -0
  115. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglotrs/benches/dialect_settings.json +0 -0
  116. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglotrs/benches/long.rs +0 -0
  117. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglotrs/benches/token_type_settings.json +0 -0
  118. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglotrs/benches/tokenizer_dialect_settings.json +0 -0
  119. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglotrs/benches/tokenizer_settings.json +0 -0
  120. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglotrs/pyproject.toml +0 -0
  121. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglotrs/src/lib.rs +0 -0
  122. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglotrs/src/settings.rs +0 -0
  123. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglotrs/src/token.rs +0 -0
  124. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglotrs/src/tokenizer.rs +0 -0
  125. {sqlglot-27.26.0 → sqlglot-27.28.0}/sqlglotrs/src/trie.rs +0 -0
  126. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/__init__.py +0 -0
  127. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/__init__.py +0 -0
  128. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_athena.py +0 -0
  129. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_databricks.py +0 -0
  130. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_doris.py +0 -0
  131. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_dremio.py +0 -0
  132. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_drill.py +0 -0
  133. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_druid.py +0 -0
  134. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_dune.py +0 -0
  135. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_exasol.py +0 -0
  136. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_fabric.py +0 -0
  137. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_hive.py +0 -0
  138. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_materialize.py +0 -0
  139. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_mysql.py +0 -0
  140. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_oracle.py +0 -0
  141. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_pipe_syntax.py +0 -0
  142. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_presto.py +0 -0
  143. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_prql.py +0 -0
  144. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_redshift.py +0 -0
  145. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_risingwave.py +0 -0
  146. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_singlestore.py +0 -0
  147. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_solr.py +0 -0
  148. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_sqlite.py +0 -0
  149. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_tableau.py +0 -0
  150. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_teradata.py +0 -0
  151. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/dialects/test_trino.py +0 -0
  152. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/jsonpath/LICENSE +0 -0
  153. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/jsonpath/cts.json +0 -0
  154. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/annotate_types.sql +0 -0
  155. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/canonicalize.sql +0 -0
  156. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
  157. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/eliminate_joins.sql +0 -0
  158. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
  159. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
  160. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
  161. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/normalize.sql +0 -0
  162. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
  163. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
  164. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/optimizer.sql +0 -0
  165. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
  166. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
  167. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/pushdown_projections.sql +0 -0
  168. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/qualify_columns.sql +0 -0
  169. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
  170. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
  171. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
  172. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
  173. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
  174. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
  175. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
  176. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
  177. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
  178. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
  179. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
  180. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
  181. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
  182. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
  183. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
  184. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
  185. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
  186. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
  187. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
  188. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
  189. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
  190. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
  191. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
  192. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
  193. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
  194. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
  195. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
  196. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
  197. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
  198. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
  199. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
  200. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
  201. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
  202. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
  203. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
  204. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
  205. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
  206. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
  207. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
  208. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/partial.sql +0 -0
  209. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/fixtures/pretty.sql +0 -0
  210. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/gen_fixtures.py +0 -0
  211. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/helpers.py +0 -0
  212. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/test_build.py +0 -0
  213. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/test_dialect_imports.py +0 -0
  214. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/test_diff.py +0 -0
  215. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/test_docs.py +0 -0
  216. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/test_executor.py +0 -0
  217. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/test_expressions.py +0 -0
  218. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/test_generator.py +0 -0
  219. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/test_helper.py +0 -0
  220. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/test_jsonpath.py +0 -0
  221. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/test_optimizer.py +0 -0
  222. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/test_parser.py +0 -0
  223. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/test_schema.py +0 -0
  224. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/test_serde.py +0 -0
  225. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/test_time.py +0 -0
  226. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/test_tokens.py +0 -0
  227. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/test_transforms.py +0 -0
  228. {sqlglot-27.26.0 → sqlglot-27.28.0}/tests/test_transpile.py +0 -0
@@ -1,6 +1,70 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## [v27.27.0] - 2025-10-13
5
+ ### :boom: BREAKING CHANGES
6
+ - due to [`c67276d`](https://github.com/tobymao/sqlglot/commit/c67276d5be970252e14d1817d8498fc9985222d9) - Annotate type for snowflake RADIANS function. *(PR [#6064](https://github.com/tobymao/sqlglot/pull/6064) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
7
+
8
+ Annotate type for snowflake RADIANS function. (#6064)
9
+
10
+
11
+ ### :sparkles: New Features
12
+ - [`c67276d`](https://github.com/tobymao/sqlglot/commit/c67276d5be970252e14d1817d8498fc9985222d9) - **optimizer**: Annotate type for snowflake RADIANS function. *(PR [#6064](https://github.com/tobymao/sqlglot/pull/6064) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
13
+
14
+ ### :wrench: Chores
15
+ - [`dab2a3f`](https://github.com/tobymao/sqlglot/commit/dab2a3fbdb8a523f05319eb34a1fd34534272206) - bump sqlglotrs version to 0.7.3 *(commit by [@georgesittas](https://github.com/georgesittas))*
16
+
17
+
18
+ ## [v27.26.0] - 2025-10-10
19
+ ### :boom: BREAKING CHANGES
20
+ - due to [`9060f60`](https://github.com/tobymao/sqlglot/commit/9060f603818db863b7570a2c3c50c3eb88155e76) - Annotate type for snowflake ATAN2 function. *(PR [#6060](https://github.com/tobymao/sqlglot/pull/6060) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
21
+
22
+ Annotate type for snowflake ATAN2 function. (#6060)
23
+
24
+ - due to [`b3eb2e4`](https://github.com/tobymao/sqlglot/commit/b3eb2e4ca6177ee61b27675e8ec8b4815587df31) - annotate type for Snowflake SINH function *(PR [#6052](https://github.com/tobymao/sqlglot/pull/6052) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*:
25
+
26
+ annotate type for Snowflake SINH function (#6052)
27
+
28
+ - due to [`157d2fa`](https://github.com/tobymao/sqlglot/commit/157d2fa06ab110ebc760aa7567d7fda801a5ced9) - annotate type for Snowflake CEIL function *(PR [#6051](https://github.com/tobymao/sqlglot/pull/6051) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*:
29
+
30
+ annotate type for Snowflake CEIL function (#6051)
31
+
32
+ - due to [`e7833de`](https://github.com/tobymao/sqlglot/commit/e7833de9744a4aa69d244285e7f6f7281af178ba) - support DELETE with USING and multiple VALUES *(PR [#6072](https://github.com/tobymao/sqlglot/pull/6072) by [@geooo109](https://github.com/geooo109))*:
33
+
34
+ support DELETE with USING and multiple VALUES (#6072)
35
+
36
+ - due to [`354140d`](https://github.com/tobymao/sqlglot/commit/354140d0a279f317439bdb247e1ab9578f9a035d) - Annotate type for snowflake TANH and ATAN functions *(PR [#6069](https://github.com/tobymao/sqlglot/pull/6069) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
37
+
38
+ Annotate type for snowflake TANH and ATAN functions (#6069)
39
+
40
+
41
+ ### :sparkles: New Features
42
+ - [`9060f60`](https://github.com/tobymao/sqlglot/commit/9060f603818db863b7570a2c3c50c3eb88155e76) - **optimizer**: Annotate type for snowflake ATAN2 function. *(PR [#6060](https://github.com/tobymao/sqlglot/pull/6060) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
43
+ - [`b3eb2e4`](https://github.com/tobymao/sqlglot/commit/b3eb2e4ca6177ee61b27675e8ec8b4815587df31) - **optimizer**: annotate type for Snowflake SINH function *(PR [#6052](https://github.com/tobymao/sqlglot/pull/6052) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
44
+ - [`440b960`](https://github.com/tobymao/sqlglot/commit/440b960529801674fa23708212485fda95749699) - **duckdb**: support `USING KEY (...)` in recursive DuckDB CTEs *(PR [#6068](https://github.com/tobymao/sqlglot/pull/6068) by [@georgesittas](https://github.com/georgesittas))*
45
+ - :arrow_lower_right: *addresses issue [#6066](https://github.com/tobymao/sqlglot/issues/6066) opened by [@denis-komarov](https://github.com/denis-komarov)*
46
+ - [`157d2fa`](https://github.com/tobymao/sqlglot/commit/157d2fa06ab110ebc760aa7567d7fda801a5ced9) - **optimizer**: annotate type for Snowflake CEIL function *(PR [#6051](https://github.com/tobymao/sqlglot/pull/6051) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
47
+ - [`eb6d6e7`](https://github.com/tobymao/sqlglot/commit/eb6d6e7ccde37456ab56ad976e7d95cea23c14e3) - **duckdb**: support `DEFAULT VALUES` clause in `INSERT` DML *(PR [#6067](https://github.com/tobymao/sqlglot/pull/6067) by [@georgesittas](https://github.com/georgesittas))*
48
+ - :arrow_lower_right: *addresses issue [#6065](https://github.com/tobymao/sqlglot/issues/6065) opened by [@denis-komarov](https://github.com/denis-komarov)*
49
+ - [`354140d`](https://github.com/tobymao/sqlglot/commit/354140d0a279f317439bdb247e1ab9578f9a035d) - **optimizer**: Annotate type for snowflake TANH and ATAN functions *(PR [#6069](https://github.com/tobymao/sqlglot/pull/6069) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
50
+ - [`c94e3e0`](https://github.com/tobymao/sqlglot/commit/c94e3e0e4e20bd76d4cf630123d2c05a0e3044c3) - add ColumnDef expression parser *(PR [#6075](https://github.com/tobymao/sqlglot/pull/6075) by [@geooo109](https://github.com/geooo109))*
51
+
52
+ ### :bug: Bug Fixes
53
+ - [`2c7cc29`](https://github.com/tobymao/sqlglot/commit/2c7cc29a329dcbaaa90a6f857d2383d2967ea6cc) - **duckdb**: Transform exp.HexString to BLOB in hex notation *(PR [#6045](https://github.com/tobymao/sqlglot/pull/6045) by [@VaggelisD](https://github.com/VaggelisD))*
54
+ - :arrow_lower_right: *fixes issue [#6035](https://github.com/tobymao/sqlglot/issues/6035) opened by [@kyle-cheung](https://github.com/kyle-cheung)*
55
+ - [`e7833de`](https://github.com/tobymao/sqlglot/commit/e7833de9744a4aa69d244285e7f6f7281af178ba) - **parser**: support DELETE with USING and multiple VALUES *(PR [#6072](https://github.com/tobymao/sqlglot/pull/6072) by [@geooo109](https://github.com/geooo109))*
56
+ - :arrow_lower_right: *fixes issue [#6070](https://github.com/tobymao/sqlglot/issues/6070) opened by [@denis-komarov](https://github.com/denis-komarov)*
57
+
58
+ ### :recycle: Refactors
59
+ - [`2c9d15c`](https://github.com/tobymao/sqlglot/commit/2c9d15c92da25c8456b2463c69aa56c8ec47c453) - replace direct arg manipulation *(PR [#6073](https://github.com/tobymao/sqlglot/pull/6073) by [@geooo109](https://github.com/geooo109))*
60
+
61
+ ### :wrench: Chores
62
+ - [`75b8d16`](https://github.com/tobymao/sqlglot/commit/75b8d16e41b677ea7e150c89d713795073aae6e3) - remove docs from main branch *(PR [#6057](https://github.com/tobymao/sqlglot/pull/6057) by [@georgesittas](https://github.com/georgesittas))*
63
+ - [`cfa2493`](https://github.com/tobymao/sqlglot/commit/cfa249328eef31ab0e0688dcc03521da3343ce47) - **optimizer**: Annotate type for snowflake SQUARE function *(PR [#6059](https://github.com/tobymao/sqlglot/pull/6059) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
64
+ - [`e26c394`](https://github.com/tobymao/sqlglot/commit/e26c3949beb7f73020fcd099237dbe31a4db8d84) - **optimizer**: Annotate type for snowflake POW function *(PR [#6058](https://github.com/tobymao/sqlglot/pull/6058) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
65
+ - [`7d303ad`](https://github.com/tobymao/sqlglot/commit/7d303adc5efe9d51eb62aeab80bfa4f844e1911d) - include Python 3.14 in the testing matrix *(PR [#6074](https://github.com/tobymao/sqlglot/pull/6074) by [@georgesittas](https://github.com/georgesittas))*
66
+
67
+
4
68
  ## [v27.25.0] - 2025-10-09
5
69
  ### :boom: BREAKING CHANGES
6
70
  - due to [`6f31b86`](https://github.com/tobymao/sqlglot/commit/6f31b86599258afe156aa3d9ccc42389cac37021) - Annotate type for snowflake FLOOR function *(PR [#6030](https://github.com/tobymao/sqlglot/pull/6030) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
@@ -7819,3 +7883,5 @@ Changelog
7819
7883
  [v27.22.1]: https://github.com/tobymao/sqlglot/compare/v27.22.0...v27.22.1
7820
7884
  [v27.22.2]: https://github.com/tobymao/sqlglot/compare/v27.22.1...v27.22.2
7821
7885
  [v27.25.0]: https://github.com/tobymao/sqlglot/compare/v27.24.2...v27.25.0
7886
+ [v27.26.0]: https://github.com/tobymao/sqlglot/compare/v27.25.2...v27.26.0
7887
+ [v27.27.0]: https://github.com/tobymao/sqlglot/compare/v27.26.0...v27.27.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlglot
3
- Version: 27.26.0
3
+ Version: 27.28.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
@@ -33,7 +33,7 @@ Requires-Dist: typing_extensions; extra == "dev"
33
33
  Requires-Dist: maturin<2.0,>=1.4; extra == "dev"
34
34
  Requires-Dist: pyperf; extra == "dev"
35
35
  Provides-Extra: rs
36
- Requires-Dist: sqlglotrs==0.7.2; extra == "rs"
36
+ Requires-Dist: sqlglotrs==0.7.3; extra == "rs"
37
37
  Dynamic: license-file
38
38
  Dynamic: provides-extra
39
39
 
@@ -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.26.0'
32
- __version_tuple__ = version_tuple = (27, 26, 0)
31
+ __version__ = version = '27.28.0'
32
+ __version_tuple__ = version_tuple = (27, 28, 0)
33
33
 
34
- __commit_id__ = commit_id = 'gc94e3e0e4'
34
+ __commit_id__ = commit_id = 'g72e43e3ea'
@@ -496,6 +496,115 @@ class BigQuery(Dialect):
496
496
  # BigQuery maps Type.TIMESTAMP to DATETIME, so we need to amend the inferred types
497
497
  TYPE_TO_EXPRESSIONS = {
498
498
  **Dialect.TYPE_TO_EXPRESSIONS,
499
+ exp.DataType.Type.BIGINT: {
500
+ *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.BIGINT],
501
+ exp.Ascii,
502
+ exp.BitwiseAndAgg,
503
+ exp.BitwiseOrAgg,
504
+ exp.BitwiseXorAgg,
505
+ exp.BitwiseCount,
506
+ exp.ByteLength,
507
+ exp.DenseRank,
508
+ exp.FarmFingerprint,
509
+ exp.Grouping,
510
+ exp.LaxInt64,
511
+ exp.Ntile,
512
+ exp.Rank,
513
+ exp.RangeBucket,
514
+ exp.RegexpInstr,
515
+ exp.RowNumber,
516
+ exp.Unicode,
517
+ },
518
+ exp.DataType.Type.BINARY: {
519
+ *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.BINARY],
520
+ exp.ByteString,
521
+ exp.CodePointsToBytes,
522
+ exp.MD5Digest,
523
+ exp.SHA,
524
+ exp.SHA2,
525
+ exp.Unhex,
526
+ },
527
+ exp.DataType.Type.BOOLEAN: {
528
+ *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.BOOLEAN],
529
+ exp.IsInf,
530
+ exp.IsNan,
531
+ exp.JSONBool,
532
+ exp.LaxBool,
533
+ },
534
+ exp.DataType.Type.DATE: {
535
+ *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.DATE],
536
+ exp.DateFromUnixDate,
537
+ },
538
+ exp.DataType.Type.DATETIME: {
539
+ *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.DATETIME],
540
+ exp.ParseDatetime,
541
+ exp.TimestampFromParts,
542
+ },
543
+ exp.DataType.Type.DECIMAL: {
544
+ exp.ParseNumeric,
545
+ },
546
+ exp.DataType.Type.BIGDECIMAL: {
547
+ exp.ParseBignumeric,
548
+ },
549
+ exp.DataType.Type.DOUBLE: {
550
+ *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.DOUBLE],
551
+ exp.Acos,
552
+ exp.Acosh,
553
+ exp.Asin,
554
+ exp.Asinh,
555
+ exp.Atan,
556
+ exp.Atanh,
557
+ exp.Atan2,
558
+ exp.Cbrt,
559
+ exp.Corr,
560
+ exp.Cot,
561
+ exp.CosineDistance,
562
+ exp.Coth,
563
+ exp.CovarPop,
564
+ exp.CovarSamp,
565
+ exp.Csc,
566
+ exp.Csch,
567
+ exp.CumeDist,
568
+ exp.EuclideanDistance,
569
+ exp.Float64,
570
+ exp.LaxFloat64,
571
+ exp.PercentRank,
572
+ exp.Rand,
573
+ exp.Sec,
574
+ exp.Sech,
575
+ exp.Sin,
576
+ exp.Sinh,
577
+ },
578
+ exp.DataType.Type.JSON: {
579
+ *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.JSON],
580
+ exp.JSONArray,
581
+ exp.JSONArrayAppend,
582
+ exp.JSONArrayInsert,
583
+ exp.JSONObject,
584
+ exp.JSONRemove,
585
+ exp.JSONSet,
586
+ exp.JSONStripNulls,
587
+ },
588
+ exp.DataType.Type.TIME: {
589
+ *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.TIME],
590
+ exp.ParseTime,
591
+ exp.TimeFromParts,
592
+ exp.TimeTrunc,
593
+ exp.TsOrDsToTime,
594
+ },
595
+ exp.DataType.Type.VARCHAR: {
596
+ *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.VARCHAR],
597
+ exp.CodePointsToString,
598
+ exp.Format,
599
+ exp.JSONExtractScalar,
600
+ exp.JSONType,
601
+ exp.LaxString,
602
+ exp.LowerHex,
603
+ exp.Normalize,
604
+ exp.SafeConvertBytesToString,
605
+ exp.Soundex,
606
+ exp.Uuid,
607
+ },
499
608
  exp.DataType.Type.TIMESTAMPTZ: Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.TIMESTAMP],
500
609
  }
501
610
  TYPE_TO_EXPRESSIONS.pop(exp.DataType.Type.TIMESTAMP)
@@ -545,64 +654,15 @@ class BigQuery(Dialect):
545
654
  exp.Upper,
546
655
  )
547
656
  },
548
- exp.Acos: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
549
- exp.Acosh: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
550
- exp.Asin: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
551
- exp.Asinh: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
552
- exp.Atan: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
553
- exp.Atanh: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
554
- exp.Atan2: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
555
657
  exp.ApproxTopSum: lambda self, e: _annotate_by_args_approx_top(self, e),
556
658
  exp.ApproxTopK: lambda self, e: _annotate_by_args_approx_top(self, e),
557
659
  exp.ApproxQuantiles: lambda self, e: self._annotate_by_args(e, "this", array=True),
558
660
  exp.Array: _annotate_array,
559
661
  exp.ArrayConcat: lambda self, e: self._annotate_by_args(e, "this", "expressions"),
560
- exp.Ascii: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
561
- exp.BitwiseAndAgg: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
562
- exp.BitwiseOrAgg: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
563
- exp.BitwiseXorAgg: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
564
- exp.BitwiseCountAgg: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
565
- exp.ByteLength: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
566
- exp.ByteString: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
567
- exp.Cbrt: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
568
- exp.CodePointsToBytes: lambda self, e: self._annotate_with_type(
569
- e, exp.DataType.Type.BINARY
570
- ),
571
- exp.CodePointsToString: lambda self, e: self._annotate_with_type(
572
- e, exp.DataType.Type.VARCHAR
573
- ),
574
662
  exp.Concat: _annotate_concat,
575
- exp.Corr: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
576
- exp.Cot: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
577
- exp.CosineDistance: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
578
- exp.Coth: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
579
- exp.CovarPop: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
580
- exp.CovarSamp: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
581
- exp.Csc: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
582
- exp.Csch: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
583
- exp.CumeDist: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
584
- exp.DateFromUnixDate: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DATE),
585
- exp.DenseRank: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
586
- exp.EuclideanDistance: lambda self, e: self._annotate_with_type(
587
- e, exp.DataType.Type.DOUBLE
588
- ),
589
- exp.FarmFingerprint: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
590
- exp.Unhex: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
591
- exp.Float64: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
592
- exp.Format: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
593
663
  exp.GenerateTimestampArray: lambda self, e: self._annotate_with_type(
594
664
  e, exp.DataType.build("ARRAY<TIMESTAMP>", dialect="bigquery")
595
665
  ),
596
- exp.Grouping: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
597
- exp.IsInf: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BOOLEAN),
598
- exp.IsNan: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BOOLEAN),
599
- exp.JSONArray: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
600
- exp.JSONArrayAppend: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
601
- exp.JSONArrayInsert: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
602
- exp.JSONBool: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BOOLEAN),
603
- exp.JSONExtractScalar: lambda self, e: self._annotate_with_type(
604
- e, exp.DataType.Type.VARCHAR
605
- ),
606
666
  exp.JSONExtractArray: lambda self, e: self._annotate_by_args(e, "this", array=True),
607
667
  exp.JSONFormat: lambda self, e: self._annotate_with_type(
608
668
  e, exp.DataType.Type.JSON if e.args.get("to_json") else exp.DataType.Type.VARCHAR
@@ -610,62 +670,19 @@ class BigQuery(Dialect):
610
670
  exp.JSONKeysAtDepth: lambda self, e: self._annotate_with_type(
611
671
  e, exp.DataType.build("ARRAY<VARCHAR>", dialect="bigquery")
612
672
  ),
613
- exp.JSONObject: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
614
- exp.JSONRemove: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
615
- exp.JSONSet: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
616
- exp.JSONStripNulls: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
617
- exp.JSONType: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
618
673
  exp.JSONValueArray: lambda self, e: self._annotate_with_type(
619
674
  e, exp.DataType.build("ARRAY<VARCHAR>", dialect="bigquery")
620
675
  ),
621
676
  exp.Lag: lambda self, e: self._annotate_by_args(e, "this", "default"),
622
- exp.LowerHex: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
623
- exp.LaxBool: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BOOLEAN),
624
- exp.LaxFloat64: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
625
- exp.LaxInt64: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
626
- exp.LaxString: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
627
- exp.MD5Digest: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
628
- exp.Normalize: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
629
- exp.Ntile: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
630
- exp.ParseTime: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.TIME),
631
- exp.ParseDatetime: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DATETIME),
632
- exp.ParseBignumeric: lambda self, e: self._annotate_with_type(
633
- e, exp.DataType.Type.BIGDECIMAL
634
- ),
635
- exp.ParseNumeric: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DECIMAL),
636
677
  exp.PercentileCont: lambda self, e: _annotate_by_args_with_coerce(self, e),
637
- exp.PercentRank: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
638
- exp.Rank: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
639
- exp.RangeBucket: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
640
678
  exp.RegexpExtractAll: lambda self, e: self._annotate_by_args(e, "this", array=True),
641
- exp.RegexpInstr: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
642
- exp.RowNumber: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
643
- exp.Rand: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
644
- exp.SafeConvertBytesToString: lambda self, e: self._annotate_with_type(
645
- e, exp.DataType.Type.VARCHAR
646
- ),
647
679
  exp.SafeAdd: lambda self, e: _annotate_by_args_with_coerce(self, e),
648
680
  exp.SafeMultiply: lambda self, e: _annotate_by_args_with_coerce(self, e),
649
681
  exp.SafeSubtract: lambda self, e: _annotate_by_args_with_coerce(self, e),
650
- exp.Sec: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
651
- exp.Sech: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
652
- exp.Soundex: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
653
- exp.SHA: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
654
- exp.SHA2: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
655
- exp.Sin: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
656
- exp.Sinh: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
657
682
  exp.Split: lambda self, e: self._annotate_by_args(e, "this", array=True),
658
- exp.TimestampFromParts: lambda self, e: self._annotate_with_type(
659
- e, exp.DataType.Type.DATETIME
660
- ),
661
- exp.TimeFromParts: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.TIME),
662
- exp.TimeTrunc: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.TIME),
663
683
  exp.ToCodePoints: lambda self, e: self._annotate_with_type(
664
684
  e, exp.DataType.build("ARRAY<BIGINT>", dialect="bigquery")
665
685
  ),
666
- exp.TsOrDsToTime: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.TIME),
667
- exp.Unicode: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
668
- exp.Uuid: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
669
686
  }
670
687
 
671
688
  def normalize_identifier(self, expression: E) -> E:
@@ -786,7 +803,7 @@ class BigQuery(Dialect):
786
803
  "BIT_AND": exp.BitwiseAndAgg.from_arg_list,
787
804
  "BIT_OR": exp.BitwiseOrAgg.from_arg_list,
788
805
  "BIT_XOR": exp.BitwiseXorAgg.from_arg_list,
789
- "BIT_COUNT": exp.BitwiseCountAgg.from_arg_list,
806
+ "BIT_COUNT": exp.BitwiseCount.from_arg_list,
790
807
  "BOOL": exp.JSONBool.from_arg_list,
791
808
  "CONTAINS_SUBSTR": _build_contains_substring,
792
809
  "DATE": _build_date,
@@ -1302,7 +1319,7 @@ class BigQuery(Dialect):
1302
1319
  exp.BitwiseAndAgg: rename_func("BIT_AND"),
1303
1320
  exp.BitwiseOrAgg: rename_func("BIT_OR"),
1304
1321
  exp.BitwiseXorAgg: rename_func("BIT_XOR"),
1305
- exp.BitwiseCountAgg: rename_func("BIT_COUNT"),
1322
+ exp.BitwiseCount: rename_func("BIT_COUNT"),
1306
1323
  exp.ByteLength: rename_func("BYTE_LENGTH"),
1307
1324
  exp.Cast: transforms.preprocess([transforms.remove_precision_parameterized_types]),
1308
1325
  exp.CollateProperty: lambda self, e: (
@@ -1418,9 +1418,12 @@ class ClickHouse(Dialect):
1418
1418
  return in_sql
1419
1419
 
1420
1420
  def not_sql(self, expression: exp.Not) -> str:
1421
- if isinstance(expression.this, exp.In) and expression.this.args.get("is_global"):
1422
- # let `GLOBAL IN` child interpose `NOT`
1423
- return self.sql(expression, "this")
1421
+ if isinstance(expression.this, exp.In):
1422
+ if expression.this.args.get("is_global"):
1423
+ # let `GLOBAL IN` child interpose `NOT`
1424
+ return self.sql(expression, "this")
1425
+
1426
+ expression.set("this", exp.paren(expression.this, copy=False))
1424
1427
 
1425
1428
  return super().not_sql(expression)
1426
1429
 
@@ -724,6 +724,7 @@ class Dialect(metaclass=_Dialect):
724
724
  exp.Pi,
725
725
  exp.Pow,
726
726
  exp.Quantile,
727
+ exp.Radians,
727
728
  exp.Round,
728
729
  exp.SafeDivide,
729
730
  exp.Sqrt,
@@ -1,5 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import re
3
4
  import typing as t
4
5
 
5
6
  from sqlglot import exp, generator, parser, tokens, transforms
@@ -44,6 +45,10 @@ from sqlglot.helper import seq_get
44
45
  from sqlglot.tokens import TokenType
45
46
  from sqlglot.parser import binary_range_parser
46
47
 
48
+ # Regex to detect time zones in timestamps of the form [+|-]TT[:tt]
49
+ # The pattern matches timezone offsets that appear after the time portion
50
+ TIMEZONE_PATTERN = re.compile(r":\d{2}.*?[+\-]\d{2}(?::\d{2})?")
51
+
47
52
 
48
53
  # BigQuery -> DuckDB conversion for the DATE function
49
54
  def _date_sql(self: DuckDB.Generator, expression: exp.Date) -> str:
@@ -211,7 +216,18 @@ def _arrow_json_extract_sql(self: DuckDB.Generator, expression: JSON_EXTRACT_TYP
211
216
  def _implicit_datetime_cast(
212
217
  arg: t.Optional[exp.Expression], type: exp.DataType.Type = exp.DataType.Type.DATE
213
218
  ) -> t.Optional[exp.Expression]:
214
- return exp.cast(arg, type) if isinstance(arg, exp.Literal) else arg
219
+ if isinstance(arg, exp.Literal) and arg.is_string:
220
+ ts = arg.name
221
+ if type == exp.DataType.Type.DATE and ":" in ts:
222
+ type = (
223
+ exp.DataType.Type.TIMESTAMPTZ
224
+ if TIMEZONE_PATTERN.search(ts)
225
+ else exp.DataType.Type.TIMESTAMP
226
+ )
227
+
228
+ arg = exp.cast(arg, type)
229
+
230
+ return arg
215
231
 
216
232
 
217
233
  def _date_diff_sql(self: DuckDB.Generator, expression: exp.DateDiff) -> str:
@@ -694,6 +710,7 @@ class DuckDB(Dialect):
694
710
  exp.DateDiff: _date_diff_sql,
695
711
  exp.DateStrToDate: datestrtodate_sql,
696
712
  exp.Datetime: no_datetime_sql,
713
+ exp.DatetimeDiff: _date_diff_sql,
697
714
  exp.DatetimeSub: date_delta_to_binary_interval_op(),
698
715
  exp.DatetimeAdd: date_delta_to_binary_interval_op(),
699
716
  exp.DateToDi: lambda self,
@@ -758,6 +775,7 @@ class DuckDB(Dialect):
758
775
  exp.Struct: _struct_sql,
759
776
  exp.Transform: rename_func("LIST_TRANSFORM"),
760
777
  exp.TimeAdd: date_delta_to_binary_interval_op(),
778
+ exp.TimeSub: date_delta_to_binary_interval_op(),
761
779
  exp.Time: no_time_sql,
762
780
  exp.TimeDiff: _timediff_sql,
763
781
  exp.Timestamp: no_timestamp_sql,
@@ -781,6 +799,7 @@ class DuckDB(Dialect):
781
799
  exp.cast(e.expression, exp.DataType.Type.TIMESTAMP),
782
800
  exp.cast(e.this, exp.DataType.Type.TIMESTAMP),
783
801
  ),
802
+ exp.UnixMicros: rename_func("EPOCH_US"),
784
803
  exp.UnixToStr: lambda self, e: self.func(
785
804
  "STRFTIME", self.func("TO_TIMESTAMP", e.this), self.format_time(e)
786
805
  ),
@@ -325,7 +325,7 @@ class MySQL(Dialect):
325
325
  "BIT_AND": exp.BitwiseAndAgg.from_arg_list,
326
326
  "BIT_OR": exp.BitwiseOrAgg.from_arg_list,
327
327
  "BIT_XOR": exp.BitwiseXorAgg.from_arg_list,
328
- "BIT_COUNT": exp.BitwiseCountAgg.from_arg_list,
328
+ "BIT_COUNT": exp.BitwiseCount.from_arg_list,
329
329
  "CONVERT_TZ": lambda args: exp.ConvertTimezone(
330
330
  source_tz=seq_get(args, 1), target_tz=seq_get(args, 2), timestamp=seq_get(args, 0)
331
331
  ),
@@ -755,7 +755,7 @@ class MySQL(Dialect):
755
755
  exp.BitwiseAndAgg: rename_func("BIT_AND"),
756
756
  exp.BitwiseOrAgg: rename_func("BIT_OR"),
757
757
  exp.BitwiseXorAgg: rename_func("BIT_XOR"),
758
- exp.BitwiseCountAgg: rename_func("BIT_COUNT"),
758
+ exp.BitwiseCount: rename_func("BIT_COUNT"),
759
759
  exp.CurrentDate: no_paren_current_date_sql,
760
760
  exp.DateDiff: _remove_ts_or_ds_to_date(
761
761
  lambda self, e: self.func("DATEDIFF", e.this, e.expression), ("this", "expression")
@@ -23,6 +23,7 @@ from sqlglot.dialects.dialect import (
23
23
  rename_func,
24
24
  timestamptrunc_sql,
25
25
  timestrtotime_sql,
26
+ unit_to_str,
26
27
  var_map_sql,
27
28
  map_date_part,
28
29
  no_timestamp_sql,
@@ -41,6 +42,9 @@ if t.TYPE_CHECKING:
41
42
  from sqlglot._typing import E, B
42
43
 
43
44
 
45
+ DATE_PARTS = ["YEAR", "QUARTER", "MONTH", "WEEK", "DAY"]
46
+
47
+
44
48
  def _build_strtok(args: t.List) -> exp.SplitPart:
45
49
  # Add default delimiter (space) if missing - per Snowflake docs
46
50
  if len(args) == 1:
@@ -547,6 +551,19 @@ def _annotate_reverse(self: TypeAnnotator, expression: exp.Reverse) -> exp.Rever
547
551
  return expression
548
552
 
549
553
 
554
+ def _annotate_date_or_time_add(self: TypeAnnotator, expression: E) -> E:
555
+ self._annotate_args(expression)
556
+
557
+ if (
558
+ expression.this.is_type(exp.DataType.Type.DATE)
559
+ and expression.text("unit").upper() not in DATE_PARTS
560
+ ):
561
+ self._set_type(expression, exp.DataType.Type.TIMESTAMPNTZ)
562
+ else:
563
+ self._annotate_by_args(expression, "this")
564
+ return expression
565
+
566
+
550
567
  class Snowflake(Dialect):
551
568
  # https://docs.snowflake.com/en/sql-reference/identifiers-syntax
552
569
  NORMALIZATION_STRATEGY = NormalizationStrategy.UPPERCASE
@@ -570,6 +587,7 @@ class Snowflake(Dialect):
570
587
  exp.Cot,
571
588
  exp.Degrees,
572
589
  exp.Exp,
590
+ exp.MonthsBetween,
573
591
  exp.Sin,
574
592
  exp.Sinh,
575
593
  exp.Tan,
@@ -588,10 +606,14 @@ class Snowflake(Dialect):
588
606
  exp.Length,
589
607
  exp.RtrimmedLength,
590
608
  exp.BitLength,
609
+ exp.Hour,
591
610
  exp.Levenshtein,
592
611
  exp.JarowinklerSimilarity,
612
+ exp.Minute,
613
+ exp.Second,
593
614
  exp.StrPosition,
594
615
  exp.Unicode,
616
+ exp.WidthBucket,
595
617
  },
596
618
  exp.DataType.Type.VARCHAR: {
597
619
  *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.VARCHAR],
@@ -610,6 +632,7 @@ class Snowflake(Dialect):
610
632
  exp.TryHexDecodeString,
611
633
  exp.HexEncode,
612
634
  exp.Initcap,
635
+ exp.Monthname,
613
636
  exp.RegexpExtract,
614
637
  exp.RegexpReplace,
615
638
  exp.Repeat,
@@ -640,6 +663,7 @@ class Snowflake(Dialect):
640
663
  exp.Factorial,
641
664
  exp.MD5NumberLower64,
642
665
  exp.MD5NumberUpper64,
666
+ exp.Rand,
643
667
  },
644
668
  exp.DataType.Type.ARRAY: {
645
669
  exp.Split,
@@ -655,8 +679,18 @@ class Snowflake(Dialect):
655
679
  },
656
680
  exp.DataType.Type.BOOLEAN: {
657
681
  *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.BOOLEAN],
682
+ exp.Boolnot,
658
683
  exp.Search,
659
684
  },
685
+ exp.DataType.Type.DATE: {
686
+ *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.DATE],
687
+ exp.NextDay,
688
+ exp.PreviousDay,
689
+ },
690
+ exp.DataType.Type.TIME: {
691
+ *Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.TIME],
692
+ exp.TimeFromParts,
693
+ },
660
694
  }
661
695
 
662
696
  ANNOTATORS = {
@@ -669,6 +703,7 @@ class Snowflake(Dialect):
669
703
  **{
670
704
  expr_type: lambda self, e: self._annotate_by_args(e, "this")
671
705
  for expr_type in (
706
+ exp.AddMonths,
672
707
  exp.Floor,
673
708
  exp.Left,
674
709
  exp.Pad,
@@ -677,6 +712,9 @@ class Snowflake(Dialect):
677
712
  exp.Substring,
678
713
  exp.Round,
679
714
  exp.Ceil,
715
+ exp.DateTrunc,
716
+ exp.TimeSlice,
717
+ exp.TimestampTrunc,
680
718
  )
681
719
  },
682
720
  **{
@@ -689,7 +727,15 @@ class Snowflake(Dialect):
689
727
  )
690
728
  },
691
729
  exp.ConcatWs: lambda self, e: self._annotate_by_args(e, "expressions"),
730
+ exp.ConvertTimezone: lambda self, e: self._annotate_with_type(
731
+ e,
732
+ exp.DataType.Type.TIMESTAMPNTZ
733
+ if e.args.get("source_tz")
734
+ else exp.DataType.Type.TIMESTAMPTZ,
735
+ ),
736
+ exp.DateAdd: _annotate_date_or_time_add,
692
737
  exp.Reverse: _annotate_reverse,
738
+ exp.TimeAdd: _annotate_date_or_time_add,
693
739
  }
694
740
 
695
741
  TIME_MAPPING = {
@@ -1078,8 +1124,11 @@ class Snowflake(Dialect):
1078
1124
  if not this:
1079
1125
  return None
1080
1126
 
1081
- self._match(TokenType.COMMA)
1082
- expression = self._parse_bitwise()
1127
+ # Handle both syntaxes: DATE_PART(part, expr) and DATE_PART(part FROM expr)
1128
+ expression = (
1129
+ self._match_set((TokenType.FROM, TokenType.COMMA)) and self._parse_bitwise()
1130
+ )
1131
+
1083
1132
  this = map_date_part(this)
1084
1133
  name = this.name.upper()
1085
1134
 
@@ -1545,6 +1594,13 @@ class Snowflake(Dialect):
1545
1594
  exp.Stuff: rename_func("INSERT"),
1546
1595
  exp.StPoint: rename_func("ST_MAKEPOINT"),
1547
1596
  exp.TimeAdd: date_delta_sql("TIMEADD"),
1597
+ exp.TimeSlice: lambda self, e: self.func(
1598
+ "TIME_SLICE",
1599
+ e.this,
1600
+ e.expression,
1601
+ unit_to_str(e),
1602
+ e.args.get("kind"),
1603
+ ),
1548
1604
  exp.Timestamp: no_timestamp_sql,
1549
1605
  exp.TimestampAdd: date_delta_sql("TIMESTAMPADD"),
1550
1606
  exp.TimestampDiff: lambda self, e: self.func(
@@ -128,7 +128,7 @@ class Spark(Spark2):
128
128
  "BIT_AND": exp.BitwiseAndAgg.from_arg_list,
129
129
  "BIT_OR": exp.BitwiseOrAgg.from_arg_list,
130
130
  "BIT_XOR": exp.BitwiseXorAgg.from_arg_list,
131
- "BIT_COUNT": exp.BitwiseCountAgg.from_arg_list,
131
+ "BIT_COUNT": exp.BitwiseCount.from_arg_list,
132
132
  "DATE_ADD": _build_dateadd,
133
133
  "DATEADD": _build_dateadd,
134
134
  "TIMESTAMPADD": _build_dateadd,
@@ -196,7 +196,7 @@ class Spark(Spark2):
196
196
  exp.BitwiseAndAgg: rename_func("BIT_AND"),
197
197
  exp.BitwiseOrAgg: rename_func("BIT_OR"),
198
198
  exp.BitwiseXorAgg: rename_func("BIT_XOR"),
199
- exp.BitwiseCountAgg: rename_func("BIT_COUNT"),
199
+ exp.BitwiseCount: rename_func("BIT_COUNT"),
200
200
  exp.Create: preprocess(
201
201
  [
202
202
  remove_unique_constraints,
@@ -258,3 +258,11 @@ class Spark(Spark2):
258
258
  return super().placeholder_sql(expression)
259
259
 
260
260
  return f"{{{expression.name}}}"
261
+
262
+ def readparquet_sql(self, expression: exp.ReadParquet) -> str:
263
+ if len(expression.expressions) != 1:
264
+ self.unsupported("READ_PARQUET with multiple arguments is not supported")
265
+ return ""
266
+
267
+ parquet_file = expression.expressions[0]
268
+ return f"parquet.`{parquet_file.name}`"