-
Notifications
You must be signed in to change notification settings - Fork 152
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
SNOW-1222806: MULTI_STATEMENT_COUNT parameter doesn't work in Snowflake SQLAlchemy #475
Comments
Looks like SQLAlchemy runs |
Fixed by rewriting sqlalchemy cursor command via sqlalchemy from sqlalchemy import event
@event.listens_for(<engine>, 'do_execute')
def do_execute(cursor, statement, parameters, context):
return cursor.execute(statement, parameters, num_statements=0)
Any better option to fix it? Maybe I miss something? |
Hello @alexgrand , Thank you for bringing up this matter. Currently, the MULTI_STATEMENT_COUNT parameter isn't supported for Snowflake SQLAlchemy. However, there are plans to tentatively support it in Q2 2024. Regards, |
Has there been any movement on adding this feature? In my understanding, Snowflake performs query planning optimization when presented with multiple SQL statements at once - this optimization would be lost if queries are submitted one at a time. I believe that makes this feature essential. |
This works for me also, but did you find any way of doing performance logging on each of the individual queries in the multi-query file? |
Please answer these questions before submitting your issue. Thanks!
What version of Python are you using?
Python 3.10.12 (main, Jul 21 2023, 13:21:20) [GCC 11.3.0]
What operating system and processor architecture are you using?
Linux-5.19.0-50-generic-x86_64-with-glibc2.35
What are the component versions in the environment (
pip freeze
)?Snowflake connector, sqlalchemy:
What did you do?
What did you expect to see?
I expect to be able to run several statements in one SQL statement from file.
Snowflake SQLAlchemy works same as python snowflake connector ^version 2.9.0
The text was updated successfully, but these errors were encountered: