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

ASF GitHub Bot commented on FLINK-2622:
---------------------------------------

Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1098#discussion_r39175887
  
    --- Diff: 
flink-staging/flink-streaming/flink-streaming-scala/src/main/scala/org/apache/flink/streaming/api/scala/DataStream.scala
 ---
    @@ -727,13 +727,118 @@ class DataStream[T](javaStream: JavaStream[T]) {
        * every element of the DataStream the result of .toString
        * is written.
        *
    +   * @param writeMode
    +   * Control the behavior for existing files. Options are
    +   * NO_OVERWRITE and OVERWRITE.
    +   *
    +   */
    +  def writeAsText(
    +      path: String,
    +      writeMode: FileSystem.WriteMode): DataStreamSink[T] = {
    +    if (writeMode != null) {
    +      javaStream.writeAsText(path, writeMode)
    +    } else {
    +      javaStream.writeAsText(path)
    +    }
    +  }
    +
    +  /**
    +   * Writes a DataStream to the file specified by path in text format. The
    +   * writing is performed periodically, in every millis milliseconds. For
    +   * every element of the DataStream the result of .toString
    +   * is written.
    +   *
    +   * @param writeMode
    +   * Control the behavior for existing files. Options are
    +   * NO_OVERWRITE and OVERWRITE.
    +   *
    +   */
    +  def writeAsText(
    +      path: String,
    +      writeMode: FileSystem.WriteMode,
    +      millis: Long): DataStreamSink[T] = {
    +    if (writeMode != null) {
    +      javaStream.writeAsText(path, writeMode, millis)
    +    } else {
    +      javaStream.writeAsText(path, millis)
    +    }
    +  }
    +
    +  /**
    +   * Writes a DataStream to the file specified by path in text format. The
    --- End diff --
    
    `writeToCsv` does not write `in text format` and does also not use the 
`.toString` method.
    Please fix the documentation.


> Scala DataStream API does not have writeAsText method which supports WriteMode
> ------------------------------------------------------------------------------
>
>                 Key: FLINK-2622
>                 URL: https://issues.apache.org/jira/browse/FLINK-2622
>             Project: Flink
>          Issue Type: Bug
>          Components: Scala API, Streaming
>            Reporter: Till Rohrmann
>
> The Scala DataStream API, unlike the Java DataStream API, does not support a 
> {{writeAsText}} method which takes the {{WriteMode}} as a parameter. In order 
> to make the two APIs consistent, it should be added to the Scala DataStream 
> API.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to