Hi All,

There is a bug in the builder that prevents it from compiling in scala due to differences in type inference between java and scala[1]. It as already been resolved for 1.10.1 and 1.11. In the meantime, just go ahead and use casts or construct the object in a java class.


[1] https://issues.apache.org/jira/browse/FLINK-16684

On Tue, Apr 21, 2020 at 7:33 AM Leonard Xu <xbjtdcq@gmail.com> wrote:
Hi, Averell

I found you’re using scala so I reproduced your case local in Scala 2.11.12 with Flink 1.10.0 and it works too.
>From your picture it’s wired  that line`.withBucketAssigner(new DateTimeBucketAssigner)` hint is `Any`,
it should be `RowFormatBuilder` otherwise you can not call `#build` function from an `Any` object.
You can debug this line and to see what happened.


> 在 2020年4月21日,17:47,Averell <lvhuyen@gmail.com> 写道:
> Hello Leonard, Sivaprasanna,
> But my code was working fine with Flink v1.8.
> I also tried with a simple String DataStream, and got the same error.
> /        StreamingFileSink
>          .forRowFormat(new Path(path), new SimpleStringEncoder[String]())
>          .withRollingPolicy(DefaultRollingPolicy.builder().build())
>          .withBucketAssigner(new DateTimeBucketAssigner)
>          .build()/
> (screenshot below)
> <http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/file/t1586/FlinkError.png>
> It's weird. At first I thought it's something wrong with IntelliJ, but I got
> the same error when running mvn from commandline.
> --
> Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/