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

SNOW-874655: Cursor.executemany does not support insert overwrite #1662

Open
recrsn opened this issue Jul 24, 2023 · 1 comment
Open

SNOW-874655: Cursor.executemany does not support insert overwrite #1662

recrsn opened this issue Jul 24, 2023 · 1 comment
Labels
feature status-triage_done Initial triage done, will be further handled by the driver team

Comments

@recrsn
Copy link

recrsn commented Jul 24, 2023

Python version

Python 3.9.17

Operating system and processor architecture

macOS-13.4.1-arm64-arm-64bit

Installed packages

asn1crypto==1.5.1
certifi==2023.5.7
cffi==1.15.1
charset-normalizer==3.1.0
cryptography==40.0.2
filelock==3.12.0
idna==3.4
oscrypto==1.3.0
packaging==23.1
pycparser==2.21
pycryptodomex==3.18.0
PyJWT==2.7.0
pyOpenSSL==23.1.1
pytz==2023.3
requests==2.31.0
snowflake-connector-python==3.0.4
sortedcontainers==2.4.0
typing_extensions==4.6.0
urllib3==1.26.16

What did you do?

# Tried to use insert overwrite with `cursor.executemany` like this:
# We are using `pyformat` binding, this setting is not in our control


conn = snowflake.connector.connect( ... )
rows_to_insert = [('milk', 2), ('apple', 3), ('egg', 2)]
conn.cursor().executemany(
    "INSERT OVERWRITE INTO GROCERY (ITEM, QUANTITY) values (%s, %s)",
    rows_to_insert)


# Logs indicate that Snowflake connector python is running one `INSERT OVERWRITE` per row.
# This defeats the purpose of `INSERT OVERWRITE`

What did you expect to see?

INSERT OVERWRITE to run as expected like INSERT does.

Can you set logging to DEBUG and collect the logs?

No response

@github-actions github-actions bot changed the title Cursor.executemany does not support insert overwrite SNOW-874655: Cursor.executemany does not support insert overwrite Jul 24, 2023
@sfc-gh-dszmolka
Copy link

thank you for raising this Issue with us - we'll consider adding this enhancement.

@sfc-gh-dszmolka sfc-gh-dszmolka added status-triage_done Initial triage done, will be further handled by the driver team and removed triaged labels Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature status-triage_done Initial triage done, will be further handled by the driver team
Projects
None yet
Development

No branches or pull requests

3 participants