-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Revert "Add RetryMode to ConnectorTableFunction.analyze" #20777
Conversation
This reverts commit 92c74d8.
This PR removes possibility to have a table function with side effects. We should have a replacement APIs for such case. |
Table functions are not currently meant to have side effects. For that, we need to add a lifecycle/commit protocol. |
Are we talking about table functions that exist in Trino, or about table functions that are possible to implement in 3rd party plugins? AFAIK it's possible to implement table functions with side effects, but not everything is possible to implement
❤️ that would be awesome to have and would make spectrum of possible functions wider! |
It is possible, but it might not be safe to use them in all settings. So from the point of view of Trino, that usage is "unsupported". If someone wanted to disable such functions, they can do it via access control. |
Oh!... what are such setting? |
It might have been discussed offline, but it would be good to clarify here as well. |
Whenever a function has side effects, you need to consider:
If any of these apply to you and you have a function that may have side effects, you should consider whether you're ok with the potential consequences of those side effects (they may be benign), or whether you want to disallow those functions for the users/clusters/use cases that might be problematic. |
Most of the same challenges apply to inserts into Hive tables or CTAS statements (and perhaps others - atomicity is currently not guaranteed by Trino given that some connectors operate on multiple systems such as storage and metastore) |
Those are not the same. From the point of view of trino, Insert/ctas/etc are expected to have side effects. Functions are not. Writing functions with side effects is “at your own risk”. That’s why earlier I said that to support side effects we need a commit protocol, just like insert/ctas/etc. have. Until that happens, it doesn’t make sense to have functions know about concepts related to side effects. |
Description
Revert "Add RetryMode to ConnectorTableFunction.analyze"