[FLINK-39081] Add ARTIFACT keyword option in CREATE FUNCTION's USING clause#27605
Open
autophagy wants to merge 1 commit intoapache:masterfrom
Open
[FLINK-39081] Add ARTIFACT keyword option in CREATE FUNCTION's USING clause#27605autophagy wants to merge 1 commit intoapache:masterfrom
autophagy wants to merge 1 commit intoapache:masterfrom
Conversation
Collaborator
davidradl
reviewed
Feb 13, 2026
davidradl
reviewed
Feb 13, 2026
...k-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/utils/ParserResource.java
Outdated
Show resolved
Hide resolved
davidradl
reviewed
Feb 13, 2026
...table/flink-sql-parser/src/test/java/org/apache/flink/sql/parser/FlinkSqlParserImplTest.java
Outdated
Show resolved
Hide resolved
0624297 to
d749217
Compare
Contributor
Author
|
Thank you for the review @davidradl - i've pushed up a commit that should address your points. I'll take a look into the e2e test failure (it seems somehow unrelated but you never know). |
d749217 to
5d7a322
Compare
twalthr
reviewed
Feb 17, 2026
Contributor
twalthr
left a comment
There was a problem hiding this comment.
Thank you for the PR @autophagy. How will the artifact keyword end up in CatalogFunction.getFunctionResources();? Is see there is already some code around org.apache.flink.sql.parser.ddl.resource.SqlResourceType how does this PR related to this?
| ```sql | ||
| CREATE FUNCTION [db_name.]function_name AS class_name | ||
| [USING JAR 'file_uri']; | ||
| [USING JAR|ARTIFACT 'file_uri']; |
Contributor
There was a problem hiding this comment.
grammar is not 100% correct:
Suggested change
| [USING JAR|ARTIFACT 'file_uri']; | |
| [USING [JAR|ARTIFACT] 'file_uri']; |
| [IF NOT EXISTS] [[catalog_name.]db_name.]function_name | ||
| AS identifier [LANGUAGE JAVA|SCALA|PYTHON] | ||
| [USING JAR '<path_to_filename>.jar' [, JAR '<path_to_filename>.jar']* ] | ||
| [USING JAR|ARTIFACT '<path_to_filename>.jar' [, JAR '<path_to_filename>.jar']* ] |
Contributor
There was a problem hiding this comment.
please revisit this line, the grammar is not correct
| throw SqlUtil.newContextException( | ||
| functionLanguagePos, | ||
| ParserResource.RESOURCE.createFunctionUsingJar(functionLanguage)); | ||
| ParserResource.RESOURCE.createFunctionUsingJarOrArtifact(functionLanguage)); |
Contributor
There was a problem hiding this comment.
nit: I would also be fine to simplify the name
Suggested change
| ParserResource.RESOURCE.createFunctionUsingJarOrArtifact(functionLanguage)); | |
| ParserResource.RESOURCE.createFunction(functionLanguage)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
The purpose of this change is to add the
ARTIFACTkeyword as a permissible keyword as elucidated in FLIP-559, to better support in future creation of non-java functions without needing toJARto reference the code artifact.Brief change log
ARTIFACTkeyword as an alias forJARinCREATE FUNCTIONstatements.Verifying this change
This change added tests and can be verified as follows:
FlinkSqlParserImplTestto cover function creation usingARTIFACT, as well as mixingJARandARTIFACT.Does this pull request potentially affect one of the following parts:
@Public(Evolving): (no)Documentation