Skip to content

Refactor common runner code to not use 3rd party dependencies#240

Merged
ferenc-csaky merged 1 commit into
mainfrom
no-3rd-party-at-run
Nov 12, 2025
Merged

Refactor common runner code to not use 3rd party dependencies#240
ferenc-csaky merged 1 commit into
mainfrom
no-3rd-party-at-run

Conversation

@ferenc-csaky

@ferenc-csaky ferenc-csaky commented Nov 10, 2025

Copy link
Copy Markdown
Collaborator

Since by default Flink uses child-first class-loading, if a user ships a wrong version of a 3rd party dep we use in the common deployment code, it may break before deploy, so we should only use Flink-specific deps and picocli in any flink-sql-runner module class.

@ferenc-csaky ferenc-csaky added this to the 0.9.0 milestone Nov 10, 2025
import javax.annotation.Nullable;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should also remove/exclude the dependency from the pom, otherwise over time this will happen again

@velo velo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this solves the underline issue.

Image

Flink uses commons-lang3:3:12:0

We must nudge anyone building UDFs to use the same set of dependencies as flink-sql-runner uses.

@velo

velo commented Nov 10, 2025

Copy link
Copy Markdown
Collaborator

I proposed the following alternative:
#239

A single mandatory dependency to all UDFs, we can even let sqrl to automatically manage it to match compiler version (then we need to build this dependency on sqrl side of the fence)

@ferenc-csaky

Copy link
Copy Markdown
Collaborator Author

My only goal here was to make sure the common runner logic cannot break because the user uses some different dependency versions that are included in Flink, and that is achieved with this. The Flink dep version does not matter, cause the SQL runner code will be executed as "user code" in Flink, so it will utilize the UserClassLoader, which will load deps from the passed JAR (flink-sql-runner-uber) and any UDF JARs if those are provided.

I agree that populating the proper runner dependency versions is a more sophisticated thing to do, but that will also require SQRL-side changes, and should not be shipped in a patch version. And making BaseRunner not using any 3rd parties does not hurt anyways. So I'll merge this to be part of 0.8.3, cause otherwise the only option in case the user ships commons-lang3 is to pin its version in their UDF JAR.

@ferenc-csaky ferenc-csaky modified the milestones: 0.9.0, 0.8.3 Nov 12, 2025
@ferenc-csaky ferenc-csaky merged commit 8a0e69a into main Nov 12, 2025
2 checks passed
@ferenc-csaky ferenc-csaky deleted the no-3rd-party-at-run branch November 12, 2025 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants