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-1570734: Reduce describe query when there is no schema change #2126

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sfc-gh-jdu
Copy link
Collaborator

  1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-1570734

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
      • If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
    • If this is a new feature/behavior, I'm adding the Local Testing parity changes.
  3. Please describe how your code solves the related issue.

    For filter, sort, limit and sample APIs, we don't need to fetch schema/metadata from server because they are not changed.

@sfc-gh-jdu sfc-gh-jdu requested a review from a team as a code owner August 19, 2024 23:08
@sfc-gh-jdu sfc-gh-jdu force-pushed the jdu-SNOW-1570734-reduce-desc-no-schmea-change branch from 108c337 to 9da3614 Compare August 19, 2024 23:14
@github-actions github-actions bot added the local testing Local Testing issues/PRs label Aug 20, 2024
Copy link

Seems like your changes contain some Local Testing changes, please request review from @snowflakedb/local-testing

@@ -4,6 +4,10 @@

### Snowpark Python API Updates

#### Improvements

- Reduced the number of additional [describe queries](https://docs.snowflake.com/en/developer-guide/python-connector/python-connector-example#retrieving-column-metadata) sent to the server to fetch the metadata of a DataFrame. It is still an experimental feature not enabled by default, and can be enabled by setting `session.reduce_describe_query_enabled` to `True`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Reduced the number of additional [describe queries](https://docs.snowflake.com/en/developer-guide/python-connector/python-connector-example#retrieving-column-metadata) sent to the server to fetch the metadata of a DataFrame. It is still an experimental feature not enabled by default, and can be enabled by setting `session.reduce_describe_query_enabled` to `True`.
- Reduced the number of additional [describe queries](https://docs.snowflake.com/en/developer-guide/python-connector/python-connector-example#retrieving-column-metadata) sent to the server to fetch the metadata of a DataFrame. It is still an experimental improvement not enabled by default, and can be enabled by setting `session.reduce_describe_query_enabled` to `True`.

lambda df: df.filter(col("a") > 2).sample(0.5),
],
)
def test_schema_no_change(session, action):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to count the number of describe queries so you can assert they are 0 (or whatever the reduced number is) as part of the test?

@@ -4,6 +4,10 @@

### Snowpark Python API Updates

#### Improvements

- Reduced the number of additional [describe queries](https://docs.snowflake.com/en/developer-guide/python-connector/python-connector-example#retrieving-column-metadata) sent to the server to fetch the metadata of a DataFrame. It is still an experimental feature not enabled by default, and can be enabled by setting `session.reduce_describe_query_enabled` to `True`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any experimental results on the impact of this improvement?

@sfc-gh-jdu sfc-gh-jdu marked this pull request as draft August 26, 2024 20:55
@sfc-gh-jdu sfc-gh-jdu force-pushed the jdu-SNOW-1570734-reduce-desc-no-schmea-change branch from 6f99186 to 465c937 Compare August 26, 2024 20:57
Copy link

Seems like your changes contain some Local Testing changes, please request review from @snowflakedb/local-testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
local testing Local Testing issues/PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants