You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/01/09 19:57:14 UTC

[GitHub] 123avi commented on issue #7418: FLINK-11053 Documentation - update scala sample code for bucketing sink according

123avi commented on issue #7418: FLINK-11053 Documentation - update scala sample code for bucketing sink according
URL: https://github.com/apache/flink/pull/7418#issuecomment-452835988
 
 
   I understand, nice, but that will not be a pure Scala example I think it’s
   more like a workaround . IMO if we do as you suggest we should explicitly
   meantion the usage of Java Tuple2 .
   What do you think?
   
   On Wed, 9 Jan 2019 at 3:55 Hequn Cheng <no...@github.com> wrote:
   
   > *@hequn8128* commented on this pull request.
   > ------------------------------
   >
   > In docs/dev/connectors/filesystem_sink.md
   > <https://github.com/apache/flink/pull/7418#discussion_r246237842>:
   >
   > >
   > -val sink = new BucketingSink[String]("/base/path")
   > -sink.setBucketer(new DateTimeBucketer[String]("yyyy-MM-dd--HHmm", ZoneId.of("America/Los_Angeles")))
   > -sink.setWriter(new SequenceFileWriter[IntWritable, Text]())
   > +val sink = new BucketingSink[(IntWritable, Text)]("/base/path")
   > +sink.setBucketer(new DateTimeBucketer("yyyy-MM-dd--HHmm"))
   > +sink.setWriter(new StringWriter[(IntWritable, Text)]())
   >
   > @123avi <https://github.com/123avi> What I mean is don't use scala tuple.
   > Use java tuple even for the scala example.
   > val input: DataStream[Tuple2[A, B]] is different from val input:
   > DataStream[(A, B)]. org.apache.flink.api.java.tuple.Tuple2 is a class in
   > Flink.
   >
   > I wrote a sample code for you. Take a look at the code here
   > <https://github.com/hequn8128/flink/blob/bucketSinkTest/flink-connectors/flink-connector-filesystem/src/test/scala/org/apache/flink/streaming/connectors/fs/bucketing/ScalaBucketingSinkTest.scala#L62>.
   > You can also try to run the test. It works well.
   >
   > —
   > You are receiving this because you were mentioned.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/flink/pull/7418#discussion_r246237842>, or mute
   > the thread
   > <https://github.com/notifications/unsubscribe-auth/ADAzQWGAD981LtlE2bt98hGjP8GVwvU2ks5vBUwAgaJpZM4Zw_8S>
   > .
   >
   -- 
   Sincerely,
   Avi Levi
   m: +972-52-3459959
   https://il.linkedin.com/in/leviavi
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services