-
Notifications
You must be signed in to change notification settings - Fork 116
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-1665955: Semicolon breaks DataFrame.count() #2299
Comments
Hello @Tim-Kracht , Thanks for raising the issue, we are looking into it, will update. Regards, |
Hello @Tim-Kracht , The semicolon (;) is typically used to terminate SQL statements in interactive environments like SnowSQL, Snowflake Worksheets, or UI-based tools, where multiple queries can be executed in sequence. However, when executing SQL queries programmatically (such as through the Snowpark API, Python connectors, or other programmatic interfaces), the semicolon is not required and can lead to errors if included. Programmatic interfaces treat each query separately, so the semicolon is unnecessary and can cause syntax errors. To fix the issue:
Regards, |
Thank you. Yes, I noted that it works when removing the semicolon. I was mostly noting the inconsistent behavior:
In other words, why does Dataframe.collect() work with the semicolon, but Dataframe.count() does not? Given the same query, I would expect both to work or both to fail. |
Please answer these questions before submitting your issue. Thanks!
Python 3.11.10 (main, Sep 7 2024, 01:03:31) [Clang 15.0.0 (clang-1500.3.9.4)]
macOS-14.6.1-arm64-arm-64bit
pip freeze
)?asn1crypto==1.5.1
certifi==2024.8.30
cffi==1.17.1
charset-normalizer==3.3.2
cloudpickle==2.2.1
cryptography==43.0.1
filelock==3.16.0
idna==3.8
packaging==24.1
platformdirs==4.3.2
pycparser==2.22
PyJWT==2.9.0
pyOpenSSL==24.2.1
python-dotenv==1.0.1
pytz==2024.2
PyYAML==6.0.2
requests==2.32.3
snowflake-connector-python==3.12.1
snowflake-snowpark-python==1.21.1
sortedcontainers==2.4.0
tomlkit==0.13.2
typing_extensions==4.12.2
urllib3==2.2.2
Called
Session.sql()
for a query that ends with a;
then calledDataFrame.collect()
andDataFrame.count()
I expected to see the same behavior from a SQL compilation perspective.
DataFrame.collect()
worked as expected,DataFrame.count()
raised aSQL compilation error
The same query without the semicolon runs fine in both cases.
The text was updated successfully, but these errors were encountered: