sqlglot icon indicating copy to clipboard operation
sqlglot copied to clipboard

Python SQL Parser and Transpiler

Results 37 sqlglot issues
Sort by recently updated
recently updated
newest added

fix: #3534 Context: ```python class AlterColumn(Expression): arg_types = { "this": True, "dtype": False, "collate": False, "using": False, "default": False, "drop": False, "comment": False, } ``` The existing `AlterColumn` expression seems...

Before #3706 in v25.3.2: ```python >>> sqlglot.__version__ '25.3.1' >>> sqlglot.transpile('SELECT foo::INT FROM bar', read='tsql', write='tsql') ['SELECT CAST(foo AS INTEGER) FROM bar'] >>> sqlglot.transpile('SELECT foo::INT FROM bar', read='postgres', write='tsql') ['SELECT CAST(foo...

**Before you file an issue** - Make sure you specify the "read" dialect eg. `parse_one(sql, read="spark")` - Make sure you specify the "write" dialect eg. `ast.sql(dialect="duckdb")` - Check if the...

There are a couple of mistakes when translating from Spark to DuckDB **Fully reproducible code snippet** ```python from sqlglot import parse_one query = """SELECT SHA2(str, 256), ANY_VALUE(str2, true), FIRST(str3, true),...

Fixes #3962 This PR adds support for the following: - Default initialize `exp.UNNEST` to include "unnest" as the default table alias if not specified - Added expression type of `exp.Inline`...

OUTSTANDING QUESTION: How to handle removing UTC offset for python < 3.11 where `datetime.datetime.fromisoformat()` can't parse strings containing fractional seconds - `dateutil` library? ---- Clickhouse has two datetime types: -...

The Optimizer cannot infer the correct type for a given expression when analyzing a query with a `UNION ALL` clause with multiple tables (3 or more). It relies on the...