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

Support CREATE OR REPLACE #371

Closed
1 task done
Fokko opened this issue Oct 28, 2023 · 2 comments · Fixed by #377
Closed
1 task done

Support CREATE OR REPLACE #371

Fokko opened this issue Oct 28, 2023 · 2 comments · Fixed by #377
Assignees
Labels
enhancement New feature or request

Comments

@Fokko
Copy link
Contributor

Fokko commented Oct 28, 2023

Describe the feature

Hey everyone!

I'm delighted to see CREATE OR REPLACE support in Trino: trinodb/trino#13180

This will both:

  • History of the table will be preserved in the Iceberg metadata, making it more transparent to the user what happened to the table.
  • Make the execution of the pipeline faster, since fewer statements are being issued

Describe alternatives you've considered

I would love to work on this, but my main question is how to determine if this is supported. I checked, but didn't find any minimal version to enable certain features.

Who will benefit?

Everyone using Iceberg in Trino 🚀

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@Fokko Fokko added the enhancement New feature or request label Oct 28, 2023
@hovaesco
Copy link
Contributor

I'm not aware of anyone working on this, let's introduce it as a separate strategy configured as on_table_exists = 'replace'.

I don't think we have a way to determine if this is supported on server side, please correct me if I'm wrong @mdesmet

@mosabua
Copy link
Member

mosabua commented Oct 30, 2023

Theoretically you could get the version of the server (via various means including version() function) and decide with that info. The problem is that it will be different for each connector so it will only be true after you figure out the connector used in a specific catalog (which you can also do via a query).

You could just leave it to the user to worry about and deal with it in the same way you deal with any other statement that might or might not be supported by the Trino version of the server and the connector. For example think of MERGE or TRUNCATE .. are you doing anything about these in terms of validation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants