You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tested this extension with a simple sql and I found two bugs
It does not work if the previous statement does not ends with ORDER BY
It causes error with bind parameter
Example:
importduckdbimportpolarsaspldf=pl.DataFrame({'a': [1, 2, 3]})
duckdb.execute('load psql')
duckdb.execute('from df select * where a >= 2 |> order by a desc')
# ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^# duckdb.duckdb.CatalogException: Catalog Error: Scalar Function with name |>__postfix does not exist!# Did you mean "!__postfix"?## LINE 1: from df select * where a >= 2 |> order by a descduckdb.execute('from df select * where a >= 2 order by a asc |> order by a desc')
# OKduckdb.execute('from df select * where a >= ? order by a asc |> order by a desc', [2])
# ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^# duckdb.duckdb.InvalidInputException: Invalid Input Error: Parameter argument/count mismatch, identifiers of the excess parameters: 1
duckdb version: 1.2.0
The text was updated successfully, but these errors were encountered:
In the first case (from df select * where a >= 2 |> order by a desc) I think this is recognized as a proper DuckDB SQL expression, i.e. DuckDB does not call the PSQL parser extension. A crude hack would be to add more brackets to the statement, e.g. (from df select * where a >= 2) |> order by a desc.
I don't see a simple way to solve these issues without making pipes a first-class citizen in DuckDB (rather than being relegated to an extension).
Hi,
I tested this extension with a simple sql and I found two bugs
ORDER BY
Example:
duckdb version: 1.2.0
The text was updated successfully, but these errors were encountered: