sqlglot 30.7.0__tar.gz → 30.8.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 (325) hide show
  1. {sqlglot-30.7.0 → sqlglot-30.8.0}/CHANGELOG.md +119 -0
  2. {sqlglot-30.7.0/sqlglot.egg-info → sqlglot-30.8.0}/PKG-INFO +3 -3
  3. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/_version.py +3 -3
  4. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/dialect.py +18 -13
  5. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/postgres.py +1 -0
  6. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/redshift.py +9 -2
  7. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/expressions/array.py +1 -1
  8. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/expressions/core.py +2 -2
  9. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/expressions/datatypes.py +1 -0
  10. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/expressions/ddl.py +1 -1
  11. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/expressions/functions.py +8 -0
  12. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/expressions/query.py +21 -6
  13. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/expressions/string.py +1 -5
  14. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generator.py +81 -4
  15. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/bigquery.py +1 -0
  16. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/duckdb.py +12 -7
  17. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/exasol.py +21 -18
  18. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/hive.py +5 -4
  19. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/mysql.py +1 -0
  20. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/postgres.py +3 -0
  21. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/redshift.py +30 -0
  22. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/singlestore.py +6 -1
  23. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/snowflake.py +1 -0
  24. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/spark.py +8 -2
  25. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/tsql.py +1 -0
  26. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/annotate_types.py +111 -39
  27. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/eliminate_joins.py +8 -8
  28. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/eliminate_subqueries.py +7 -5
  29. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/optimize_joins.py +4 -3
  30. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/pushdown_predicates.py +39 -19
  31. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/pushdown_projections.py +1 -1
  32. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/qualify.py +3 -2
  33. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/qualify_columns.py +3 -3
  34. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/scope.py +13 -0
  35. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/unnest_subqueries.py +2 -1
  36. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parser.py +86 -10
  37. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/bigquery.py +15 -14
  38. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/clickhouse.py +12 -5
  39. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/databricks.py +1 -3
  40. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/dremio.py +2 -2
  41. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/drill.py +1 -1
  42. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/duckdb.py +8 -3
  43. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/exasol.py +1 -1
  44. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/hive.py +26 -17
  45. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/mysql.py +13 -3
  46. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/oracle.py +5 -4
  47. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/postgres.py +7 -4
  48. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/presto.py +8 -4
  49. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/redshift.py +26 -1
  50. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/singlestore.py +3 -3
  51. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/snowflake.py +7 -5
  52. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/spark2.py +2 -2
  53. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/planner.py +36 -43
  54. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/schema.py +19 -13
  55. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/serde.py +10 -6
  56. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/time.py +6 -5
  57. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/tokenizer_core.py +2 -0
  58. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/transforms.py +68 -57
  59. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/typing/__init__.py +3 -1
  60. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/typing/clickhouse.py +5 -0
  61. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/typing/hive.py +2 -0
  62. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/typing/snowflake.py +1 -1
  63. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/typing/spark.py +4 -0
  64. {sqlglot-30.7.0 → sqlglot-30.8.0/sqlglot.egg-info}/PKG-INFO +3 -3
  65. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot.egg-info/requires.txt +2 -2
  66. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_bigquery.py +16 -0
  67. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_databricks.py +11 -3
  68. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_dialect.py +18 -0
  69. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_duckdb.py +10 -2
  70. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_exasol.py +8 -0
  71. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_mysql.py +11 -0
  72. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_postgres.py +40 -3
  73. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_spark.py +14 -0
  74. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_sqlite.py +2 -0
  75. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/annotate_functions.sql +51 -0
  76. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/pushdown_projections.sql +27 -0
  77. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +2 -2
  78. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/test_expressions.py +0 -1
  79. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/test_optimizer.py +7 -0
  80. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/test_parser.py +29 -0
  81. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/test_transpile.py +1 -1
  82. {sqlglot-30.7.0 → sqlglot-30.8.0}/.gitignore +0 -0
  83. {sqlglot-30.7.0 → sqlglot-30.8.0}/.gitmodules +0 -0
  84. {sqlglot-30.7.0 → sqlglot-30.8.0}/.gitpod.yml +0 -0
  85. {sqlglot-30.7.0 → sqlglot-30.8.0}/.pre-commit-config.yaml +0 -0
  86. {sqlglot-30.7.0 → sqlglot-30.8.0}/AGENTS.md +0 -0
  87. {sqlglot-30.7.0 → sqlglot-30.8.0}/CLAUDE.md +0 -0
  88. {sqlglot-30.7.0 → sqlglot-30.8.0}/CONTRIBUTING.md +0 -0
  89. {sqlglot-30.7.0 → sqlglot-30.8.0}/LICENSE +0 -0
  90. {sqlglot-30.7.0 → sqlglot-30.8.0}/MANIFEST.in +0 -0
  91. {sqlglot-30.7.0 → sqlglot-30.8.0}/Makefile +0 -0
  92. {sqlglot-30.7.0 → sqlglot-30.8.0}/README.md +0 -0
  93. {sqlglot-30.7.0 → sqlglot-30.8.0}/pyproject.toml +0 -0
  94. {sqlglot-30.7.0 → sqlglot-30.8.0}/setup.cfg +0 -0
  95. {sqlglot-30.7.0 → sqlglot-30.8.0}/setup.py +0 -0
  96. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/__init__.py +0 -0
  97. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/__main__.py +0 -0
  98. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/_typing.py +0 -0
  99. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/__init__.py +0 -0
  100. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/athena.py +0 -0
  101. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/bigquery.py +0 -0
  102. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/clickhouse.py +0 -0
  103. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/databricks.py +0 -0
  104. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/doris.py +0 -0
  105. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/dremio.py +0 -0
  106. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/drill.py +0 -0
  107. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/druid.py +0 -0
  108. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/duckdb.py +0 -0
  109. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/dune.py +0 -0
  110. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/exasol.py +0 -0
  111. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/fabric.py +0 -0
  112. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/hive.py +0 -0
  113. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/materialize.py +0 -0
  114. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/mysql.py +0 -0
  115. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/oracle.py +0 -0
  116. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/presto.py +0 -0
  117. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/prql.py +0 -0
  118. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/risingwave.py +0 -0
  119. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/singlestore.py +0 -0
  120. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/snowflake.py +0 -0
  121. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/solr.py +0 -0
  122. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/spark.py +0 -0
  123. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/spark2.py +0 -0
  124. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/sqlite.py +0 -0
  125. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/starrocks.py +0 -0
  126. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/tableau.py +0 -0
  127. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/teradata.py +0 -0
  128. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/trino.py +0 -0
  129. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/dialects/tsql.py +0 -0
  130. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/diff.py +0 -0
  131. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/errors.py +0 -0
  132. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/executor/__init__.py +0 -0
  133. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/executor/context.py +0 -0
  134. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/executor/env.py +0 -0
  135. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/executor/python.py +0 -0
  136. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/executor/table.py +0 -0
  137. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/expressions/__init__.py +0 -0
  138. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/expressions/aggregate.py +0 -0
  139. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/expressions/builders.py +0 -0
  140. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/expressions/constraints.py +0 -0
  141. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/expressions/dml.py +0 -0
  142. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/expressions/json.py +0 -0
  143. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/expressions/math.py +0 -0
  144. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/expressions/properties.py +0 -0
  145. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/expressions/temporal.py +0 -0
  146. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/__init__.py +0 -0
  147. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/athena.py +0 -0
  148. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/clickhouse.py +0 -0
  149. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/databricks.py +0 -0
  150. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/doris.py +0 -0
  151. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/dremio.py +0 -0
  152. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/drill.py +0 -0
  153. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/druid.py +0 -0
  154. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/dune.py +0 -0
  155. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/fabric.py +0 -0
  156. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/materialize.py +0 -0
  157. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/oracle.py +0 -0
  158. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/presto.py +0 -0
  159. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/prql.py +0 -0
  160. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/python.py +0 -0
  161. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/risingwave.py +0 -0
  162. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/solr.py +0 -0
  163. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/spark2.py +0 -0
  164. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/sqlite.py +0 -0
  165. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/starrocks.py +0 -0
  166. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/tableau.py +0 -0
  167. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/teradata.py +0 -0
  168. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/generators/trino.py +0 -0
  169. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/helper.py +0 -0
  170. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/jsonpath.py +0 -0
  171. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/lineage.py +0 -0
  172. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/__init__.py +0 -0
  173. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/canonicalize.py +0 -0
  174. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/canonicalize_internal_names.py +0 -0
  175. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
  176. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
  177. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/merge_subqueries.py +0 -0
  178. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/normalize.py +0 -0
  179. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
  180. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/optimizer.py +0 -0
  181. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/qualify_tables.py +0 -0
  182. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/resolver.py +0 -0
  183. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/optimizer/simplify.py +0 -0
  184. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/__init__.py +0 -0
  185. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/athena.py +0 -0
  186. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/base.py +0 -0
  187. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/doris.py +0 -0
  188. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/druid.py +0 -0
  189. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/dune.py +0 -0
  190. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/fabric.py +0 -0
  191. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/materialize.py +0 -0
  192. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/prql.py +0 -0
  193. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/risingwave.py +0 -0
  194. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/solr.py +0 -0
  195. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/spark.py +0 -0
  196. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/sqlite.py +0 -0
  197. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/starrocks.py +0 -0
  198. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/tableau.py +0 -0
  199. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/teradata.py +0 -0
  200. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/trino.py +0 -0
  201. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/parsers/tsql.py +0 -0
  202. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/py.typed +0 -0
  203. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/tokens.py +0 -0
  204. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/trie.py +0 -0
  205. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/typing/bigquery.py +0 -0
  206. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/typing/duckdb.py +0 -0
  207. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/typing/mysql.py +0 -0
  208. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/typing/presto.py +0 -0
  209. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/typing/redshift.py +0 -0
  210. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/typing/spark2.py +0 -0
  211. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot/typing/tsql.py +0 -0
  212. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot.egg-info/SOURCES.txt +0 -0
  213. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot.egg-info/dependency_links.txt +0 -0
  214. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot.egg-info/top_level.txt +0 -0
  215. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglot.png +0 -0
  216. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglotc/MANIFEST.in +0 -0
  217. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglotc/pyproject.toml +0 -0
  218. {sqlglot-30.7.0 → sqlglot-30.8.0}/sqlglotc/setup.py +0 -0
  219. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/__init__.py +0 -0
  220. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/__init__.py +0 -0
  221. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_athena.py +0 -0
  222. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_clickhouse.py +0 -0
  223. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_doris.py +0 -0
  224. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_dremio.py +0 -0
  225. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_drill.py +0 -0
  226. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_druid.py +0 -0
  227. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_dune.py +0 -0
  228. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_fabric.py +0 -0
  229. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_hive.py +0 -0
  230. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_materialize.py +0 -0
  231. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_oracle.py +0 -0
  232. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_pipe_syntax.py +0 -0
  233. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_presto.py +0 -0
  234. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_prql.py +0 -0
  235. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_redshift.py +0 -0
  236. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_risingwave.py +0 -0
  237. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_singlestore.py +0 -0
  238. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_snowflake.py +0 -0
  239. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_solr.py +0 -0
  240. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_starrocks.py +0 -0
  241. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_tableau.py +0 -0
  242. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_teradata.py +0 -0
  243. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_trino.py +0 -0
  244. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/dialects/test_tsql.py +0 -0
  245. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/identity.sql +0 -0
  246. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/jsonpath/LICENSE +0 -0
  247. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/jsonpath/cts.json +0 -0
  248. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/annotate_types.sql +0 -0
  249. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/canonicalize.sql +0 -0
  250. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/canonicalize_internal_names.sql +0 -0
  251. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
  252. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/eliminate_joins.sql +0 -0
  253. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
  254. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
  255. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
  256. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/normalize.sql +0 -0
  257. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
  258. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
  259. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/optimizer.sql +0 -0
  260. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
  261. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
  262. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/qualify_columns.sql +0 -0
  263. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
  264. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
  265. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
  266. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
  267. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
  268. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/simplify.sql +0 -0
  269. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
  270. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
  271. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
  272. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
  273. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
  274. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
  275. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
  276. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
  277. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
  278. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
  279. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
  280. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
  281. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
  282. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
  283. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
  284. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
  285. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
  286. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
  287. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
  288. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
  289. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
  290. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
  291. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
  292. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
  293. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
  294. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
  295. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
  296. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
  297. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
  298. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
  299. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
  300. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
  301. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
  302. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/optimizer/unnest_subqueries.sql +0 -0
  303. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/partial.sql +0 -0
  304. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/fixtures/pretty.sql +0 -0
  305. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/gen_fixtures.py +0 -0
  306. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/helpers.py +0 -0
  307. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/leakcheck.py +0 -0
  308. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/sqlglot/__init__.py +0 -0
  309. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/test_build.py +0 -0
  310. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/test_dialect_entry_points.py +0 -0
  311. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/test_dialect_imports.py +0 -0
  312. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/test_diff.py +0 -0
  313. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/test_docs.py +0 -0
  314. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/test_errors.py +0 -0
  315. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/test_executor.py +0 -0
  316. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/test_generator.py +0 -0
  317. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/test_helper.py +0 -0
  318. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/test_integration_loader.py +0 -0
  319. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/test_jsonpath.py +0 -0
  320. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/test_lineage.py +0 -0
  321. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/test_schema.py +0 -0
  322. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/test_serde.py +0 -0
  323. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/test_time.py +0 -0
  324. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/test_tokens.py +0 -0
  325. {sqlglot-30.7.0 → sqlglot-30.8.0}/tests/test_transforms.py +0 -0
