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-1569878: Creating Dynamic Table using Snowpark does not support all options #2019

Closed
padhia opened this issue Aug 1, 2024 · 4 comments · Fixed by #2110
Closed

SNOW-1569878: Creating Dynamic Table using Snowpark does not support all options #2019

padhia opened this issue Aug 1, 2024 · 4 comments · Fixed by #2110
Assignees
Labels
feature New feature or request status-triage_done Initial triage done, will be further handled by the driver team

Comments

@padhia
Copy link

padhia commented Aug 1, 2024

What is the current behavior?

DataFrame.create_or_replace_dynamic_table() function doesn't support all parameters supported by the SQL version

What is the desired behavior?

Support options supported by the SQL version, specifically:

  1. ability to create TRANSIENT dynamic tables
  2. Option: REFRESH_MODE
  3. Option: INITIALIZE
  4. Option: CLUSTER BY
  5. Option: DATA_RETENTION_TIME_IN_DAYS
  6. Option: MAX_DATA_EXTENSION_TIME_IN_DAYS

How would this improve snowflake-snowpark-python?

Allows Snowpark to complement/replace SQL as the sole language for DDLs. This is especially important for creating objects that support SELECT statements such as Dynamic tables and Views

References, Other Background

https://docs.snowflake.com/en/sql-reference/sql/create-dynamic-table#syntax

@padhia padhia added the feature New feature or request label Aug 1, 2024
@github-actions github-actions bot changed the title Creating Dynamic Table using Snowpark does not support all options SNOW-1569878: Creating Dynamic Table using Snowpark does not support all options Aug 1, 2024
@sfc-gh-sghosh sfc-gh-sghosh self-assigned this Aug 13, 2024
@sfc-gh-sghosh
Copy link

Hello @padhia ,

Thanks for raising the issue.
Dynamic table support has been added in Snowpark Python 1.17.0, but it is still experimental, and not all features are supported. will update about the plan.

Regards,
Sujan

@sfc-gh-sghosh sfc-gh-sghosh added the status-triage_done Initial triage done, will be further handled by the driver team label Aug 13, 2024
@sfc-gh-aalam
Copy link
Contributor

@padhia do you also need the option for IF NOT EXISTS?

@padhia
Copy link
Author

padhia commented Aug 15, 2024

That'd be certainly nice. Maybe a parameter that determines what happens if the table already exists. For example: mode parameter with following values:

  • overwrite translates to create or replace
  • skip translates to if not exists
  • error (default) translates to simply create

@sfc-gh-aalam
Copy link
Contributor

@padhia setting default to error will be a breaking change so I would not change that. But I'll consider add a mode based on your suggestion. We do something similar in DataFrame.write.save_as_table

sfc-gh-aalam added a commit that referenced this issue Aug 22, 2024
…#2110)

<!---
Please answer these questions before creating your pull request. Thanks!
--->

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

   <!---
   In this section, please add a Snowflake Jira issue number.
   
Note that if a corresponding GitHub issue exists, you should still
include
   the Snowflake Jira issue number. For example, for GitHub issue
#1400, you should
   add "SNOW-1335071" here.
    --->

   Fixes SNOW-1010216, #2019

2. Fill out the following pre-review checklist:

- [x] 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.

   Adding support to specify the following:
- REFERSH_MODE
- INITIALIZE
- CLUSTER BY
- TRANSIENT
- DATA_RETENTION_TIME_IN_DAYS
- MAX_DATA_EXTENSION_TIME_IN_DAYS

---------

Co-authored-by: Jamison Rose <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request status-triage_done Initial triage done, will be further handled by the driver team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants