Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when trying to insert rows with async_insert=1 setting using pyodbc #424

Open
pashkov-v opened this issue Jul 10, 2023 · 0 comments

Comments

@pashkov-v
Copy link

When trying to insert rows (even a single row) into table using pyodbc Python package with user-level async_insert=1 setting or with SETTINGS async_insert=1 inside the query, I receive the following error:

DB::Exception: Substitution `odbc_positional_1` is not set: While executing WaitForAsyncInsert.
(UNKNOWN_QUERY_PARAMETER) (version 23.3.5.9 (official build))

Everything works fine when async_insert=0 or when using isql utility from unixODBC.

OS: Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-76-generic x86_64)
ODBC Drivers Manager: unixODBC 2.3.9-5
ClickHouse ODBC driver: 1.2.1.20220905 (built from sources according to this doc)
ClickHouse server: 23.3
Python: 3.8.17
Pyodbc: 4.0.39

There is also a more general question if it is possible to make bulk inserts with pyodbc + clickhouse-odbc driver, because it seems like pyodbc makes inserts row by row, according to logs. It takes 20 seconds to insert 1000 rows into table with 3 columns (Int64, Float64 and String types) when using pyodbc.Cursor.executemany() even with fast_executemany=True.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant