sqlglot 30.26.0__tar.gz → 30.29.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 (340) hide show
  1. {sqlglot-30.26.0 → sqlglot-30.29.0}/CHANGELOG.md +94 -0
  2. {sqlglot-30.26.0/sqlglot.egg-info → sqlglot-30.29.0}/PKG-INFO +3 -3
  3. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/_version.py +3 -3
  4. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/bigquery.py +1 -0
  5. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/duckdb.py +1 -0
  6. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/diff.py +44 -15
  7. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/expressions/builders.py +8 -1
  8. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/expressions/core.py +4 -1
  9. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/expressions/datatypes.py +1 -0
  10. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/expressions/properties.py +5 -1
  11. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/expressions/query.py +1 -0
  12. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/expressions/temporal.py +8 -1
  13. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generator.py +11 -3
  14. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/bigquery.py +42 -0
  15. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/duckdb.py +13 -8
  16. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/oracle.py +6 -2
  17. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/snowflake.py +5 -0
  18. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/sqlite.py +29 -14
  19. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/jsonpath.py +4 -1
  20. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/eliminate_joins.py +5 -1
  21. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/helpers.py +15 -0
  22. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/merge_subqueries.py +38 -2
  23. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/pushdown_projections.py +2 -17
  24. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/unnest_subqueries.py +131 -28
  25. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parser.py +11 -1
  26. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/duckdb.py +12 -1
  27. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/oracle.py +11 -2
  28. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/snowflake.py +5 -0
  29. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/sqlite.py +33 -0
  30. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/tokenizer_core.py +1 -0
  31. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/tokens.py +1 -0
  32. {sqlglot-30.26.0 → sqlglot-30.29.0/sqlglot.egg-info}/PKG-INFO +3 -3
  33. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot.egg-info/requires.txt +2 -2
  34. sqlglot-30.29.0/sqlglot.egg-info/scm_version.json +8 -0
  35. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglotc/setup.py +5 -1
  36. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_bigquery.py +22 -0
  37. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_dialect.py +40 -0
  38. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_duckdb.py +15 -2
  39. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_oracle.py +6 -0
  40. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_postgres.py +6 -3
  41. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_redshift.py +30 -0
  42. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_snowflake.py +77 -2
  43. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_sqlite.py +140 -10
  44. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/eliminate_joins.sql +36 -0
  45. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/optimizer.sql +18 -0
  46. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/simplify.sql +2 -2
  47. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_diff.py +35 -0
  48. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_expressions.py +96 -0
  49. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_jsonpath.py +7 -0
  50. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_optimizer.py +7 -43
  51. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_parser.py +85 -1
  52. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_schema.py +25 -0
  53. sqlglot-30.26.0/sqlglot.egg-info/scm_version.json +0 -8
  54. {sqlglot-30.26.0 → sqlglot-30.29.0}/.gitignore +0 -0
  55. {sqlglot-30.26.0 → sqlglot-30.29.0}/.gitmodules +0 -0
  56. {sqlglot-30.26.0 → sqlglot-30.29.0}/.gitpod.yml +0 -0
  57. {sqlglot-30.26.0 → sqlglot-30.29.0}/.pre-commit-config.yaml +0 -0
  58. {sqlglot-30.26.0 → sqlglot-30.29.0}/AGENTS.md +0 -0
  59. {sqlglot-30.26.0 → sqlglot-30.29.0}/CLAUDE.md +0 -0
  60. {sqlglot-30.26.0 → sqlglot-30.29.0}/CONTRIBUTING.md +0 -0
  61. {sqlglot-30.26.0 → sqlglot-30.29.0}/LICENSE +0 -0
  62. {sqlglot-30.26.0 → sqlglot-30.29.0}/MANIFEST.in +0 -0
  63. {sqlglot-30.26.0 → sqlglot-30.29.0}/Makefile +0 -0
  64. {sqlglot-30.26.0 → sqlglot-30.29.0}/README.md +0 -0
  65. {sqlglot-30.26.0 → sqlglot-30.29.0}/pyproject.toml +0 -0
  66. {sqlglot-30.26.0 → sqlglot-30.29.0}/setup.cfg +0 -0
  67. {sqlglot-30.26.0 → sqlglot-30.29.0}/setup.py +0 -0
  68. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/__init__.py +0 -0
  69. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/__main__.py +0 -0
  70. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/_typing.py +0 -0
  71. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/anonymize.py +0 -0
  72. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/__init__.py +0 -0
  73. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/athena.py +0 -0
  74. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/clickhouse.py +0 -0
  75. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/databricks.py +0 -0
  76. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/dax.py +0 -0
  77. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/dialect.py +0 -0
  78. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/doris.py +0 -0
  79. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/dremio.py +0 -0
  80. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/drill.py +0 -0
  81. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/druid.py +0 -0
  82. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/dune.py +0 -0
  83. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/exasol.py +0 -0
  84. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/fabric.py +0 -0
  85. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/hive.py +0 -0
  86. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/materialize.py +0 -0
  87. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/mysql.py +0 -0
  88. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/oracle.py +0 -0
  89. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/postgres.py +0 -0
  90. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/presto.py +0 -0
  91. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/prql.py +0 -0
  92. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/redshift.py +0 -0
  93. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/risingwave.py +0 -0
  94. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/singlestore.py +0 -0
  95. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/snowflake.py +0 -0
  96. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/solr.py +0 -0
  97. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/spark.py +0 -0
  98. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/spark2.py +0 -0
  99. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/sqlite.py +0 -0
  100. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/starrocks.py +0 -0
  101. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/tableau.py +0 -0
  102. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/teradata.py +0 -0
  103. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/trino.py +0 -0
  104. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/dialects/tsql.py +0 -0
  105. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/errors.py +0 -0
  106. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/executor/__init__.py +0 -0
  107. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/executor/context.py +0 -0
  108. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/executor/env.py +0 -0
  109. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/executor/python.py +0 -0
  110. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/executor/table.py +0 -0
  111. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/expressions/__init__.py +0 -0
  112. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/expressions/aggregate.py +0 -0
  113. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/expressions/array.py +0 -0
  114. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/expressions/constraints.py +0 -0
  115. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/expressions/ddl.py +0 -0
  116. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/expressions/dml.py +0 -0
  117. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/expressions/functions.py +0 -0
  118. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/expressions/json.py +0 -0
  119. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/expressions/math.py +0 -0
  120. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/expressions/string.py +0 -0
  121. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/__init__.py +0 -0
  122. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/athena.py +0 -0
  123. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/clickhouse.py +0 -0
  124. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/databricks.py +0 -0
  125. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/dax.py +0 -0
  126. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/doris.py +0 -0
  127. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/dremio.py +0 -0
  128. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/drill.py +0 -0
  129. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/druid.py +0 -0
  130. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/dune.py +0 -0
  131. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/exasol.py +0 -0
  132. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/fabric.py +0 -0
  133. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/hive.py +0 -0
  134. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/materialize.py +0 -0
  135. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/mysql.py +0 -0
  136. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/postgres.py +0 -0
  137. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/presto.py +0 -0
  138. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/prql.py +0 -0
  139. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/python.py +0 -0
  140. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/redshift.py +0 -0
  141. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/risingwave.py +0 -0
  142. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/singlestore.py +0 -0
  143. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/solr.py +0 -0
  144. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/spark.py +0 -0
  145. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/spark2.py +0 -0
  146. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/starrocks.py +0 -0
  147. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/tableau.py +0 -0
  148. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/teradata.py +0 -0
  149. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/trino.py +0 -0
  150. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/generators/tsql.py +0 -0
  151. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/helper.py +0 -0
  152. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/lineage.py +0 -0
  153. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/__init__.py +0 -0
  154. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/annotate_types.py +0 -0
  155. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/canonicalize.py +0 -0
  156. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/canonicalize_internal_names.py +0 -0
  157. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
  158. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
  159. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
  160. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/journal.py +0 -0
  161. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/normalize.py +0 -0
  162. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
  163. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/optimize_joins.py +0 -0
  164. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/optimizer.py +0 -0
  165. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/pushdown_predicates.py +0 -0
  166. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/qualify.py +0 -0
  167. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/qualify_columns.py +0 -0
  168. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/qualify_tables.py +0 -0
  169. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/resolver.py +0 -0
  170. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/scope.py +0 -0
  171. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/optimizer/simplify.py +0 -0
  172. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/__init__.py +0 -0
  173. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/athena.py +0 -0
  174. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/base.py +0 -0
  175. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/bigquery.py +0 -0
  176. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/clickhouse.py +0 -0
  177. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/databricks.py +0 -0
  178. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/dax.py +0 -0
  179. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/doris.py +0 -0
  180. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/dremio.py +0 -0
  181. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/drill.py +0 -0
  182. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/druid.py +0 -0
  183. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/dune.py +0 -0
  184. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/exasol.py +0 -0
  185. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/fabric.py +0 -0
  186. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/hive.py +0 -0
  187. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/materialize.py +0 -0
  188. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/mysql.py +0 -0
  189. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/postgres.py +0 -0
  190. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/presto.py +0 -0
  191. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/prql.py +0 -0
  192. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/redshift.py +0 -0
  193. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/risingwave.py +0 -0
  194. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/singlestore.py +0 -0
  195. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/solr.py +0 -0
  196. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/spark.py +0 -0
  197. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/spark2.py +0 -0
  198. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/starrocks.py +0 -0
  199. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/tableau.py +0 -0
  200. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/teradata.py +0 -0
  201. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/trino.py +0 -0
  202. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/parsers/tsql.py +0 -0
  203. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/planner.py +0 -0
  204. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/py.typed +0 -0
  205. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/schema.py +0 -0
  206. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/serde.py +0 -0
  207. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/time.py +0 -0
  208. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/transforms.py +0 -0
  209. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/trie.py +0 -0
  210. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/typing/__init__.py +0 -0
  211. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/typing/bigquery.py +0 -0
  212. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/typing/clickhouse.py +0 -0
  213. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/typing/databricks.py +0 -0
  214. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/typing/duckdb.py +0 -0
  215. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/typing/hive.py +0 -0
  216. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/typing/mysql.py +0 -0
  217. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/typing/postgres.py +0 -0
  218. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/typing/presto.py +0 -0
  219. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/typing/redshift.py +0 -0
  220. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/typing/snowflake.py +0 -0
  221. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/typing/spark.py +0 -0
  222. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/typing/spark2.py +0 -0
  223. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot/typing/tsql.py +0 -0
  224. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot.egg-info/SOURCES.txt +0 -0
  225. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot.egg-info/dependency_links.txt +0 -0
  226. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot.egg-info/scm_file_list.json +0 -0
  227. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot.egg-info/top_level.txt +0 -0
  228. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglot.png +0 -0
  229. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglotc/MANIFEST.in +0 -0
  230. {sqlglot-30.26.0 → sqlglot-30.29.0}/sqlglotc/pyproject.toml +0 -0
  231. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/__init__.py +0 -0
  232. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/__init__.py +0 -0
  233. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_athena.py +0 -0
  234. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_clickhouse.py +0 -0
  235. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_databricks.py +0 -0
  236. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_dax.py +0 -0
  237. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_doris.py +0 -0
  238. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_dremio.py +0 -0
  239. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_drill.py +0 -0
  240. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_druid.py +0 -0
  241. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_dune.py +0 -0
  242. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_exasol.py +0 -0
  243. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_fabric.py +0 -0
  244. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_hive.py +0 -0
  245. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_materialize.py +0 -0
  246. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_mysql.py +0 -0
  247. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_pipe_syntax.py +0 -0
  248. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_presto.py +0 -0
  249. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_prql.py +0 -0
  250. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_risingwave.py +0 -0
  251. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_singlestore.py +0 -0
  252. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_solr.py +0 -0
  253. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_spark.py +0 -0
  254. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_starrocks.py +0 -0
  255. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_tableau.py +0 -0
  256. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_teradata.py +0 -0
  257. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_trino.py +0 -0
  258. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/dialects/test_tsql.py +0 -0
  259. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/identity.sql +0 -0
  260. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/jsonpath/LICENSE +0 -0
  261. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/jsonpath/cts.json +0 -0
  262. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/annotate_functions.sql +0 -0
  263. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/annotate_types.sql +0 -0
  264. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/canonicalize.sql +0 -0
  265. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/canonicalize_internal_names.sql +0 -0
  266. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
  267. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
  268. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
  269. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
  270. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/normalize.sql +0 -0
  271. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
  272. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
  273. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
  274. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
  275. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/pushdown_projections.sql +0 -0
  276. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/qualify_columns.sql +0 -0
  277. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
  278. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
  279. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
  280. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
  281. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
  282. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
  283. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
  284. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
  285. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
  286. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
  287. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
  288. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
  289. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
  290. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
  291. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
  292. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
  293. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
  294. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
  295. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
  296. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
  297. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
  298. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
  299. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
  300. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
  301. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
  302. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
  303. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
  304. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
  305. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
  306. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
  307. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
  308. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
  309. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
  310. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
  311. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
  312. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
  313. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
  314. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
  315. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
  316. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/optimizer/unnest_subqueries.sql +0 -0
  317. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/partial.sql +0 -0
  318. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/fixtures/pretty.sql +0 -0
  319. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/gen_fixtures.py +0 -0
  320. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/helpers.py +0 -0
  321. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/leakcheck.py +0 -0
  322. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/sqlglot/__init__.py +0 -0
  323. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_anonymize.py +0 -0
  324. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_build.py +0 -0
  325. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_dialect_entry_points.py +0 -0
  326. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_dialect_imports.py +0 -0
  327. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_docs.py +0 -0
  328. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_errors.py +0 -0
  329. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_executor.py +0 -0
  330. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_generator.py +0 -0
  331. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_helper.py +0 -0
  332. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_integration_loader.py +0 -0
  333. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_lineage.py +0 -0
  334. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_serde.py +0 -0
  335. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_sqlglotc.py +0 -0
  336. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_time.py +0 -0
  337. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_tokens.py +0 -0
  338. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_transforms.py +0 -0
  339. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_transpile.py +0 -0
  340. {sqlglot-30.26.0 → sqlglot-30.29.0}/tests/test_typing.py +0 -0
