[ 
https://issues.apache.org/jira/browse/FLINK-41555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18147549#comment-18147549
 ] 

Martijn Visser commented on FLINK-41555:
----------------------------------------

Reading from {{url.openStream()}} isn't enough: the JVM caches the {{JarFile}} 
behind a {{jar:}} URL, so a JAR rebuilt at the same path is read through the 
stale one. The fix disables caching, as {{ServiceLoader}} does. Broken since 
1.15.0. 2.4, 2.3 and 2.2 take the fix, 1.20 needs a port since the code is in 
{{StreamPlanner}} there.

> PlanReference.fromResource fails for a plan inside a JAR
> --------------------------------------------------------
>
>                 Key: FLINK-41555
>                 URL: https://issues.apache.org/jira/browse/FLINK-41555
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Planner
>    Affects Versions: 1.15.4, 2.3.0, 2.2.1, 1.20.5, 2.4.0
>            Reporter: Martijn Visser
>            Assignee: Martijn Visser
>            Priority: Minor
>             Fix For: 1.20.6, 2.4.0, 2.2.3, 2.3.2
>
>
> {{PlanReference.fromResource}} works when the plan is in a directory on the 
> classpath, but fails with {{IllegalArgumentException: URI is not 
> hierarchical}} when it is in a JAR, which is the usual place for a resource 
> of a job. {{PlannerBase#loadPlan}} turns the resource URL into a {{File}} 
> with {{new File(url.toURI)}}, which doesn't work for a {{jar:}} URL. We 
> should read the plan from the URL's stream instead. Until then, reading the 
> resource yourself and using {{PlanReference.fromJsonString}} works, which is 
> what the docs from FLINK-26250 show.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to