-
Notifications
You must be signed in to change notification settings - Fork 151
SNOW-2356405: dbapi pyodbc and udtf fixes #3805
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
Merged
sfc-gh-aling
merged 10 commits into
main
from
SNOW-2356405-dbapi-stored-proc-local-ingestion-perf-vs-jdbc-perf
Sep 26, 2025
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2308514
pyodbc fixes
sfc-gh-aling 8d0b7f2
Merge branch 'main' into SNOW-2356405-dbapi-stored-proc-local-ingesti…
sfc-gh-aling 0d6edd2
fix test failure
sfc-gh-aling b652cae
Merge remote-tracking branch 'origin/SNOW-2356405-dbapi-stored-proc-l…
sfc-gh-aling c017657
fix tests
sfc-gh-aling 343acd7
merge main
sfc-gh-aling 77aa250
fix exception class
sfc-gh-aling 464dc3a
fix
sfc-gh-aling b2f4d9b
update fetch size
sfc-gh-aling c10255c
merge changelog
sfc-gh-aling File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 30 additions & 1 deletion
31
src/snowflake/snowpark/_internal/data_source/dbms_dialects/sqlserver_dialect.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,37 @@ | ||
| # | ||
| # Copyright (c) 2012-2025 Snowflake Computing Inc. All rights reserved. | ||
| # | ||
| from typing import List | ||
|
|
||
| from snowflake.snowpark._internal.data_source.dbms_dialects import BaseDialect | ||
| from snowflake.snowpark._internal.data_source.dbms_dialects.base_dialect import ( | ||
| QUERY_TEMPLATE, | ||
| ) | ||
| from snowflake.snowpark._internal.utils import quote_name | ||
| from snowflake.snowpark.types import StructType | ||
|
|
||
|
|
||
| class SqlServerDialect(BaseDialect): | ||
| pass | ||
| def generate_select_query( | ||
| self, | ||
| table_or_query: str, | ||
| schema: StructType, | ||
| raw_schema: List[tuple], | ||
| is_query: bool, | ||
| query_input_alias: str, | ||
| ) -> str: | ||
| cols = [] | ||
| for _field, raw_field in zip(schema.fields, raw_schema): | ||
| field_name = ( | ||
| f"{query_input_alias}.{quote_name(raw_field[0], keep_case=True)}" | ||
| if is_query | ||
| else f"{quote_name(raw_field[0], keep_case=True)}" | ||
| ) | ||
| cols.append(f"{field_name} AS {raw_field[0]}") if is_query else cols.append( | ||
| field_name | ||
| ) | ||
| return QUERY_TEMPLATE.format( | ||
| cols=", ".join(cols), | ||
| table_or_query=f"({table_or_query})" if is_query else table_or_query, | ||
| query_input_alias=query_input_alias if is_query else "", | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious about how this is used, is it related to the bug fixes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is related to the bug
query input does not work for SQL Server.default base driver add backtik to column name which is invalid in sql server.
the fix is to use double quote
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the changelog, hope the bug is easier to understand now