@@ -1,6 +1,98 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## [v30.27.0] - 2026-10-30
5
+ ### :boom: BREAKING CHANGES
6
+ - due to [`5b7af1e`](https://github.com/tobymao/sqlglot/commit/5b7af1e765052d256aacb7d42624aee1a076fac4) - parse ~ as a partial regex match from DuckDB 2.0 [a mix of models in Hermes Agent] *(PR [#8840](https://github.com/tobymao/sqlglot/pull/8840) by [@ryanduguid](https://github.com/ryanduguid))*:
7
+
8
+ parse ~ as a partial regex match from DuckDB 2.0 [a mix of models in Hermes Agent] (#8840)
9
+
10
+
11
+ ### :sparkles: New Features
12
+ - [`9878263`](https://github.com/tobymao/sqlglot/commit/98782638dd6dbdedebad0e6ff6edc6e69598b81e) - add REF data type for named references *(PR [#8847](https://github.com/tobymao/sqlglot/pull/8847) by [@georgesittas](https://github.com/georgesittas))*
13
+
14
+ ### :bug: Bug Fixes
15
+ - [`04f4a44`](https://github.com/tobymao/sqlglot/commit/04f4a4405b80dde33a05da0f4271a6ea2ac38938) - **parser**: allow IN as identifier *(PR [#8837](https://github.com/tobymao/sqlglot/pull/8837) by [@treysp](https://github.com/treysp))*
16
+ - [`f31f109`](https://github.com/tobymao/sqlglot/commit/f31f109daef0ca99347d36295534a0d59956059c) - **duckdb**: prevent SORT BY tokenization *(commit by [@treysp](https://github.com/treysp))*
17
+ - [`5b7af1e`](https://github.com/tobymao/sqlglot/commit/5b7af1e765052d256aacb7d42624aee1a076fac4) - **duckdb**: parse ~ as a partial regex match from DuckDB 2.0 [a mix of models in Hermes Agent] *(PR [#8840](https://github.com/tobymao/sqlglot/pull/8840) by [@ryanduguid](https://github.com/ryanduguid))*
18
+ - [`20f01c7`](https://github.com/tobymao/sqlglot/commit/20f01c7fbc0d7b80d1ef6ead063e6510026de36d) - **optimizer**: Fix merging subqueries with group by all and window functions ([#8834](https://github.com/tobymao/sqlglot/pull/8834)) [CODEX] *(commit by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
19
+ - [`52763cd`](https://github.com/tobymao/sqlglot/commit/52763cdd96d5d6d4e7d8f06213c586ebfec8c711) - **sqlite**: preserve modifiers on parenthesized queries [CODEX] *(PR [#8843](https://github.com/tobymao/sqlglot/pull/8843) by [@georgesittas](https://github.com/georgesittas))*
20
+ - :arrow_lower_right: *fixes issue [#8841](https://github.com/tobymao/sqlglot/issues/8841) opened by [@dvzadara](https://github.com/dvzadara)*
21
+ - [`da00199`](https://github.com/tobymao/sqlglot/commit/da00199fa2a33505bbb4b6c708d1ec10a0549850) - **optimizer**: skip decorrelation for subqueries evaluated after outer GROUP BY *(PR [#8836](https://github.com/tobymao/sqlglot/pull/8836) by [@treysp](https://github.com/treysp))*
22
+
23
+ ### :zap: Performance Improvements
24
+ - [`2ef935d`](https://github.com/tobymao/sqlglot/commit/2ef935d6ce02dd46e579b2edda7fce6298c8ad11) - **diff**: index the leaf matching set when scoring node pairs [CLAUDE] *(PR [#8838](https://github.com/tobymao/sqlglot/pull/8838) by [@LD-RW](https://github.com/LD-RW))*
25
+
26
+ ### :recycle: Refactors
27
+ - [`6f90b49`](https://github.com/tobymao/sqlglot/commit/6f90b498078d65515bf57cf71c94332daf282009) - **diff**: keep the edit script in a stable order *(PR [#8844](https://github.com/tobymao/sqlglot/pull/8844) by [@LD-RW](https://github.com/LD-RW))*
28
+
29
+
30
+ ## [v30.26.0] - 2026-10-29
31
+ ### :boom: BREAKING CHANGES
32
+ - due to [`e54ad9a`](https://github.com/tobymao/sqlglot/commit/e54ad9aaedeb5e9b2be615ebd5f1ff40cfb854a2) - resolve set operation types during annotation [CODEX] *(PR [#8720](https://github.com/tobymao/sqlglot/pull/8720) by [@georgesittas](https://github.com/georgesittas))*:
33
+
34
+ resolve set operation types during annotation [CODEX] (#8720)
35
+
36
+ - due to [`86abcde`](https://github.com/tobymao/sqlglot/commit/86abcde38e32ddb04ab721ab0654473d51e0a783) - respect dialect `INTERSECT` precedence in set operations *(PR [#8704](https://github.com/tobymao/sqlglot/pull/8704) by [@treysp](https://github.com/treysp))*:
37
+
38
+ respect dialect `INTERSECT` precedence in set operations (#8704)
39
+
40
+ - due to [`a20a4d9`](https://github.com/tobymao/sqlglot/commit/a20a4d9e5eb3e5cf33d69148d40c25737b32d437) - parse LOCALTIMESTAMP as CURRENT_TIMESTAMP [AGENT] *(PR [#8813](https://github.com/tobymao/sqlglot/pull/8813) by [@Tyagiquamar](https://github.com/Tyagiquamar))*:
41
+
42
+ parse LOCALTIMESTAMP as CURRENT_TIMESTAMP [AGENT] (#8813)
43
+
44
+ - due to [`41287a2`](https://github.com/tobymao/sqlglot/commit/41287a2d7ff6ede9fab62fc645922957788e443b) - accept unquoted keyword identifiers *(PR [#8816](https://github.com/tobymao/sqlglot/pull/8816) by [@georgesittas](https://github.com/georgesittas))*:
45
+
46
+ accept unquoted keyword identifiers (#8816)
47
+
48
+ - due to [`a32ef63`](https://github.com/tobymao/sqlglot/commit/a32ef6365267049425dd93f45eb7af361466b854) - propagate nested unknown types *(PR [#8818](https://github.com/tobymao/sqlglot/pull/8818) by [@georgesittas](https://github.com/georgesittas))*:
49
+
50
+ propagate nested unknown types (#8818)
51
+
52
+ - due to [`70c2a84`](https://github.com/tobymao/sqlglot/commit/70c2a84001863cfb5ddf6c62ee71bc2086507e2d) - handle time format elements case-insensitively [CODEX] *(PR [#8832](https://github.com/tobymao/sqlglot/pull/8832) by [@georgesittas](https://github.com/georgesittas))*:
53
+
54
+ handle time format elements case-insensitively [CODEX] (#8832)
55
+
56
+
57
+ ### :sparkles: New Features
58
+ - [`9943dc4`](https://github.com/tobymao/sqlglot/commit/9943dc465a01192412e595367f41f8bcecfa25a9) - **optimizer**: Fix the semi anti join qualify columns reference *(PR [#8814](https://github.com/tobymao/sqlglot/pull/8814) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
59
+ - [`b0842a1`](https://github.com/tobymao/sqlglot/commit/b0842a1ee0be2cc9345d7312724dbf2ee32e325a) - **parser**: support PER (...) on aggregates *(PR [#8835](https://github.com/tobymao/sqlglot/pull/8835) by [@geooo109](https://github.com/geooo109))*
60
+
61
+ ### :bug: Bug Fixes
62
+ - [`5739cd6`](https://github.com/tobymao/sqlglot/commit/5739cd6ca80c48fa166bcd239aba651487e9081c) - **postgres**: assign named MAKE_INTERVAL arguments to their units [CLAUDE] *(PR [#8800](https://github.com/tobymao/sqlglot/pull/8800) by [@vidigoat](https://github.com/vidigoat))*
63
+ - [`53ccce9`](https://github.com/tobymao/sqlglot/commit/53ccce9f704a6172434eac84d399b0964fccf92c) - **postgres**: preserve anonymous MAKE_INTERVAL calls *(PR [#8801](https://github.com/tobymao/sqlglot/pull/8801) by [@georgesittas](https://github.com/georgesittas))*
64
+ - [`8709510`](https://github.com/tobymao/sqlglot/commit/8709510f9a097d937e3058b82ededfe703625801) - **postgres**: count unit boundaries for DATEDIFF from boundary dialects [CLAUDE] *(PR [#8802](https://github.com/tobymao/sqlglot/pull/8802) by [@vidigoat](https://github.com/vidigoat))*
65
+ - [`e54ad9a`](https://github.com/tobymao/sqlglot/commit/e54ad9aaedeb5e9b2be615ebd5f1ff40cfb854a2) - **optimizer**: resolve set operation types during annotation [CODEX] *(PR [#8720](https://github.com/tobymao/sqlglot/pull/8720) by [@georgesittas](https://github.com/georgesittas))*
66
+ - [`a4e0898`](https://github.com/tobymao/sqlglot/commit/a4e08982b678a65a3b4140f2ee30493d827c85c8) - **parser**: wrap parenthesized `VALUES` setop operands *(PR [#8803](https://github.com/tobymao/sqlglot/pull/8803) by [@treysp](https://github.com/treysp))*
67
+ - [`991d6ce`](https://github.com/tobymao/sqlglot/commit/991d6ce5ef300c32da83c2774fd88526d0ab667a) - **duckdb**: mark DATE_DIFF as counting unit boundaries [CLAUDE] *(PR [#8810](https://github.com/tobymao/sqlglot/pull/8810) by [@vidigoat](https://github.com/vidigoat))*
68
+ - [`840347f`](https://github.com/tobymao/sqlglot/commit/840347fd4bf92926337c8d118c39ef4dbf1a2131) - **duckdb**: add missing words to RESERVED_KEYWORDS *(PR [#8811](https://github.com/tobymao/sqlglot/pull/8811) by [@mikobucz](https://github.com/mikobucz))*
69
+ - :arrow_lower_right: *fixes issue [#8804](https://github.com/tobymao/sqlglot/issues/8804) opened by [@THEtheChad](https://github.com/THEtheChad)*
70
+ - [`86abcde`](https://github.com/tobymao/sqlglot/commit/86abcde38e32ddb04ab721ab0654473d51e0a783) - **parser**: respect dialect `INTERSECT` precedence in set operations *(PR [#8704](https://github.com/tobymao/sqlglot/pull/8704) by [@treysp](https://github.com/treysp))*
71
+ - :arrow_lower_right: *fixes issue [#8390](https://github.com/tobymao/sqlglot/issues/8390) opened by [@laravioli](https://github.com/laravioli)*
72
+ - [`2d4b5a5`](https://github.com/tobymao/sqlglot/commit/2d4b5a5b0aea46e7f5a4fbe09c1d60fcafad76b3) - **mysql**: map TIMESTAMPADD and support transpilation *(PR [#8809](https://github.com/tobymao/sqlglot/pull/8809) by [@pranaysb](https://github.com/pranaysb))*
73
+ - :arrow_lower_right: *fixes issue [#8808](https://github.com/tobymao/sqlglot/issues/8808) opened by [@Shahzeb-DataEngineer](https://github.com/Shahzeb-DataEngineer)*
74
+ - [`a20a4d9`](https://github.com/tobymao/sqlglot/commit/a20a4d9e5eb3e5cf33d69148d40c25737b32d437) - **snowflake**: parse LOCALTIMESTAMP as CURRENT_TIMESTAMP [AGENT] *(PR [#8813](https://github.com/tobymao/sqlglot/pull/8813) by [@Tyagiquamar](https://github.com/Tyagiquamar))*
75
+ - :arrow_lower_right: *fixes issue [#8807](https://github.com/tobymao/sqlglot/issues/8807) opened by [@THEtheChad](https://github.com/THEtheChad)*
76
+ - [`41287a2`](https://github.com/tobymao/sqlglot/commit/41287a2d7ff6ede9fab62fc645922957788e443b) - **snowflake**: accept unquoted keyword identifiers *(PR [#8816](https://github.com/tobymao/sqlglot/pull/8816) by [@georgesittas](https://github.com/georgesittas))*
77
+ - :arrow_lower_right: *fixes issue [#8805](https://github.com/tobymao/sqlglot/issues/8805) opened by [@THEtheChad](https://github.com/THEtheChad)*
78
+ - [`3cca3ea`](https://github.com/tobymao/sqlglot/commit/3cca3ea47592c84b23636aff196ca0bbaf4f1905) - preserve timestamp arithmetic semantics *(PR [#8815](https://github.com/tobymao/sqlglot/pull/8815) by [@georgesittas](https://github.com/georgesittas))*
79
+ - [`e88e67e`](https://github.com/tobymao/sqlglot/commit/e88e67e6c8f5fe8992419f6920dac66cca8f12a8) - **snowflake**: preserve date truncation types in DuckDB *(PR [#8817](https://github.com/tobymao/sqlglot/pull/8817) by [@georgesittas](https://github.com/georgesittas))*
80
+ - :arrow_lower_right: *fixes issue [#8806](https://github.com/tobymao/sqlglot/issues/8806) opened by [@THEtheChad](https://github.com/THEtheChad)*
81
+ - [`a32ef63`](https://github.com/tobymao/sqlglot/commit/a32ef6365267049425dd93f45eb7af361466b854) - **optimizer**: propagate nested unknown types *(PR [#8818](https://github.com/tobymao/sqlglot/pull/8818) by [@georgesittas](https://github.com/georgesittas))*
82
+ - [`13a570c`](https://github.com/tobymao/sqlglot/commit/13a570c6f790a6140c9c9ae004914b081beb7ae6) - **oracle**: preserve end of month in ADD_MONTHS closes [#8824](https://github.com/tobymao/sqlglot/pull/8824) [CLAUDE] *(PR [#8825](https://github.com/tobymao/sqlglot/pull/8825) by [@pandasuwu](https://github.com/pandasuwu))*
83
+ - :arrow_lower_right: *fixes issue [#8824](https://github.com/tobymao/sqlglot/issues/8824) opened by [@pandasuwu](https://github.com/pandasuwu)*
84
+ - [`a07698a`](https://github.com/tobymao/sqlglot/commit/a07698a741dde560a820211cb4a2539856edb349) - **snowflake**: preserve default LISTAGG separator [CODEX] *(PR [#8823](https://github.com/tobymao/sqlglot/pull/8823) by [@Ychris12138](https://github.com/Ychris12138))*
85
+ - :arrow_lower_right: *fixes issue [#8819](https://github.com/tobymao/sqlglot/issues/8819) opened by [@THEtheChad](https://github.com/THEtheChad)*
86
+ - [`e2a8b65`](https://github.com/tobymao/sqlglot/commit/e2a8b6589504793decb69d00158f728b6d3772ec) - **snowflake**: support COPY TAGS in CREATE TABLE *(PR [#8822](https://github.com/tobymao/sqlglot/pull/8822) by [@ramitmittal](https://github.com/ramitmittal))*
87
+ - [`ab04347`](https://github.com/tobymao/sqlglot/commit/ab043477f777af312efc29b419eb14f0c385fef7) - **spark**: parse LISTAGG through _parse_string_agg *(PR [#8829](https://github.com/tobymao/sqlglot/pull/8829) by [@Tyagiquamar](https://github.com/Tyagiquamar))*
88
+ - :arrow_lower_right: *fixes issue [#8828](https://github.com/tobymao/sqlglot/issues/8828) opened by [@rahul05ranjan](https://github.com/rahul05ranjan)*
89
+ - [`7c9dbb9`](https://github.com/tobymao/sqlglot/commit/7c9dbb91e9e252e2d47840ea4cb63caf8f4d6a12) - **tsql**: don't crash in qualify_derived_table_outputs for a CTE with a non-query body *(PR [#8827](https://github.com/tobymao/sqlglot/pull/8827) by [@rahul05ranjan](https://github.com/rahul05ranjan))*
90
+ - :arrow_lower_right: *fixes issue [#8826](https://github.com/tobymao/sqlglot/issues/8826) opened by [@rahul05ranjan](https://github.com/rahul05ranjan)*
91
+ - [`2748f82`](https://github.com/tobymao/sqlglot/commit/2748f82ec5bf895f2055e60c8e90e132079bc532) - **parser**: accept ALL in string aggregation *(PR [#8831](https://github.com/tobymao/sqlglot/pull/8831) by [@georgesittas](https://github.com/georgesittas))*
92
+ - [`70c2a84`](https://github.com/tobymao/sqlglot/commit/70c2a84001863cfb5ddf6c62ee71bc2086507e2d) - **snowflake**: handle time format elements case-insensitively [CODEX] *(PR [#8832](https://github.com/tobymao/sqlglot/pull/8832) by [@georgesittas](https://github.com/georgesittas))*
93
+ - :arrow_lower_right: *fixes issue [#8820](https://github.com/tobymao/sqlglot/issues/8820) opened by [@THEtheChad](https://github.com/THEtheChad)*
94
+
95
+
4
96
  ## [v30.25.0] - 2026-10-26
5
97
  ### :boom: BREAKING CHANGES
6
98
  - due to [`c90a322`](https://github.com/tobymao/sqlglot/commit/c90a322c329d2b1003bf73b848f0d9e17f1a3d67) - support non-identifier column parts in compiled code *(PR [#8710](https://github.com/tobymao/sqlglot/pull/8710) by [@georgesittas](https://github.com/georgesittas))*:
@@ -16493,3 +16585,5 @@ pip install "sqlglot[c]" # compiled — faster, but no subclassing
16493
16585
  [v30.23.0]: https://github.com/tobymao/sqlglot/compare/v30.22.0...v30.23.0
16494
16586
  [v30.24.0]: https://github.com/tobymao/sqlglot/compare/v30.23.0...v30.24.0
16495
16587
  [v30.25.0]: https://github.com/tobymao/sqlglot/compare/v30.24.0...v30.25.0
16588
+ [v30.26.0]: https://github.com/tobymao/sqlglot/compare/v30.25.0...v30.26.0
16589
+ [v30.27.0]: https://github.com/tobymao/sqlglot/compare/v30.26.0...v30.27.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlglot
3
- Version: 30.26.0
3
+ Version: 30.29.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
@@ -34,10 +34,10 @@ Requires-Dist: types-pytz; extra == "dev"
34
34
  Requires-Dist: typing_extensions; extra == "dev"
35
35
  Requires-Dist: pyperf; extra == "dev"
36
36
  Provides-Extra: c
37
- Requires-Dist: sqlglotc==30.26.0; python_version >= "3.10" and extra == "c"
37
+ Requires-Dist: sqlglotc==30.29.0; python_version >= "3.10" and extra == "c"
38
38
  Provides-Extra: rs
39
39
  Requires-Dist: sqlglotrs==0.13.0; extra == "rs"
40
- Requires-Dist: sqlglotc==30.26.0; python_version >= "3.10" and extra == "rs"
40
+ Requires-Dist: sqlglotc==30.29.0; python_version >= "3.10" and extra == "rs"
41
41
  Dynamic: license-file
42
42
  Dynamic: provides-extra
43
43
 
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '30.26.0'
22
- __version_tuple__ = version_tuple = (30, 26, 0)
21
+ __version__ = version = '30.29.0'
22
+ __version_tuple__ = version_tuple = (30, 29, 0)
23
23
 
24
- __commit_id__ = commit_id = 'gb0842a1ee'
24
+ __commit_id__ = commit_id = 'g2fe25297a'
@@ -180,6 +180,7 @@ class BigQuery(Dialect):
180
180
  QUOTES = ["'", '"', '"""', "'''"]
181
181
  COMMENTS = ["--", "#", ("/*", "*/")]
182
182
  IDENTIFIERS = ["`"]
183
+ IDENTIFIER_ESCAPES = ["\\"]
183
184
  STRING_ESCAPES = ["\\"]
184
185
 
185
186
  HEX_STRINGS = [("0x", ""), ("0X", "")]
@@ -124,6 +124,7 @@ class DuckDB(Dialect):
124
124
  "VARCHAR": TokenType.TEXT,
125
125
  }
126
126
  KEYWORDS.pop("/*+")
127
+ KEYWORDS.pop("SORT BY")
127
128
 
128
129
  SINGLE_TOKENS = {
129
130
  **tokens.Tokenizer.SINGLE_TOKENS,
@@ -201,11 +201,22 @@ class ChangeDistiller:
201
201
 
202
202
  def _generate_edit_script(self, matchings: dict[int, int], delta_only: bool) -> list[Edit]:
203
203
  edit_script: list[Edit] = []
204
- for removed_node_id in self._unmatched_source_nodes:
205
- edit_script.append(Remove(self._source_index[removed_node_id]))
206
- for inserted_node_id in self._unmatched_target_nodes:
207
- edit_script.append(Insert(self._target_index[inserted_node_id]))
208
- for kept_source_node_id, kept_target_node_id in matchings.items():
204
+
205
+ # The unmatched node sets and the matching set are keyed by id(), so iterating them
206
+ # directly orders the edits by object address, which varies between processes. The
207
+ # node indexes are built from bfs(), so iterating those instead keeps the edit script
208
+ # in a stable, tree-order sequence.
209
+ for removed_node_id in self._source_index:
210
+ if removed_node_id in self._unmatched_source_nodes:
211
+ edit_script.append(Remove(self._source_index[removed_node_id]))
212
+ for inserted_node_id in self._target_index:
213
+ if inserted_node_id in self._unmatched_target_nodes:
214
+ edit_script.append(Insert(self._target_index[inserted_node_id]))
215
+ for kept_source_node_id in self._source_index:
216
+ kept_target_node_id = matchings.get(kept_source_node_id)
217
+ if kept_target_node_id is None:
218
+ continue
219
+
209
220
  source_node = self._source_index[kept_source_node_id]
210
221
  target_node = self._target_index[kept_target_node_id]
211
222
 
@@ -266,6 +277,10 @@ class ChangeDistiller:
266
277
  leaves_matching_set = self._compute_leaf_matching_set()
267
278
  matching_set = leaves_matching_set.copy()
268
279
 
280
+ matched_target_leaves: dict[int, list[int]] = defaultdict(list)
281
+ for source_leaf_id, target_leaf_id in leaves_matching_set:
282
+ matched_target_leaves[source_leaf_id].append(target_leaf_id)
283
+
269
284
  ordered_unmatched_source_nodes = {
270
285
  id(n): None for n in self._source.bfs() if id(n) in self._unmatched_source_nodes
271
286
  }
@@ -273,27 +288,40 @@ class ChangeDistiller:
273
288
  id(n): None for n in self._target.bfs() if id(n) in self._unmatched_target_nodes
274
289
  }
275
290
 
291
+ target_leaf_ids_cache: dict[int, set[int]] = {}
292
+
276
293
  for source_node_id in ordered_unmatched_source_nodes:
294
+ source_node = self._source_index[source_node_id]
295
+ source_leaf_ids = None
296
+
277
297
  for target_node_id in ordered_unmatched_target_nodes:
278
- source_node = self._source_index[source_node_id]
279
298
  target_node = self._target_index[target_node_id]
280
299
  if _is_same_type(source_node, target_node):
281
- source_leaf_ids = {id(l) for l in _get_expression_leaves(source_node)}
282
- target_leaf_ids = {id(l) for l in _get_expression_leaves(target_node)}
283
-
284
- max_leaves_num = max(len(source_leaf_ids), len(target_leaf_ids))
300
+ if source_leaf_ids is None:
301
+ source_leaf_ids = {id(l) for l in _get_expression_leaves(source_node)}
302
+ source_leaves_num = len(source_leaf_ids)
303
+ candidate_target_leaf_ids = [
304
+ target_leaf_id
305
+ for source_leaf_id in source_leaf_ids
306
+ for target_leaf_id in matched_target_leaves.get(source_leaf_id, ())
307
+ ]
308
+
309
+ target_leaf_ids = target_leaf_ids_cache.get(target_node_id)
310
+ if target_leaf_ids is None:
311
+ target_leaf_ids = {id(l) for l in _get_expression_leaves(target_node)}
312
+ target_leaf_ids_cache[target_node_id] = target_leaf_ids
313
+
314
+ target_leaves_num = len(target_leaf_ids)
315
+ max_leaves_num = max(source_leaves_num, target_leaves_num)
285
316
  if max_leaves_num:
286
317
  common_leaves_num = sum(
287
- 1 if s in source_leaf_ids and t in target_leaf_ids else 0
288
- for s, t in leaves_matching_set
318
+ 1 for t in candidate_target_leaf_ids if t in target_leaf_ids
289
319
  )
290
320
  leaf_similarity_score = common_leaves_num / max_leaves_num
291
321
  else:
292
322
  leaf_similarity_score = 0.0
293
323
 
294
- adjusted_t = (
295
- self.t if min(len(source_leaf_ids), len(target_leaf_ids)) > 4 else 0.4
296
- )
324
+ adjusted_t = self.t if min(source_leaves_num, target_leaves_num) > 4 else 0.4
297
325
 
298
326
  if leaf_similarity_score >= 0.8 or (
299
327
  leaf_similarity_score >= adjusted_t
@@ -303,6 +331,7 @@ class ChangeDistiller:
303
331
  self._unmatched_source_nodes.remove(source_node_id)
304
332
  self._unmatched_target_nodes.remove(target_node_id)
305
333
  ordered_unmatched_target_nodes.pop(target_node_id, None)
334
+ target_leaf_ids_cache.pop(target_node_id, None)
306
335
  break
307
336
 
308
337
  return matching_set
@@ -824,7 +824,7 @@ def normalize_table_name(table: str | Table, dialect: DialectType = None, copy:
824
824
  def replace_tables(
825
825
  expression: E, mapping: dict[str, str], dialect: DialectType = None, copy: bool = True
826
826
  ) -> E:
827
- """Replace all tables in expression according to the mapping.
827
+ """Replace all FROM sources (tables, views, table functions...) in expression according to the mapping.
828
828
 
829
829
  Args:
830
830
  expression: expression node to be transformed and replaced.
@@ -845,6 +845,10 @@ def replace_tables(
845
845
 
846
846
  def _replace_tables(node: Expr) -> Expr:
847
847
  if isinstance(node, Table) and node.meta_get("replace") is not False:
848
+ call = node.this
849
+ if isinstance(call, Func) and not isinstance(call, Anonymous):
850
+ return node
851
+
848
852
  original = normalize_table_name(node, dialect=dialect)
849
853
  new_name = mapping.get(original)
850
854
 
@@ -854,6 +858,9 @@ def replace_tables(
854
858
  **{k: v for k, v in node.args.items() if k not in TABLE_PARTS},
855
859
  dialect=dialect,
856
860
  )
861
+ if isinstance(call, Anonymous):
862
+ call.set("this", table.this)
863
+ table.set("this", call)
857
864
  table.add_comments([original])
858
865
  return table
859
866
  return node
@@ -933,7 +933,10 @@ class Expression(Expr):
933
933
 
934
934
  @property
935
935
  def is_int(self) -> bool:
936
- return self.is_number and isinstance(self.to_py(), int)
936
+ try:
937
+ return self.is_number and isinstance(self.to_py(), int)
938
+ except ValueError:
939
+ return False
937
940
 
938
941
  @property
939
942
  def is_star(self) -> bool:
@@ -117,6 +117,7 @@ class DType(AutoName):
117
117
  NVARCHAR = auto()
118
118
  OBJECT = auto()
119
119
  RANGE = auto()
120
+ REF = auto()
120
121
  ROWVERSION = auto()
121
122
  SERIAL = auto()
122
123
  SET = auto()
@@ -222,6 +222,10 @@ class OutputModelProperty(Property):
222
222
  arg_types = {"this": True}
223
223
 
224
224
 
225
+ class InteractiveProperty(Property):
226
+ arg_types = {}
227
+
228
+
225
229
  class IsolatedLoadingProperty(Property):
226
230
  arg_types = {"no": False, "concurrent": False, "target": False}
227
231
 
@@ -520,7 +524,7 @@ class UsingProperty(Property):
520
524
 
521
525
 
522
526
  class TemporaryProperty(Property):
523
- arg_types = {"this": False}
527
+ arg_types = {"this": False, "scoped": False}
524
528
 
525
529
 
526
530
  class VirtualProperty(Property):
@@ -1168,6 +1168,7 @@ class Values(Expression, UDTF):
1168
1168
  "order": False,
1169
1169
  "limit": False,
1170
1170
  "offset": False,
1171
+ "pivots": False,
1171
1172
  }
1172
1173
 
1173
1174
 
@@ -454,7 +454,13 @@ class ParseTime(Expression, Func):
454
454
 
455
455
 
456
456
  class StrToDate(Expression, Func):
457
- arg_types = {"this": True, "format": False, "safe": False, "default_year": False}
457
+ arg_types = {
458
+ "this": True,
459
+ "format": False,
460
+ "safe": False,
461
+ "default_year": False,
462
+ "nlsparam": False,
463
+ }
458
464
 
459
465
 
460
466
  class StrToTime(Expression, Func):
@@ -465,6 +471,7 @@ class StrToTime(Expression, Func):
465
471
  "safe": False,
466
472
  "target_type": False,
467
473
  "default_year": False,
474
+ "nlsparam": False,
468
475
  }
469
476
 
470
477
 
@@ -765,6 +765,7 @@ class Generator:
765
765
  exp.IcebergProperty: exp.Properties.Location.POST_CREATE,
766
766
  exp.IncludeProperty: exp.Properties.Location.POST_SCHEMA,
767
767
  exp.InputModelProperty: exp.Properties.Location.POST_SCHEMA,
768
+ exp.InteractiveProperty: exp.Properties.Location.UNSUPPORTED,
768
769
  exp.IsolatedLoadingProperty: exp.Properties.Location.POST_NAME,
769
770
  exp.JournalProperty: exp.Properties.Location.POST_NAME,
770
771
  exp.LanguageProperty: exp.Properties.Location.POST_SCHEMA,
@@ -2862,7 +2863,8 @@ class Generator:
2862
2863
  else values
2863
2864
  )
2864
2865
  values = self.query_modifiers(expression, values)
2865
- return f"{values} AS {alias}" if alias else values
2866
+ pivots = self.expressions(expression, key="pivots", sep="", flat=True)
2867
+ return f"{values} AS {alias}{pivots}" if alias else f"{values}{pivots}"
2866
2868
 
2867
2869
  # Converts `VALUES...` expression into a series of select unions.
2868
2870
  alias_node = expression.args.get("alias")
@@ -2885,11 +2887,17 @@ class Generator:
2885
2887
  # the deep nesting of the resulting exp.Unions. If this is a problem, either increase
2886
2888
  # `sys.setrecursionlimit` to avoid RecursionErrors, or don't set `pretty`.
2887
2889
  query = reduce(lambda x, y: exp.union(x, y, distinct=False, copy=False), selects)
2888
- return self.subquery_sql(query.subquery(alias_node and alias_node.this, copy=False))
2890
+ for key in ("order", "limit", "offset"):
2891
+ if value := expression.args.get(key):
2892
+ query.set(key, value.pop())
2893
+ subquery = query.subquery(alias_node and alias_node.this, copy=False)
2894
+ subquery.set("pivots", expression.args.pop("pivots", None))
2895
+ return self.subquery_sql(subquery)
2889
2896
 
2890
2897
  alias = f" AS {self.sql(alias_node, 'this')}" if alias_node else ""
2891
2898
  unions = " UNION ALL ".join(self.sql(select) for select in selects)
2892
- return f"({unions}){alias}"
2899
+ pivots = self.expressions(expression, key="pivots", sep="", flat=True)
2900
+ return f"({self.query_modifiers(expression, unions)}){alias}{pivots}"
2893
2901
 
2894
2902
  def var_sql(self, expression: exp.Var) -> str:
2895
2903
  return self.sql(expression, "this")
@@ -30,9 +30,13 @@ from sqlglot.dialects.dialect import (
30
30
  groupconcat_sql,
31
31
  sha2_digest_sql,
32
32
  )
33
+ from sqlglot.errors import ErrorLevel
33
34
  from sqlglot.generator import unsupported_args
34
35
  from sqlglot.helper import seq_get
35
36
 
37
+ if t.TYPE_CHECKING:
38
+ from sqlglot.dialects.dialect import DialectType
39
+
36
40
  logger = logging.getLogger("sqlglot")
37
41
 
38
42
  JSON_EXTRACT_TYPE = t.Union[exp.JSONExtract, exp.JSONExtractScalar, exp.JSONExtractArray]
@@ -683,6 +687,44 @@ class BigQueryGenerator(generator.Generator):
683
687
  "within",
684
688
  }
685
689
 
690
+ def __init__(
691
+ self,
692
+ pretty: bool | int | None = None,
693
+ identify: str | bool = False,
694
+ normalize: bool = False,
695
+ pad: int = 2,
696
+ indent: int = 2,
697
+ normalize_functions: str | bool | None = None,
698
+ unsupported_level: ErrorLevel = ErrorLevel.WARN,
699
+ max_unsupported: int = 3,
700
+ leading_comma: bool = False,
701
+ max_text_width: int = 80,
702
+ comments: bool = True,
703
+ dialect: DialectType = None,
704
+ ) -> None:
705
+ super().__init__(
706
+ pretty=pretty,
707
+ identify=identify,
708
+ normalize=normalize,
709
+ pad=pad,
710
+ indent=indent,
711
+ normalize_functions=normalize_functions,
712
+ unsupported_level=unsupported_level,
713
+ max_unsupported=max_unsupported,
714
+ leading_comma=leading_comma,
715
+ max_text_width=max_text_width,
716
+ comments=comments,
717
+ dialect=dialect,
718
+ )
719
+
720
+ self._escaped_identifier_end = r"\`"
721
+
722
+ # Escape existing backslashes before introducing new escape sequences.
723
+ self._identifier_escaped_sequences = {
724
+ **self._identifier_escaped_sequences,
725
+ **self.dialect.ESCAPED_SEQUENCES,
726
+ }
727
+
686
728
  def frombase_sql(self, expression: exp.FromBase) -> str:
687
729
  # Hex is the only base BigQuery can cast from, and the sign goes before the prefix, e.g. -0xff
688
730
  if expression.expression.name != "16":
@@ -111,7 +111,7 @@ def _apply_base64_alphabet_replacements(
111
111
  reverse: bool = False,
112
112
  ) -> exp.Expr:
113
113
  """
114
- Apply base64 alphabet character replacements.
114
+ Translate base64 alphabet characters without cascading replacements.
115
115
 
116
116
  Base64 alphabet can be 1-3 chars: 1st = index 62 ('+'), 2nd = index 63 ('/'), 3rd = padding ('=').
117
117
  zip truncates to the shorter string, so 1-char alphabet only replaces '+', 2-char replaces '+/', etc.
@@ -123,14 +123,19 @@ def _apply_base64_alphabet_replacements(
123
123
  If True, replace custom with default (decode)
124
124
  """
125
125
  if isinstance(alphabet, exp.Literal) and alphabet.is_string:
126
+ source, target = "", ""
126
127
  for default_char, new_char in zip("+/=", alphabet.this):
127
128
  if new_char != default_char:
128
- find, replace = (new_char, default_char) if reverse else (default_char, new_char)
129
- result = exp.Replace(
130
- this=result,
131
- expression=exp.Literal.string(find),
132
- replacement=exp.Literal.string(replace),
133
- )
129
+ source += default_char
130
+ target += new_char
131
+ if source:
132
+ if reverse:
133
+ source, target = target, source
134
+ result = exp.Translate(
135
+ this=result,
136
+ from_=exp.Literal.string(source),
137
+ to=exp.Literal.string(target),
138
+ )
134
139
  return result
135
140
 
136
141
 
@@ -139,7 +144,7 @@ def _base64_decode_sql(self: DuckDBGenerator, expression: exp.Expr, to_string: b
139
144
  Transpile Snowflake BASE64_DECODE_STRING/BINARY to DuckDB.
140
145
 
141
146
  DuckDB uses FROM_BASE64() which returns BLOB. For string output, wrap with DECODE().
142
- Custom alphabets require REPLACE() calls to convert to standard base64.
147
+ Custom alphabets require TRANSLATE() to convert to standard base64.
143
148
  """
144
149
  input_expr = expression.this
145
150
  alphabet = expression.args.get("alphabet")
@@ -89,8 +89,12 @@ class OracleGenerator(generator.Generator):
89
89
  exp.StrPosition: lambda self, e: strposition_sql(
90
90
  self, e, func_name="INSTR", supports_position=True, supports_occurrence=True
91
91
  ),
92
- exp.StrToTime: lambda self, e: self.func("TO_TIMESTAMP", e.this, self.format_time(e)),
93
- exp.StrToDate: lambda self, e: self.func("TO_DATE", e.this, self.format_time(e)),
92
+ exp.StrToTime: lambda self, e: self.func(
93
+ "TO_TIMESTAMP", e.this, self.format_time(e), e.args.get("nlsparam")
94
+ ),
95
+ exp.StrToDate: lambda self, e: self.func(
96
+ "TO_DATE", e.this, self.format_time(e), e.args.get("nlsparam")
97
+ ),
94
98
  exp.Subquery: lambda self, e: self.subquery_sql(e, sep=" "),
95
99
  exp.Substring: rename_func("SUBSTR"),
96
100
  exp.Table: lambda self, e: self.table_sql(e, sep=" "),
@@ -499,6 +499,7 @@ class SnowflakeGenerator(generator.Generator):
499
499
  exp.GetExtract: rename_func("GET"),
500
500
  exp.GroupConcat: lambda self, e: groupconcat_sql(self, e, sep=""),
501
501
  exp.If: if_sql(name="IFF", false_value="NULL"),
502
+ exp.InteractiveProperty: lambda *_: "INTERACTIVE",
502
503
  exp.JSONArray: lambda self, e: self.func(
503
504
  "TO_VARIANT", self.func("ARRAY_CONSTRUCT", *e.expressions)
504
505
  ),
@@ -577,6 +578,9 @@ class SnowflakeGenerator(generator.Generator):
577
578
  exp.StrtokToArray: rename_func("STRTOK_TO_ARRAY"),
578
579
  exp.Stuff: rename_func("INSERT"),
579
580
  exp.StPoint: rename_func("ST_MAKEPOINT"),
581
+ exp.TemporaryProperty: lambda _, e: (
582
+ "SCOPED TEMPORARY" if e.args.get("scoped") else "TEMPORARY"
583
+ ),
580
584
  exp.TimeAdd: date_delta_sql("TIMEADD"),
581
585
  exp.TimeSlice: lambda self, e: self.func(
582
586
  "TIME_SLICE",
@@ -648,6 +652,7 @@ class SnowflakeGenerator(generator.Generator):
648
652
  PROPERTIES_LOCATION = {
649
653
  **generator.Generator.PROPERTIES_LOCATION,
650
654
  exp.CredentialsProperty: exp.Properties.Location.POST_WITH,
655
+ exp.InteractiveProperty: exp.Properties.Location.POST_CREATE,
651
656
  exp.LocationProperty: exp.Properties.Location.POST_WITH,
652
657
  exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
653
658
  exp.RowAccessProperty: exp.Properties.Location.POST_SCHEMA,
@@ -81,19 +81,6 @@ def _generated_to_auto_increment(expression: exp.Expr) -> exp.Expr:
81
81
  return expression
82
82
 
83
83
 
84
- def _offset_to_limit(expression: exp.Expr) -> exp.Expr:
85
- if not isinstance(expression, exp.Select):
86
- return expression
87
-
88
- offset = expression.args.get("offset")
89
- limit = expression.args.get("limit")
90
-
91
- if offset and (not limit or (isinstance(limit, exp.Limit) and limit.is_limit_all)):
92
- expression.limit(-1, copy=False)
93
-
94
- return expression
95
-
96
-
97
84
  class SQLiteGenerator(generator.Generator):
98
85
  SELECT_KINDS: tuple[str, ...] = ()
99
86
  TRY_SUPPORTED = False
@@ -141,6 +128,12 @@ class SQLiteGenerator(generator.Generator):
141
128
  exp.DType.VARBINARY: "BLOB",
142
129
  }
143
130
 
131
+ def nullsafeeq_sql(self, expression: exp.NullSafeEQ) -> str:
132
+ return self.binary(expression, "IS")
133
+
134
+ def nullsafeneq_sql(self, expression: exp.NullSafeNEQ) -> str:
135
+ return self.binary(expression, "IS NOT")
136
+
144
137
  TOKEN_MAPPING = {
145
138
  TokenType.AUTO_INCREMENT: "AUTOINCREMENT",
146
139
  }
@@ -173,7 +166,6 @@ class SQLiteGenerator(generator.Generator):
173
166
  exp.RegexpLike: lambda self, e: self.binary(e, "REGEXP"),
174
167
  exp.Select: transforms.preprocess(
175
168
  [
176
- _offset_to_limit,
177
169
  transforms.eliminate_distinct_on,
178
170
  transforms.eliminate_qualify,
179
171
  transforms.eliminate_semi_and_anti_joins,
@@ -204,6 +196,29 @@ class SQLiteGenerator(generator.Generator):
204
196
 
205
197
  LIMIT_FETCH = "LIMIT"
206
198
 
199
+ def offset_limit_modifiers(
200
+ self, expression: exp.Expr, fetch: bool, limit: exp.Fetch | exp.Limit | None
201
+ ) -> list[str]:
202
+ if expression.args.get("offset") and (
203
+ not limit or (isinstance(limit, exp.Limit) and limit.is_limit_all)
204
+ ):
205
+ limit = exp.Limit(expression=exp.Literal.number(-1))
206
+ return super().offset_limit_modifiers(expression, fetch, limit)
207
+
208
+ def subquery_sql(self, expression: exp.Subquery, sep: str = " AS ") -> str:
209
+ if any(expression.args.get(key) for key in ("order", "limit", "offset")):
210
+ query = expression.this
211
+ keys = ("order", "limit", "offset", "with_")
212
+ # Merge grouping modifiers unless doing so would overwrite an inner clause.
213
+ if any(expression.args.get(key) and query.args.get(key) for key in keys):
214
+ query = exp.select("*").from_(query.subquery(copy=False), copy=False)
215
+ for key in keys:
216
+ if value := expression.args.get(key):
217
+ query.set(key, value.pop())
218
+ return self.sql(query)
219
+
220
+ return super().subquery_sql(expression, sep=sep)
221
+
207
222
  def autoincrementcolumnconstraint_sql(
208
223
  self, expression: exp.AutoIncrementColumnConstraint
209
224
  ) -> str:
@@ -113,7 +113,10 @@ def parse(path: str, dialect: DialectType = None) -> exp.JSONPath:
113
113
  number += token.text
114
114
 
115
115
  if number:
116
- return int(number)
116
+ try:
117
+ return int(number)
118
+ except ValueError:
119
+ raise ParseError(_error(f"Invalid integer index: {number}"))
117
120
 
118
121
  return False
119
122