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

[FLINK-32332][sql-gateway] Show jars being used by function #22777

Closed

Conversation

FangYongs
Copy link
Contributor

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

  • Get jars which are used by catalog function in ShowJarsOperation

Verifying this change

This change added tests and can be verified as follows:

  • Added test in function.q to show jars before and after a function is used.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no) no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no) no
  • The serializers: (yes / no / don't know) no
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know) no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know) no
  • The S3 file system connector: (yes / no / don't know) no

Documentation

  • Does this pull request introduce a new feature? (yes / no) no
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@FangYongs
Copy link
Contributor Author

Hi @fsk119 , could you help to review this PR when you are free? thanks

@flinkbot
Copy link
Collaborator

flinkbot commented Jun 14, 2023

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@FangYongs FangYongs changed the title [FLINK-32309][sql-gateway] Show jars being used by function [FLINK-32332][sql-gateway] Show jars being used by function Jun 15, 2023
Copy link
Member

@fsk119 fsk119 left a 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) {
Copy link
Member

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.

Comment on lines +189 to +194
if (jars.contains(jarPath)) {
throw new UnsupportedOperationException(
String.format(
"Can not delete jar file [%s] while it is being used by function.",
jarPath));
}
Copy link
Member

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.

@FangYongs FangYongs closed this Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants