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

Chesnay Schepler commented on FLINK-23978:
------------------------------------------

Yes, that's the exception I had expected.

When you reference a field by index ({{.sum(1)}}) Flink needs some way to 
actually access this field.
This is what the FieldAccessor does, but it only works for a few special cases.
It's unfortunately not tied to the TypeInfo class.

So, you should be able to workaround this issue in either case by using a 
ReduceFunction to do the summing.
Additionally you may want to file a ticket with flink-adt to have them also 
copy the FieldAccessFactrory for scala types.

> 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)

Reply via email to