Hi Ran,

Thanks for opening the discussion. There's a Flink ticket already for
adding Scala 2.13 support [1] and also for upgrading to the latest Scala
2.12 version [2]. The problem for upgrading to a later version of Scala is
outlined in [3]. We couldn't upgrade to later versions of Scala because of
a breaking change that Scala introduced after Scala 2.12.8. I'm assuming
that this would also block the introduction of Scala 2.13, but I'm no Scala
expert so I'm looking forward to input from others.

One thing suggested was to do an inventory among the Dev and User mailing
list if they would be OK to break the API over sticking with Scala 2.12.8.
I don't think that was done before.

Best regards,

Martijn Visser
https://twitter.com/MartijnVisser82
https://github.com/MartijnVisser

[1] https://issues.apache.org/jira/browse/FLINK-13414
[2 https://issues.apache.org/jira/browse/FLINK-20969
[3] https://issues.apache.org/jira/browse/FLINK-12461

On Mon, 9 May 2022 at 09:26, Ran Tao <chucheng...@gmail.com> wrote:

> Hi, guys.
>
> I have found out that current flink project build with jdk11 wasn't
> implemented completed or pure jdk11 version. (higher version has same
> problem)
>
> when enable jdk11, it has some scenarios.
>
> 1. Using jdk11 but source 1.8 target 1.8  -> it's ok.
> 2. Using jdk11 and with jdk11-target so the source 11 and target 11. ->
> build java also ok. But the generated bytecode version of scala class is
> already 52(jdk8). We can test with any of a scala classes under jdk11 build
> target. e.g.
>
> javap -verbose AggregateDataSet.class | grep major
> major version: 52
>
> I have test many times and make conclusion that flink jdk11 now is not a
> completed or pure jdk11 version because of inconsistent bytecode version
> with java & scala. And it may cause some problems, for example:
>
> 1. inconsistent bytecode version between java & scala
> 2. Using reflection about class may generate some unknown errors
> 3. Runtime jdk11 environment can not optimize these lower bytecode.
>
> I have dipped into this problem including reading carefully from scala docs
> and asking from scala community[1][2] and found out we must upgrade scala
> to 2.13(2.11 & 2.12 only support generate bytecode version <=1.8). the 2.13
> can support generating scala target 11 bytecode and higher and also jdk8.
>
>
> So I launch this discussion to see whether we can add scala-2.13 in flink
> jdk11 profile to support the completed or pure jdk11(or higher) version.
>
> And if we do not support and decide to maintain the current situation, I
> think we should let users or developers know this inconsistent problem, for
> example, update or make some comments in flink pom or docs.
>
> More details:
>
> https://issues.apache.org/jira/browse/FLINK-27549
>
> [1] https://github.com/scala/bug/issues/12588
>
> [2] https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html
>
>
> --
> Best,
> Ran Tao
>

Reply via email to