-
Notifications
You must be signed in to change notification settings - Fork 13k
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
[FLINK-32332][sql-gateway] Show jars being used by function #22777
Conversation
Hi @fsk119 , could you help to review this PR when you are free? thanks |
3982885
to
e664ed9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution. I left some comments.
functionCatalog.getUserDefinedFunctions( | ||
catalogManager.getCurrentCatalog(), catalogManager.getCurrentDatabase()); | ||
Catalog catalog = catalogManager.getCatalog(catalogManager.getCurrentCatalog()).get(); | ||
for (FunctionIdentifier identifier : identifiers) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems it's a little heavy to check the catalog function one by one. I think it's better we register the resource URL into the ResourceManager. But I think we can leave this to the future work.
if (jars.contains(jarPath)) { | ||
throw new UnsupportedOperationException( | ||
String.format( | ||
"Can not delete jar file [%s] while it is being used by function.", | ||
jarPath)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The jar list that is returned by the SHOW JAR
syntax also contains the connector jars. It's a little hard to check if the jar is a connector jar or a function jar. If it is a connector jar, I think we can not check whether we have instances using this jar.
What is the purpose of the change
Currently
show jars
statement will not show the jars added by a function when the function is never used by a job in gateway, this PR aims to fixed it.Brief change log
ShowJarsOperation
Verifying this change
This change added tests and can be verified as follows:
function.q
toshow jars
before and after a function is used.Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (yes / no) noDocumentation