[
https://issues.apache.org/jira/browse/FLINK-23978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17704038#comment-17704038
]
Alexey Novakov commented on FLINK-23978:
----------------------------------------
Code I used:
{code:scala}
package org.example
import io.findify.flink.api._
import io.findify.flinkadt.api._
@main def wordCount =
val env = StreamExecutionEnvironment.getExecutionEnvironment
val text = env.fromElements(
"To be, or not to be,--that is the question:--",
"Whether 'tis nobler in the mind to suffer",
"The slings and arrows of outrageous fortune",
"Or to take arms against a sea of troubles,"
)
text.flatMap(_.toLowerCase.split("\\W+")).map((_,
1)).keyBy(_._1).sum(1).print()
env.execute("wordCount")
{code}
> FieldAccessor has direct scala dependency
> -----------------------------------------
>
> Key: FLINK-23978
> URL: https://issues.apache.org/jira/browse/FLINK-23978
> Project: Flink
> Issue Type: Sub-task
> Components: API / DataStream
> Reporter: Chesnay Schepler
> Assignee: Chesnay Schepler
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.15.0
>
>
> The FieldAccessor class in flink-streaming-java has a hard dependency on
> scala. It would be ideal if we could restrict this dependencies to
> flink-streaming-scala.
> We could move the SimpleProductFieldAccessor & RecursiveProductFieldAccessor
> to flink-streaming-scala, and load them in the FieldAccessorFactory via
> reflection.
> This is one of a few steps that would allow the Java Datastream API to be
> used without scala being on the classpath.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)