-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW-1271612 Merge dynamic pivot into snowpark python (#1375)
* SNOW-838815 Extend snowpark for dynamic pivot (#117) See https://docs.google.com/document/d/12usSBp73G-CPwRfOoeMuQfser4OfCArgG5Lmm-OIQ_0 Please answer these questions before submitting your pull requests. Thanks! 1. What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR. SNOW-838815 2. Fill out the following pre-review checklist: - [x] I am adding a new automated test(s) to verify correctness of my new code - [ ] I am adding new logging messages - [ ] I am adding a new telemetry message - [ ] I am adding new credentials - [ ] I am adding a new dependency 3. Please describe how your code solves the related issue. This extends the pivot API for dynamic pivot (specify None for ANY or subquery via dataframe) as well as default value to fill if there are empty result values. * SNOW-916205 Use cache_result for pivot when creates temp table for large inlined data (#345) SNOW-916205 Use cache_result when snowpark creates temp table for large inlined data Please answer these questions before submitting your pull requests. Thanks! 1. What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR. SNOW-916205 Use cache_result when snowpark creates temp table for large inlined data 2. Fill out the following pre-review checklist: - [x] I am adding a new automated test(s) to verify correctness of my new code - [ ] I am adding new logging messages - [ ] I am adding a new telemetry message - [ ] I am adding new credentials - [ ] I am adding a new dependency 3. Please describe how your code solves the related issue. If the size of underlying data exceeds ARRAY_BIND_THRESHOLD (512), then snowpark will automatically offload the data into a temp file. Each snowpark action results in the creation, insertion, query and dropping of this temp table. This causes a problem for dynamic pivot schema query which can occur of of band of a snowpark action, say to fetch the schema only, and will fail with table not found. To workaround this until [SNOW-916744](https://snowflakecomputing.atlassian.net/browse/SNOW-916744) is fixed we do a cache_result locally which puts the inlined data into a temp table that is not cleaned up until the session ends. [SNOW-916744]: https://snowflakecomputing.atlassian.net/browse/SNOW-916744?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ * SNOW-1271612 Prep dynamic pivot in snowpark for merge back into main * Update change log and fix lint issue * Update * Update doc tests * Update doc test * Update type hints * Update
- Loading branch information
1 parent
cdebbd9
commit f0e04c4
Showing
11 changed files
with
438 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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.