@@ -1,6 +1,124 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## [v30.7.0] - 2026-05-04
5
+ ### :boom: BREAKING CHANGES
6
+ - due to [`68861d9`](https://github.com/tobymao/sqlglot/commit/68861d9f3aaa6c9ae405dacfa22117fb64a1d803) - support `DROP PRIMARY KEY`. *(PR [#7530](https://github.com/tobymao/sqlglot/pull/7530) by [@burnison](https://github.com/burnison))*:
7
+
8
+ support `DROP PRIMARY KEY`. (#7530)
9
+
10
+ - due to [`8669e55`](https://github.com/tobymao/sqlglot/commit/8669e55f385eb759bbf5ea1ec095e63ec48cfa91) - mark DECOMPRESS_STRING as unsupported [CLAUDE] *(PR [#7545](https://github.com/tobymao/sqlglot/pull/7545) by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*:
11
+
12
+ mark DECOMPRESS_STRING as unsupported [CLAUDE] (#7545)
13
+
14
+ - due to [`b334dcc`](https://github.com/tobymao/sqlglot/commit/b334dccb7f94993e71fa4f0e59d984a3f0d351d0) - mark DECOMPRESS_BINARY as unsupported *(PR [#7546](https://github.com/tobymao/sqlglot/pull/7546) by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*:
15
+
16
+ mark DECOMPRESS_BINARY as unsupported (#7546)
17
+
18
+ - due to [`8f572f8`](https://github.com/tobymao/sqlglot/commit/8f572f8656c9a5a5e45ac25607af6204bca58773) - qualify UNPIVOT on CTE sources *(PR [#7550](https://github.com/tobymao/sqlglot/pull/7550) by [@georgesittas](https://github.com/georgesittas))*:
19
+
20
+ qualify UNPIVOT on CTE sources (#7550)
21
+
22
+ - due to [`b4dea8c`](https://github.com/tobymao/sqlglot/commit/b4dea8c7e4c9e598e33efc56f007a0ab6dab9b5d) - Transpilation support for UUID_STRING *(commit by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*:
23
+
24
+ Transpilation support for UUID_STRING
25
+
26
+ - due to [`e883b0b`](https://github.com/tobymao/sqlglot/commit/e883b0b39ebdeeab408743786f66d62dd92b3267) - map duckdb `LIST` to `ArrayAgg` *(PR [#7552](https://github.com/tobymao/sqlglot/pull/7552) by [@georgesittas](https://github.com/georgesittas))*:
27
+
28
+ map duckdb `LIST` to `ArrayAgg` (#7552)
29
+
30
+ - due to [`ded89c2`](https://github.com/tobymao/sqlglot/commit/ded89c2e8edc6eee14f9fabb3d6fd036cced284a) - Add transpilation support for STRTOK_TO_ARRAY function *(PR [#7536](https://github.com/tobymao/sqlglot/pull/7536) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
31
+
32
+ Add transpilation support for STRTOK_TO_ARRAY function (#7536)
33
+
34
+ - due to [`f743755`](https://github.com/tobymao/sqlglot/commit/f743755e7b9ad45839c9c6f651d199bd5441b661) - register NAMED_STRUCT in parser so struct fields annotate CLAUDE *(PR [#7561](https://github.com/tobymao/sqlglot/pull/7561) by [@RichardHughes-amp](https://github.com/RichardHughes-amp))*:
35
+
36
+ register NAMED_STRUCT in parser so struct fields annotate CLAUDE (#7561)
37
+
38
+ - due to [`4cca3a0`](https://github.com/tobymao/sqlglot/commit/4cca3a017955f310b83988e36be31337859ba9fa) - support arbitrarily many args in JSONArray [CLAUDE] *(PR [#7559](https://github.com/tobymao/sqlglot/pull/7559) by [@maxa-jonathan-hallee](https://github.com/maxa-jonathan-hallee))*:
39
+
40
+ support arbitrarily many args in JSONArray [CLAUDE] (#7559)
41
+
42
+ - due to [`206e2f8`](https://github.com/tobymao/sqlglot/commit/206e2f8926458162ceb124bba651b07e14d43bc0) - full `MODIFY COLUMN` support. *(PR [#7562](https://github.com/tobymao/sqlglot/pull/7562) by [@burnison](https://github.com/burnison))*:
43
+
44
+ full `MODIFY COLUMN` support. (#7562)
45
+
46
+ - due to [`fd48100`](https://github.com/tobymao/sqlglot/commit/fd4810018e2ea602e1c59994ebe517b1c06d7f49) - generate "SUBSTR" instead of "SUBSTRING" for Substr expr *(PR [#7583](https://github.com/tobymao/sqlglot/pull/7583) by [@georgesittas](https://github.com/georgesittas))*:
47
+
48
+ generate "SUBSTR" instead of "SUBSTRING" for Substr expr (#7583)
49
+
50
+ - due to [`17432c6`](https://github.com/tobymao/sqlglot/commit/17432c61175194ee0f56f0703393e8c5fdc9e81f) - do not indent newlines within identifiers in pretty mode fixes [#7953](https://github.com/tobymao/sqlglot/pull/7953) *(commit by [@georgesittas](https://github.com/georgesittas))*:
51
+
52
+ do not indent newlines within identifiers in pretty mode fixes #7953
53
+
54
+
55
+ ### :sparkles: New Features
56
+ - [`cf1c9b7`](https://github.com/tobymao/sqlglot/commit/cf1c9b7c9d6fe5f4b6919e7599182869426f527a) - **tests**: add leakcheck harness for sqlglot[c] *(PR [#7533](https://github.com/tobymao/sqlglot/pull/7533) by [@VaggelisD](https://github.com/VaggelisD))*
57
+ - [`68861d9`](https://github.com/tobymao/sqlglot/commit/68861d9f3aaa6c9ae405dacfa22117fb64a1d803) - **mysql**: support `DROP PRIMARY KEY`. *(PR [#7530](https://github.com/tobymao/sqlglot/pull/7530) by [@burnison](https://github.com/burnison))*
58
+ - [`8669e55`](https://github.com/tobymao/sqlglot/commit/8669e55f385eb759bbf5ea1ec095e63ec48cfa91) - **duckdb**: mark DECOMPRESS_STRING as unsupported [CLAUDE] *(PR [#7545](https://github.com/tobymao/sqlglot/pull/7545) by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*
59
+ - [`b334dcc`](https://github.com/tobymao/sqlglot/commit/b334dccb7f94993e71fa4f0e59d984a3f0d351d0) - **duckdb**: mark DECOMPRESS_BINARY as unsupported *(PR [#7546](https://github.com/tobymao/sqlglot/pull/7546) by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*
60
+ - [`234198a`](https://github.com/tobymao/sqlglot/commit/234198a311c56085b58f72f2871ec42103ff9a19) - **exasol**: transpile USE/OPEN SCHEMA and SHOW TABLES to system-table query *(PR [#7538](https://github.com/tobymao/sqlglot/pull/7538) by [@mkcorneli](https://github.com/mkcorneli))*
61
+ - [`e3fee4d`](https://github.com/tobymao/sqlglot/commit/e3fee4d2dc33b770622831490d2980a837718475) - **snowflake**: transpile DuckDB list() and list_distinct() [CLAUDE] *(PR [#7551](https://github.com/tobymao/sqlglot/pull/7551) by [@maxa-jonathan-hallee](https://github.com/maxa-jonathan-hallee))*
62
+ - [`92aea6b`](https://github.com/tobymao/sqlglot/commit/92aea6bb80902cd1381f5a01dc75fd71c6071296) - **duckdb**: Add UUID v5 unsupported error for Snowflake UUID_STRING transpilation *(commit by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*
63
+ - [`b4dea8c`](https://github.com/tobymao/sqlglot/commit/b4dea8c7e4c9e598e33efc56f007a0ab6dab9b5d) - **snowflake**: Transpilation support for UUID_STRING *(commit by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*
64
+ - [`b828e30`](https://github.com/tobymao/sqlglot/commit/b828e304485fcf9d8696dc7fcf503ccbc78ade99) - **snowflake**: add UUID_IS_STRING_TYPE flag and UUID_STRING parser *(commit by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*
65
+ - [`ded89c2`](https://github.com/tobymao/sqlglot/commit/ded89c2e8edc6eee14f9fabb3d6fd036cced284a) - **duckdb**: Add transpilation support for STRTOK_TO_ARRAY function *(PR [#7536](https://github.com/tobymao/sqlglot/pull/7536) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
66
+ - [`f743755`](https://github.com/tobymao/sqlglot/commit/f743755e7b9ad45839c9c6f651d199bd5441b661) - **hive**: register NAMED_STRUCT in parser so struct fields annotate CLAUDE *(PR [#7561](https://github.com/tobymao/sqlglot/pull/7561) by [@RichardHughes-amp](https://github.com/RichardHughes-amp))*
67
+ - [`4cca3a0`](https://github.com/tobymao/sqlglot/commit/4cca3a017955f310b83988e36be31337859ba9fa) - **duckdb**: support arbitrarily many args in JSONArray [CLAUDE] *(PR [#7559](https://github.com/tobymao/sqlglot/pull/7559) by [@maxa-jonathan-hallee](https://github.com/maxa-jonathan-hallee))*
68
+ - [`3bc8f38`](https://github.com/tobymao/sqlglot/commit/3bc8f3846871d630338fb75761117151cbd9162b) - **oracle**: support `LISTAGG(... ON OVERFLOW ...)` *(PR [#7565](https://github.com/tobymao/sqlglot/pull/7565) by [@galunto](https://github.com/galunto))*
69
+ - [`1a10806`](https://github.com/tobymao/sqlglot/commit/1a10806505db181737065898458fdc669e4a7ce5) - **mypyc**: Enable incremental compilation, deprecate Python 3.9 *(PR [#7574](https://github.com/tobymao/sqlglot/pull/7574) by [@VaggelisD](https://github.com/VaggelisD))*
70
+ - [`d146dcd`](https://github.com/tobymao/sqlglot/commit/d146dcd6efab5f77c2eb1801b1eb882052c2f273) - **lineage**: support all-columns mode and on_node callback *(PR [#7575](https://github.com/tobymao/sqlglot/pull/7575) by [@georgesittas](https://github.com/georgesittas))*
71
+ - [`25552ee`](https://github.com/tobymao/sqlglot/commit/25552eea658e3931a420fca35e186573ac66927b) - **optimizer**: canonicalize internal query names *(PR [#7580](https://github.com/tobymao/sqlglot/pull/7580) by [@georgesittas](https://github.com/georgesittas))*
72
+ - [`fab6ccf`](https://github.com/tobymao/sqlglot/commit/fab6ccf6ec525bc4d78c185068493e26d5e941df) - **duckdb**: Add transpilation support for HEX_ENCODE function *(PR [#7591](https://github.com/tobymao/sqlglot/pull/7591) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
73
+
74
+ ### :bug: Bug Fixes
75
+ - [`8583c2d`](https://github.com/tobymao/sqlglot/commit/8583c2dc2b0b29089faf4376f0782e9db2ea5f27) - correctly handle follow-tokens for unit-less intervals *(PR [#7529](https://github.com/tobymao/sqlglot/pull/7529) by [@jvstein](https://github.com/jvstein))*
76
+ - [`daca12a`](https://github.com/tobymao/sqlglot/commit/daca12a51564199b71a3947dd77e5c5be0c3d60d) - **mysql**: accept quoted charset in `USING`. *(PR [#7522](https://github.com/tobymao/sqlglot/pull/7522) by [@burnison](https://github.com/burnison))*
77
+ - [`6053db6`](https://github.com/tobymao/sqlglot/commit/6053db6a98ceecce937f731ad2cdb560ddd8bcda) - **optimizer**: robust scope for UDTF *(PR [#7535](https://github.com/tobymao/sqlglot/pull/7535) by [@geooo109](https://github.com/geooo109))*
78
+ - [`a88dfce`](https://github.com/tobymao/sqlglot/commit/a88dfce091a0fc61c1a8efbd1b35616f22b387ff) - **mysql**: support SHOW TABLES IN <schema> parsing *(PR [#7537](https://github.com/tobymao/sqlglot/pull/7537) by [@mkcorneli](https://github.com/mkcorneli))*
79
+ - [`0bd0c46`](https://github.com/tobymao/sqlglot/commit/0bd0c46505636355926a84158d4d2f60145f0faf) - **optimizer**: handle ColumnDef in typed table alias columns *(PR [#7542](https://github.com/tobymao/sqlglot/pull/7542) by [@tobymao](https://github.com/tobymao))*
80
+ - [`f387112`](https://github.com/tobymao/sqlglot/commit/f3871121d5f61e3c12dd47cfa700c4452f4fd807) - **parser**: robust CONCAT_WS *(PR [#7544](https://github.com/tobymao/sqlglot/pull/7544) by [@geooo109](https://github.com/geooo109))*
81
+ - :arrow_lower_right: *fixes issue [#7540](https://github.com/tobymao/sqlglot/issues/7540) opened by [@nickhand](https://github.com/nickhand)*
82
+ - [`5351ca1`](https://github.com/tobymao/sqlglot/commit/5351ca128bc48caeb557996ab577d2e89775200f) - **optimizer**: EXPLODE qualify and annotate *(PR [#7549](https://github.com/tobymao/sqlglot/pull/7549) by [@geooo109](https://github.com/geooo109))*
83
+ - :arrow_lower_right: *fixes issue [#7541](https://github.com/tobymao/sqlglot/issues/7541) opened by [@catlynkong](https://github.com/catlynkong)*
84
+ - [`8f572f8`](https://github.com/tobymao/sqlglot/commit/8f572f8656c9a5a5e45ac25607af6204bca58773) - **optimizer**: qualify UNPIVOT on CTE sources *(PR [#7550](https://github.com/tobymao/sqlglot/pull/7550) by [@georgesittas](https://github.com/georgesittas))*
85
+ - [`cf0ffd9`](https://github.com/tobymao/sqlglot/commit/cf0ffd99ef27a4a4764104feb9b1dd2af1c544ce) - **optimizer**: qualify (UN)PIVOT on CTE sources *(PR [#7560](https://github.com/tobymao/sqlglot/pull/7560) by [@georgesittas](https://github.com/georgesittas))*
86
+ - [`2c1a90c`](https://github.com/tobymao/sqlglot/commit/2c1a90ccf82cb8d3c43703bc9698e3872a4166e9) - **clickhouse**: apply version-aware unit lowercase to DateTrunc [CLAUDE] *(PR [#7564](https://github.com/tobymao/sqlglot/pull/7564) by [@markcheney1](https://github.com/markcheney1))*
87
+ - [`206e2f8`](https://github.com/tobymao/sqlglot/commit/206e2f8926458162ceb124bba651b07e14d43bc0) - **mysql**: full `MODIFY COLUMN` support. *(PR [#7562](https://github.com/tobymao/sqlglot/pull/7562) by [@burnison](https://github.com/burnison))*
88
+ - [`6110de6`](https://github.com/tobymao/sqlglot/commit/6110de6b24a2ab37b031d46e319a22c0db6ed27d) - **lineage**: avoid self-loops from cached non-owned upstream nodes *(commit by [@georgesittas](https://github.com/georgesittas))*
89
+ - [`e078e5d`](https://github.com/tobymao/sqlglot/commit/e078e5db72a7ee5fd6011e1e21285e4692befdbd) - **postgres**: TRIM with UNNEST and ORDINALITY *(PR [#7573](https://github.com/tobymao/sqlglot/pull/7573) by [@geooo109](https://github.com/geooo109))*
90
+ - :arrow_lower_right: *fixes issue [#7566](https://github.com/tobymao/sqlglot/issues/7566) opened by [@CPAPI-104](https://github.com/CPAPI-104)*
91
+ - [`a20ec0e`](https://github.com/tobymao/sqlglot/commit/a20ec0ee493bc0836ab44439ef7d0ed68f91f674) - **optimizer**: unpivot annotate types *(PR [#7543](https://github.com/tobymao/sqlglot/pull/7543) by [@geooo109](https://github.com/geooo109))*
92
+ - [`fd48100`](https://github.com/tobymao/sqlglot/commit/fd4810018e2ea602e1c59994ebe517b1c06d7f49) - **presto**: generate "SUBSTR" instead of "SUBSTRING" for Substr expr *(PR [#7583](https://github.com/tobymao/sqlglot/pull/7583) by [@georgesittas](https://github.com/georgesittas))*
93
+ - :arrow_lower_right: *fixes issue [#7581](https://github.com/tobymao/sqlglot/issues/7581) opened by [@cyber-jessie](https://github.com/cyber-jessie)*
94
+ - [`1cf31d6`](https://github.com/tobymao/sqlglot/commit/1cf31d6bd00a1c5ce3fe6722e7ed87c900074ad0) - **annotate**: register typing for FirstValue and RegexpExtract *(commit by [@RichardHughes-amp](https://github.com/RichardHughes-amp))*
95
+ - [`9f169ab`](https://github.com/tobymao/sqlglot/commit/9f169ab17a8ada0a53e2d88c035196db673e37c4) - **redshift**: support `APPROXIMATE PERCENTILE_DISC` round-trip *(PR [#7585](https://github.com/tobymao/sqlglot/pull/7585) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
96
+ - [`17432c6`](https://github.com/tobymao/sqlglot/commit/17432c61175194ee0f56f0703393e8c5fdc9e81f) - **generator**: do not indent newlines within identifiers in pretty mode fixes [#7953](https://github.com/tobymao/sqlglot/pull/7953) *(commit by [@georgesittas](https://github.com/georgesittas))*
97
+ - [`e550d00`](https://github.com/tobymao/sqlglot/commit/e550d008cc6ffa72b046d6406911b256c4a75f8b) - **parser**: FROM with JOIN subqueries *(PR [#7597](https://github.com/tobymao/sqlglot/pull/7597) by [@geooo109](https://github.com/geooo109))*
98
+ - :arrow_lower_right: *fixes issue [#7596](https://github.com/tobymao/sqlglot/issues/7596) opened by [@vietspaceanh](https://github.com/vietspaceanh)*
99
+
100
+ ### :zap: Performance Improvements
101
+ - [`63f8dc6`](https://github.com/tobymao/sqlglot/commit/63f8dc6dfc19d4ae14984d393bc63532c1085e07) - **tokens**: cache TokenizerCore per thread *(PR [#7547](https://github.com/tobymao/sqlglot/pull/7547) by [@tobymao](https://github.com/tobymao))*
102
+ - [`9b65c91`](https://github.com/tobymao/sqlglot/commit/9b65c91f8d510682af203015b561d92ce8a2e477) - **build**: parallelize mypyc compile with -j $(NPROC) *(PR [#7554](https://github.com/tobymao/sqlglot/pull/7554) by [@tobymao](https://github.com/tobymao))*
103
+ - [`fc6e7cb`](https://github.com/tobymao/sqlglot/commit/fc6e7cb093583d44ac4863d770b583e75d45f365) - **parser**: short-circuit _parse_pivots when next token isn't PIVOT/UNPIVOT *(PR [#7557](https://github.com/tobymao/sqlglot/pull/7557) by [@tobymao](https://github.com/tobymao))*
104
+
105
+ ### :recycle: Refactors
106
+ - [`38b8986`](https://github.com/tobymao/sqlglot/commit/38b89860020d4bb7fc7be8408b67852f8cf380ae) - simplify uuid_sql using @unsupported_args decorator *(commit by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*
107
+ - [`49787a5`](https://github.com/tobymao/sqlglot/commit/49787a59dcbcaca97a49cd504c4e35f8db1408a3) - remove redundant CAST from UUID_V5_TEMPLATE *(commit by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*
108
+ - [`e883b0b`](https://github.com/tobymao/sqlglot/commit/e883b0b39ebdeeab408743786f66d62dd92b3267) - map duckdb `LIST` to `ArrayAgg` *(PR [#7552](https://github.com/tobymao/sqlglot/pull/7552) by [@georgesittas](https://github.com/georgesittas))*
109
+ - [`1d976e6`](https://github.com/tobymao/sqlglot/commit/1d976e665a8687e7ca2411a9a2a5139eb5698849) - raise if a projection is unnamed in lineage *(commit by [@georgesittas](https://github.com/georgesittas))*
110
+ - [`b3fa159`](https://github.com/tobymao/sqlglot/commit/b3fa15979866947adbb600ae9b1d24e048997dad) - **optimizer**: continuation on typing coverage improvements *(PR [#7572](https://github.com/tobymao/sqlglot/pull/7572) by [@OutSquareCapital](https://github.com/OutSquareCapital))*
111
+
112
+ ### :white_check_mark: Tests
113
+ - [`9bc9ef2`](https://github.com/tobymao/sqlglot/commit/9bc9ef2e7dfd98a5340167012fa0ea782cca1264) - update UUID_STRING test for removed CAST *(commit by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*
114
+
115
+ ### :wrench: Chores
116
+ - [`fc99ddc`](https://github.com/tobymao/sqlglot/commit/fc99ddc936c095fb813e56cfe10006701ece9893) - update integration tests submodule *(commit by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*
117
+ - [`e4a2fdc`](https://github.com/tobymao/sqlglot/commit/e4a2fdcdaf3e8ac423884e482191e002ab677235) - **exasol**: test GROUP BY alias rewrite via _add_local_prefix_for_aliases *(PR [#7569](https://github.com/tobymao/sqlglot/pull/7569) by [@mkcorneli](https://github.com/mkcorneli))*
118
+ - [`43be379`](https://github.com/tobymao/sqlglot/commit/43be379b75f6e3d8ea66ac3849f4fb5c55736145) - bump sqlglot-mypy to 1.20.0.post6 *(PR [#7598](https://github.com/tobymao/sqlglot/pull/7598) by [@VaggelisD](https://github.com/VaggelisD))*
119
+ - [`9bd7e7c`](https://github.com/tobymao/sqlglot/commit/9bd7e7c83ff1e3c73f6d071a7bd47ec208e25ca4) - **publish**: Do not build sqlglotc wheels for 3.9 *(PR [#7600](https://github.com/tobymao/sqlglot/pull/7600) by [@VaggelisD](https://github.com/VaggelisD))*
120
+
121
+
4
122
  ## [v30.6.0] - 2026-04-20
5
123
  ### :boom: BREAKING CHANGES
6
124
  - due to [`dcf9ed5`](https://github.com/tobymao/sqlglot/commit/dcf9ed58303bf320f3e3498618bd95639037efde) - compile python generator *(PR [#7528](https://github.com/tobymao/sqlglot/pull/7528) by [@georgesittas](https://github.com/georgesittas))*:
@@ -14244,3 +14362,4 @@ pip install "sqlglot[c]" # compiled — faster, but no subclassing
14244
14362
  [v30.4.3]: https://github.com/tobymao/sqlglot/compare/v30.4.2...v30.4.3
14245
14363
  [v30.5.0]: https://github.com/tobymao/sqlglot/compare/v30.4.3...v30.5.0
14246
14364
  [v30.6.0]: https://github.com/tobymao/sqlglot/compare/v30.5.0...v30.6.0
14365
+ [v30.7.0]: https://github.com/tobymao/sqlglot/compare/v30.6.0...v30.7.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlglot
3
- Version: 30.7.0
3
+ Version: 30.8.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.7.0; python_version >= "3.10" and extra == "c"
37
+ Requires-Dist: sqlglotc==30.8.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.7.0; python_version >= "3.10" and extra == "rs"
40
+ Requires-Dist: sqlglotc==30.8.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.7.0'
22
- __version_tuple__ = version_tuple = (30, 7, 0)
21
+ __version__ = version = '30.8.0'
22
+ __version_tuple__ = version_tuple = (30, 8, 0)
23
23
 
24
- __commit_id__ = commit_id = 'g693f4ed6d'
24
+ __commit_id__ = commit_id = 'g9e37283ab'
@@ -1219,7 +1219,9 @@ def inline_array_unless_query(self: Generator, expression: exp.Expr) -> str:
1219
1219
  def no_ilike_sql(self: Generator, expression: exp.ILike) -> str:
1220
1220
  return self.like_sql(
1221
1221
  exp.Like(
1222
- this=exp.Lower(this=expression.this), expression=exp.Lower(this=expression.expression)
1222
+ this=exp.Lower(this=expression.this),
1223
+ expression=exp.Lower(this=expression.expression),
1224
+ negate=expression.args.get("negate"),
1223
1225
  )
1224
1226
  )
1225
1227
 
@@ -1538,28 +1540,32 @@ def months_between_sql(self: Generator, expression: exp.MonthsBetween) -> str:
1538
1540
 
1539
1541
 
1540
1542
  def build_formatted_time(
1541
- exp_class: Type[E], dialect: str, default: bool | str | None = None
1542
- ) -> t.Callable[[BuilderArgs], E]:
1543
+ exp_class: Type[E], dialect_override: str | None = None, default: bool | str | None = None
1544
+ ) -> t.Callable[[BuilderArgs, Dialect], E]:
1543
1545
  """Helper used for time expressions.
1544
1546
 
1545
1547
  Args:
1546
1548
  exp_class: the expression class to instantiate.
1547
- dialect: target sql dialect.
1549
+ dialect_override: optional sql dialect to override the parser's one.
1548
1550
  default: the default format, True being time.
1549
1551
 
1550
1552
  Returns:
1551
1553
  A callable that can be used to return the appropriately formatted time expression.
1552
1554
  """
1553
1555
 
1554
- def _builder(args: BuilderArgs) -> E:
1555
- return exp_class(
1556
- this=seq_get(args, 0),
1557
- format=Dialect[dialect].format_time(
1558
- seq_get(args, 1)
1559
- or (Dialect[dialect].TIME_FORMAT if default is True else default or None)
1560
- ),
1556
+ def _builder(args: BuilderArgs, dialect: Dialect) -> E:
1557
+ target_dialect = (
1558
+ t.cast(Dialect, Dialect[dialect_override])
1559
+ if isinstance(dialect_override, str)
1560
+ else dialect
1561
1561
  )
1562
1562
 
1563
+ fmt = seq_get(args, 1)
1564
+ if not fmt:
1565
+ fmt = target_dialect.TIME_FORMAT if default is True else default or None
1566
+
1567
+ return exp_class(this=seq_get(args, 0), format=target_dialect.format_time(fmt))
1568
+
1563
1569
  return _builder
1564
1570
 
1565
1571
 
@@ -2463,8 +2469,7 @@ def build_timetostr_or_tochar(
2463
2469
  annotate_types(this, dialect=dialect)
2464
2470
 
2465
2471
  if this.is_type(*exp.DataType.TEMPORAL_TYPES):
2466
- dialect_name = dialect.__class__.__name__.lower()
2467
- return build_formatted_time(exp.TimeToStr, dialect_name, default=True)(args)
2472
+ return build_formatted_time(exp.TimeToStr, default=True)(args, t.cast(Dialect, dialect))
2468
2473
 
2469
2474
  return exp.ToChar.from_arg_list(args)
2470
2475
 
@@ -98,6 +98,7 @@ class Postgres(Dialect):
98
98
  "SERIAL": TokenType.SERIAL,
99
99
  "SMALLSERIAL": TokenType.SMALLSERIAL,
100
100
  "TEMP": TokenType.TEMPORARY,
101
+ "TYPE": TokenType.TYPE,
101
102
  "REGCLASS": TokenType.OBJECT_IDENTIFIER,
102
103
  "REGCOLLATION": TokenType.OBJECT_IDENTIFIER,
103
104
  "REGCONFIG": TokenType.OBJECT_IDENTIFIER,
@@ -24,7 +24,12 @@ class Redshift(Postgres):
24
24
 
25
25
  # ref: https://docs.aws.amazon.com/redshift/latest/dg/r_FORMAT_strings.html
26
26
  TIME_FORMAT = "'YYYY-MM-DD HH24:MI:SS'"
27
- TIME_MAPPING = {**Postgres.TIME_MAPPING, "MON": "%b", "HH24": "%H", "HH": "%I"}
27
+
28
+ TIME_MAPPING = {
29
+ **Postgres.TIME_MAPPING,
30
+ "MON": "%b",
31
+ "MONTH": "%B",
32
+ }
28
33
 
29
34
  Parser = RedshiftParser
30
35
 
@@ -36,13 +41,15 @@ class Redshift(Postgres):
36
41
  KEYWORDS = {
37
42
  **Postgres.Tokenizer.KEYWORDS,
38
43
  "(+)": TokenType.JOIN_MARKER,
44
+ "BINARY VARYING": TokenType.VARBINARY,
45
+ "CURRENT_USER_ID": TokenType.CURRENT_USER_ID,
39
46
  "HLLSKETCH": TokenType.HLLSKETCH,
40
47
  "MINUS": TokenType.EXCEPT,
41
48
  "SUPER": TokenType.SUPER,
42
49
  "TOP": TokenType.TOP,
43
50
  "UNLOAD": TokenType.COMMAND,
51
+ "USER": TokenType.CURRENT_USER,
44
52
  "VARBYTE": TokenType.VARBINARY,
45
- "BINARY VARYING": TokenType.VARBINARY,
46
53
  }
47
54
  KEYWORDS.pop("VALUES")
48
55
 
@@ -365,5 +365,5 @@ class StDistance(Expression, Func):
365
365
 
366
366
 
367
367
  class StPoint(Expression, Func):
368
- arg_types = {"this": True, "expression": True, "null": False}
368
+ arg_types = {"this": True, "expression": True, "z": False, "m": False}
369
369
  _sql_names = ["ST_POINT", "ST_MAKEPOINT"]
@@ -2135,7 +2135,7 @@ class GTE(Expression, Binary, Predicate):
2135
2135
 
2136
2136
 
2137
2137
  class ILike(Expression, Binary, Predicate):
2138
- pass
2138
+ arg_types = {"this": True, "expression": True, "negate": False}
2139
2139
 
2140
2140
 
2141
2141
  class IntDiv(Expression, Binary):
@@ -2147,7 +2147,7 @@ class Is(Expression, Binary, Predicate):
2147
2147
 
2148
2148
 
2149
2149
  class Like(Expression, Binary, Predicate):
2150
- pass
2150
+ arg_types = {"this": True, "expression": True, "negate": False}
2151
2151
 
2152
2152
 
2153
2153
  class Match(Expression, Binary, Predicate):
@@ -178,6 +178,7 @@ class DataType(Expression):
178
178
  "values": False,
179
179
  "kind": False,
180
180
  "nullable": False,
181
+ "collate": False,
181
182
  }
182
183
 
183
184
  Type: t.ClassVar[Type[DType]] = DType
@@ -246,7 +246,7 @@ class AlterColumn(Expression):
246
246
 
247
247
 
248
248
  class ModifyColumn(Expression):
249
- pass
249
+ arg_types = {"this": True, "rename_from": False}
250
250
 
251
251
 
252
252
  class AlterIndex(Expression):
@@ -148,6 +148,10 @@ class Nullif(Expression, Func):
148
148
  arg_types = {"this": True, "expression": True}
149
149
 
150
150
 
151
+ class ObjectTransform(Expression, Func):
152
+ arg_types = {"this": True, "keep": False, "set_": False}
153
+
154
+
151
155
  class Nvl2(Expression, Func):
152
156
  arg_types = {"this": True, "true": True, "false": False}
153
157
 
@@ -301,6 +305,10 @@ class CurrentUser(Expression, Func):
301
305
  arg_types = {"this": False}
302
306
 
303
307
 
308
+ class CurrentUserId(Expression, Func):
309
+ arg_types = {}
310
+
311
+
304
312
  class CurrentVersion(Expression, Func):
305
313
  arg_types = {}
306
314
 
@@ -1763,14 +1763,15 @@ class Pivot(Expression):
1763
1763
  def fields(self) -> list[Expr]:
1764
1764
  return self.args.get("fields", [])
1765
1765
 
1766
- def output_columns(self, pre_pivot_columns: t.Iterable[str]) -> list[str]:
1766
+ def output_columns(self, pre_pivot_columns: t.Iterable[str]) -> dict[str, str]:
1767
1767
  """
1768
- Returns the columns produced by this (UN)PIVOT, in order.
1768
+ Returns an ordered map of post-rename output column name -> pre-rename
1769
+ source-side name, in the order the (UN)PIVOT produces them.
1769
1770
 
1770
- Example:
1771
+ For callers that just want the names, iterate the dict (or call .keys()):
1771
1772
  >>> from sqlglot import parse_one, exp
1772
1773
  >>> piv = parse_one("SELECT * FROM t UNPIVOT(val FOR name IN (a, b))").find(exp.Pivot)
1773
- >>> piv.output_columns(["a", "b", "c"])
1774
+ >>> list(piv.output_columns(["a", "b", "c"]))
1774
1775
  ['c', 'name', 'val']
1775
1776
 
1776
1777
  AST shape:
@@ -1813,9 +1814,23 @@ class Pivot(Expression):
1813
1814
  outputs = [c.alias_or_name for c in self.expressions]
1814
1815
 
1815
1816
  if not excluded or not outputs:
1816
- return []
1817
+ return {}
1818
+
1819
+ pre_rename = [c for c in pre_pivot_columns if c not in excluded] + outputs
1820
+
1821
+ alias = self.args.get("alias")
1822
+ renames = alias.args.get("columns") if alias else None
1823
+
1824
+ # `PIVOT(...) AS alias(c1, c2, ...)` renames the operator's output columns
1825
+ # positionally from the front (DuckDB, Snowflake): the user's names cover
1826
+ # the leading N output columns, remaining columns keep their auto names.
1827
+ if renames:
1828
+ rename_names = [r.name for r in renames]
1829
+ post_rename = rename_names + pre_rename[len(rename_names) :]
1830
+ else:
1831
+ post_rename = pre_rename
1817
1832
 
1818
- return [c for c in pre_pivot_columns if c not in excluded] + outputs
1833
+ return dict(zip(post_rename, pre_rename))
1819
1834
 
1820
1835
 
1821
1836
  class UnpivotColumns(Expression):
@@ -303,17 +303,13 @@ class FromBase64(Expression, Func):
303
303
 
304
304
 
305
305
  class Hex(Expression, Func):
306
- pass
306
+ arg_types = {"this": True, "case": False}
307
307
 
308
308
 
309
309
  class HexDecodeString(Expression, Func):
310
310
  pass
311
311
 
312
312
 
313
- class HexEncode(Expression, Func):
314
- arg_types = {"this": True, "case": False}
315
-
316
-
317
313
  class LowerHex(Hex):
318
314
  pass
319
315
 
@@ -446,6 +446,9 @@ class Generator:
446
446
  # Whether named columns are allowed in table aliases
447
447
  SUPPORTS_TABLE_ALIAS_COLUMNS = True
448
448
 
449
+ # Whether named columns are allowed in CTE definitions
450
+ SUPPORTS_NAMED_CTE_COLUMNS = True
451
+
449
452
  # Whether UNPIVOT aliases are Identifiers (False means they're Literals)
450
453
  UNPIVOT_ALIASES_ARE_IDENTIFIERS = True
451
454
 
@@ -467,6 +470,9 @@ class Generator:
467
470
  # Whether ALTER TABLE ... MODIFY COLUMN column-redefinition syntax is supported
468
471
  SUPPORTS_MODIFY_COLUMN = False
469
472
 
473
+ # Whether ALTER TABLE ... CHANGE COLUMN column-rename-and-redefine syntax is supported
474
+ SUPPORTS_CHANGE_COLUMN = False
475
+
470
476
  # Whether the LikeProperty needs to be specified inside of the schema clause
471
477
  LIKE_PROPERTY_INSIDE_SCHEMA = False
472
478
 
@@ -620,6 +626,11 @@ class Generator:
620
626
 
621
627
  UNSUPPORTED_TYPES: t.ClassVar[set[exp.DType]] = set()
622
628
 
629
+ # mapping of DType to its default parameters, bounds
630
+ TYPE_PARAM_SETTINGS: t.ClassVar[
631
+ dict[exp.DType, tuple[tuple[int, ...], tuple[int | None, ...]]]
632
+ ] = {}
633
+
623
634
  TIME_PART_SINGULARS: t.ClassVar = {
624
635
  "MICROSECONDS": "MICROSECOND",
625
636
  "SECONDS": "SECOND",
@@ -1526,7 +1537,11 @@ class Generator:
1526
1537
  columns = self.expressions(expression, key="columns", flat=True)
1527
1538
  columns = f"({columns})" if columns else ""
1528
1539
 
1529
- if columns and not self.SUPPORTS_TABLE_ALIAS_COLUMNS:
1540
+ if (
1541
+ columns
1542
+ and not self.SUPPORTS_TABLE_ALIAS_COLUMNS
1543
+ and not (self.SUPPORTS_NAMED_CTE_COLUMNS and isinstance(expression.parent, exp.CTE))
1544
+ ):
1530
1545
  columns = ""
1531
1546
  self.unsupported("Named columns are not supported in table alias.")
1532
1547
 
@@ -1629,11 +1644,59 @@ class Generator:
1629
1644
  specifier = f" {specifier}" if specifier and self.DATA_TYPE_SPECIFIERS_ALLOWED else ""
1630
1645
  return f"{this}{specifier}"
1631
1646
 
1647
+ def datatype_param_bound_limiter(
1648
+ self,
1649
+ expression: exp.DataType,
1650
+ type_value: exp.DType,
1651
+ defaults: tuple[int, ...],
1652
+ bounds: tuple[int | None, ...],
1653
+ ) -> exp.DataType:
1654
+ params = expression.expressions
1655
+
1656
+ if not params:
1657
+ if defaults:
1658
+ expression.set(
1659
+ "expressions",
1660
+ [exp.DataTypeParam(this=exp.Literal.number(d)) for d in defaults],
1661
+ )
1662
+ return expression
1663
+
1664
+ if not bounds:
1665
+ return expression
1666
+
1667
+ for i, param in enumerate(params):
1668
+ bound = bounds[i] if i < len(bounds) else None
1669
+ if bound is None:
1670
+ continue
1671
+
1672
+ param_value = param.this if isinstance(param, exp.DataTypeParam) else param
1673
+ if (
1674
+ isinstance(param_value, exp.Literal)
1675
+ and param_value.is_number
1676
+ and int(param_value.to_py()) > bound
1677
+ ):
1678
+ self.unsupported(
1679
+ f"{type_value.value} parameter {param_value.name} exceeds "
1680
+ f"{self.dialect.__class__.__name__}'s maximum of {bound}; capping"
1681
+ )
1682
+ params[i] = exp.DataTypeParam(this=exp.Literal.number(bound))
1683
+
1684
+ return expression
1685
+
1632
1686
  def datatype_sql(self, expression: exp.DataType) -> str:
1633
1687
  nested = ""
1634
1688
  values = ""
1635
1689
 
1636
1690
  expr_nested = expression.args.get("nested")
1691
+ type_value = expression.this
1692
+
1693
+ if (
1694
+ not expr_nested
1695
+ and isinstance(type_value, exp.DType)
1696
+ and (settings := self.TYPE_PARAM_SETTINGS.get(type_value))
1697
+ ):
1698
+ expression = self.datatype_param_bound_limiter(expression, type_value, *settings)
1699
+
1637
1700
  interior = (
1638
1701
  self.expressions(
1639
1702
  expression, dynamic=True, new_line=True, skip_first=True, skip_last=True
@@ -1642,7 +1705,6 @@ class Generator:
1642
1705
  else self.expressions(expression, flat=True)
1643
1706
  )
1644
1707
 
1645
- type_value = expression.this
1646
1708
  if type_value in self.UNSUPPORTED_TYPES:
1647
1709
  self.unsupported(
1648
1710
  f"Data type {type_value.value} is not supported when targeting {self.dialect.__class__.__name__}"
@@ -1679,6 +1741,10 @@ class Generator:
1679
1741
  ):
1680
1742
  type_sql = f"{type_sql} WITH TIME ZONE"
1681
1743
 
1744
+ collate = self.sql(expression, "collate")
1745
+ if collate:
1746
+ type_sql = f"{type_sql} COLLATE {collate}"
1747
+
1682
1748
  return type_sql
1683
1749
 
1684
1750
  def directory_sql(self, expression: exp.Directory) -> str:
@@ -3944,9 +4010,15 @@ class Generator:
3944
4010
  return f"ALTER COLUMN {this} DROP DEFAULT"
3945
4011
 
3946
4012
  def modifycolumn_sql(self, expression: exp.ModifyColumn) -> str:
4013
+ this = self.sql(expression, "this")
4014
+ rename_from = self.sql(expression, "rename_from")
4015
+ if rename_from:
4016
+ if not self.SUPPORTS_CHANGE_COLUMN:
4017
+ self.unsupported("CHANGE COLUMN is not supported in this dialect")
4018
+ return f"CHANGE COLUMN {rename_from} {this}"
3947
4019
  if not self.SUPPORTS_MODIFY_COLUMN:
3948
4020
  self.unsupported("MODIFY COLUMN is not supported in this dialect")
3949
- return f"MODIFY COLUMN {self.sql(expression, 'this')}"
4021
+ return f"MODIFY COLUMN {this}"
3950
4022
 
3951
4023
  def alterindex_sql(self, expression: exp.AlterIndex) -> str:
3952
4024
  this = self.sql(expression, "this")
@@ -4193,6 +4265,9 @@ class Generator:
4193
4265
  exp_class = exp.ILike
4194
4266
  op = "ILIKE"
4195
4267
 
4268
+ if expression.args.get("negate"):
4269
+ op = f"NOT {op}"
4270
+
4196
4271
  if isinstance(rhs, (exp.All, exp.Any)) and not self.SUPPORTS_LIKE_QUANTIFIERS:
4197
4272
  exprs = rhs.this.unnest()
4198
4273
 
@@ -4204,7 +4279,9 @@ class Generator:
4204
4279
  connective = exp.or_ if isinstance(rhs, exp.Any) else exp.and_
4205
4280
 
4206
4281
  def _make_like(expr: exp.Expression) -> exp.Expression:
4207
- like: exp.Expression = exp_class(this=this, expression=expr)
4282
+ like: exp.Expression = exp_class(
4283
+ this=this, expression=expr, negate=expression.args.get("negate")
4284
+ )
4208
4285
  if escape:
4209
4286
  like = exp.Escape(this=like, expression=escape.expression.copy())
4210
4287
  return like
@@ -232,6 +232,7 @@ class BigQueryGenerator(generator.Generator):
232
232
  COLLATE_IS_FUNC = True
233
233
  LIMIT_ONLY_LITERALS = True
234
234
  SUPPORTS_TABLE_ALIAS_COLUMNS = False
235
+ SUPPORTS_NAMED_CTE_COLUMNS = False
235
236
  UNPIVOT_ALIASES_ARE_IDENTIFIERS = False
236
237
  JSON_KEY_VALUE_PAIR_SEP = ","
237
238
  NULL_ORDERING_SUPPORTED: bool | None = False
@@ -1581,6 +1581,7 @@ class DuckDBGenerator(generator.Generator):
1581
1581
  f"CAST(STRFTIME({self.sql(e, 'this')}, {self.dialect.DATEINT_FORMAT}) AS INT)"
1582
1582
  ),
1583
1583
  exp.Decode: lambda self, e: encode_decode_sql(self, e, "DECODE", replace=False),
1584
+ exp.HexDecodeString: lambda self, e: self.sql(exp.Decode(this=exp.Unhex(this=e.this))),
1584
1585
  exp.DiToDate: lambda self, e: (
1585
1586
  f"CAST(STRPTIME(CAST({self.sql(e, 'this')} AS TEXT), {self.dialect.DATEINT_FORMAT}) AS DATE)"
1586
1587
  ),
@@ -1727,7 +1728,7 @@ class DuckDBGenerator(generator.Generator):
1727
1728
  exp.DType.BPCHAR: "TEXT",
1728
1729
  exp.DType.CHAR: "TEXT",
1729
1730
  exp.DType.DATETIME: "TIMESTAMP",
1730
- exp.DType.DECFLOAT: "DECIMAL(38, 5)",
1731
+ exp.DType.DECFLOAT: "DECIMAL",
1731
1732
  exp.DType.FLOAT: "REAL",
1732
1733
  exp.DType.JSONB: "JSON",
1733
1734
  exp.DType.NCHAR: "TEXT",
@@ -1741,7 +1742,13 @@ class DuckDBGenerator(generator.Generator):
1741
1742
  exp.DType.TIMESTAMP_S: "TIMESTAMP_S",
1742
1743
  exp.DType.TIMESTAMP_MS: "TIMESTAMP_MS",
1743
1744
  exp.DType.TIMESTAMP_NS: "TIMESTAMP_NS",
1744
- exp.DType.BIGDECIMAL: "DECIMAL(38, 5)",
1745
+ exp.DType.BIGDECIMAL: "DECIMAL",
1746
+ }
1747
+
1748
+ TYPE_PARAM_SETTINGS = {
1749
+ **generator.Generator.TYPE_PARAM_SETTINGS,
1750
+ exp.DType.BIGDECIMAL: ((38, 5), (38, 38)),
1751
+ exp.DType.DECFLOAT: ((38, 5), (38, 38)),
1745
1752
  }
1746
1753
 
1747
1754
  # https://github.com/duckdb/duckdb/blob/ff7f24fd8e3128d94371827523dae85ebaf58713/third_party/libpg_query/grammar/keywords/reserved_keywords.list#L1-L77
@@ -3607,15 +3614,13 @@ class DuckDBGenerator(generator.Generator):
3607
3614
 
3608
3615
  return self.sql(result)
3609
3616
 
3610
- def hexencode_sql(self, expression: exp.HexEncode) -> str:
3611
- arg = expression.this
3617
+ def hex_sql(self, expression: exp.Hex) -> str:
3612
3618
  case = expression.args.get("case")
3613
- hex_expr = exp.Hex(this=arg)
3614
3619
 
3615
3620
  if not case:
3616
- return self.sql(hex_expr)
3621
+ return self.func("HEX", expression.this)
3617
3622
 
3618
- # Emit runtime CASE WHEN to handle NULL propagation and case=0 (lowercase) vs case=1 (uppercase)
3623
+ hex_expr = exp.Hex(this=expression.this)
3619
3624
  return self.sql(
3620
3625
  exp.case()
3621
3626
  .when(case.is_(exp.null()), exp.null())