Thanks @Seth Wiesman Ah,I just found I used 1.10-SNAPSHOT locally so can not reproduce the bug. @Averell you can use casts first and wait for 1.10.1 version, 1.10.1 will release soon.
Best, Leonard > 在 2020年4月21日,22:03,Seth Wiesman <sjwies...@gmail.com> 写道: > > 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. > > Seth > > [1] https://issues.apache.org/jira/browse/FLINK-16684 > <https://issues.apache.org/jira/browse/FLINK-16684> > On Tue, Apr 21, 2020 at 7:33 AM Leonard Xu <xbjt...@gmail.com > <mailto:xbjt...@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. > > > Best, > Leonard > > > > > 在 2020年4月21日,17:47,Averell <lvhu...@gmail.com <mailto:lvhu...@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 > > > > <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/ > > <http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/> >