Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 1.3.0, 1.4.0
    • Component/s: Table API & SQL
    • Labels:
      None

      Description

      With retraction support, we should deprecate toDataStream and introduce a new toAppendStream to clearly differentiate between retraction and non-retraction.

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user twalthr opened a pull request:

          https://github.com/apache/flink/pull/3929

          FLINK-6543 [table] Deprecate toDataStream

          This deprecates toDataStream in Scala and Java Table API.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/twalthr/flink FLINK-6543

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/flink/pull/3929.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #3929


          commit 63832055301a47dff10c9802b9500040457d9d75
          Author: twalthr <twalthr@apache.org>
          Date: 2017-05-17T09:31:33Z

          FLINK-6543 [table] Deprecate toDataStream


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user twalthr opened a pull request: https://github.com/apache/flink/pull/3929 FLINK-6543 [table] Deprecate toDataStream This deprecates toDataStream in Scala and Java Table API. You can merge this pull request into a Git repository by running: $ git pull https://github.com/twalthr/flink FLINK-6543 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/3929.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3929 commit 63832055301a47dff10c9802b9500040457d9d75 Author: twalthr <twalthr@apache.org> Date: 2017-05-17T09:31:33Z FLINK-6543 [table] Deprecate toDataStream
          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/flink/pull/3929#discussion_r117045701

          — Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/java/StreamTableEnvironment.scala —
          @@ -144,13 +144,119 @@ class StreamTableEnvironment(

          • types: Fields are mapped by position, field types must match.
          • - POJO [[DataStream]] types: Fields are mapped by field name, field types must match.
            *
            + * NOTE: This method only supports conversion of append-only tables. In order to make this
            + * more explicit in the future, please use [[toAppendStream()]] instead.
            + * If add and retract messages are required, use [[toRetractStream()]].
            + *
            + * @param table The [[Table]] to convert.
            + * @param clazz The class of the type of the resulting [[DataStream]].
            + * @tparam T The type of the resulting [[DataStream]].
            + * @return The converted [[DataStream]].
            + * @deprecated This method only supports conversion of append-only tables. In order to
            + * make this more explicit in the future, please use toAppendStream() instead.
            + */
            + @Deprecated
            + def toDataStream[T](table: Table, clazz: Class[T]): DataStream[T] = toAppendStream(table, clazz)
            +
            + /**
            + * Converts the given [[Table]] into an append [[DataStream]] of a specified type.
            + *
            + * The [[Table]] must only have insert (append) changes. If the [[Table]] is also modified
            + * by update or delete changes, the conversion will fail.
            + *
            + * The fields of the [[Table]] are mapped to [[DataStream]] fields as follows:
            + * - [[org.apache.flink.types.Row]] and [[org.apache.flink.api.java.tuple.Tuple]]
            + * types: Fields are mapped by position, field types must match.
            + * - POJO [[DataStream]] types: Fields are mapped by field name, field types must match.
            + *
            + * NOTE: This method only supports conversion of append-only tables. In order to make this
            + * more explicit in the future, please use [[toAppendStream()]] instead.
            + * If add and retract messages are required, use [[toRetractStream()]].
            + *
            + * @param table The [[Table]] to convert.
            + * @param typeInfo The [[TypeInformation]] that specifies the type of the [[DataStream]].
            + * @tparam T The type of the resulting [[DataStream]].
            + * @return The converted [[DataStream]].
            + * @deprecated This method only supports conversion of append-only tables. In order to
            + * make this more explicit in the future, please use toAppendStream() instead.
            + */
            + def toDataStream[T](table: Table, typeInfo: TypeInformation[T]): DataStream[T] =
            + toAppendStream(table, typeInfo)
            +
            + /**
            + * Converts the given [[Table]] into an append [[DataStream]] of a specified type.
            + *
            + * The [[Table]] must only have insert (append) changes. If the [[Table]] is also modified
            + * by update or delete changes, the conversion will fail.
            + *
            + * The fields of the [[Table]] are mapped to [[DataStream]] fields as follows:
            + * - [[org.apache.flink.types.Row]] and [[org.apache.flink.api.java.tuple.Tuple]]
            + * types: Fields are mapped by position, field types must match.
            + * - POJO [[DataStream]] types: Fields are mapped by field name, field types must match.
            + *
            + * NOTE: This method only supports conversion of append-only tables. In order to make this
            + * more explicit in the future, please use [[toAppendStream()]] instead.
            + * If add and retract messages are required, use [[toRetractStream()]].
            + *
            + * @param table The [[Table]] to convert.
            + * @param clazz The class of the type of the resulting [[DataStream]].
            + * @param queryConfig The configuration of the query to generate.
            + * @tparam T The type of the resulting [[DataStream]].
            + * @return The converted [[DataStream]].
            + * @deprecated This method only supports conversion of append-only tables. In order to
            + * make this more explicit in the future, please use toAppendStream() instead.
            + */
            + def toDataStream[T](
            + table: Table,
            + clazz: Class[T],
            + queryConfig: StreamQueryConfig): DataStream[T] = toAppendStream(table, clazz, queryConfig)
            +
            + /**
            + * Converts the given [[Table]] into an append [[DataStream]] of a specified type.
            + *
            + * The [[Table]] must only have insert (append) changes. If the [[Table]] is also modified
            + * by update or delete changes, the conversion will fail.
            + *
            + * The fields of the [[Table]] are mapped to [[DataStream]] fields as follows:
            + * - [[org.apache.flink.types.Row]] and [[org.apache.flink.api.java.tuple.Tuple]]
            + * types: Fields are mapped by position, field types must match.
            + * - POJO [[DataStream]] types: Fields are mapped by field name, field types must match.
            + *
            + * NOTE: This method only supports conversion of append-only tables. In order to make this
            + * more explicit in the future, please use [[toAppendStream()]] instead.
            + * If add and retract messages are required, use [[toRetractStream()]].
            + *
            + * @param table The [[Table]] to convert.
            + * @param typeInfo The [[TypeInformation]] that specifies the type of the [[DataStream]].
            + * @param queryConfig The configuration of the query to generate.
            + * @tparam T The type of the resulting [[DataStream]].
            + * @return The converted [[DataStream]].
            + * @deprecated This method only supports conversion of append-only tables. In order to
            + * make this more explicit in the future, please use toAppendStream() instead.
            + */
            + def toDataStream[T](
              • End diff –

          add `@Deprecated` annotation

          Show
          githubbot ASF GitHub Bot added a comment - Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/3929#discussion_r117045701 — Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/java/StreamTableEnvironment.scala — @@ -144,13 +144,119 @@ class StreamTableEnvironment( types: Fields are mapped by position, field types must match. - POJO [ [DataStream] ] types: Fields are mapped by field name, field types must match. * + * NOTE: This method only supports conversion of append-only tables. In order to make this + * more explicit in the future, please use [ [toAppendStream()] ] instead. + * If add and retract messages are required, use [ [toRetractStream()] ]. + * + * @param table The [ [Table] ] to convert. + * @param clazz The class of the type of the resulting [ [DataStream] ]. + * @tparam T The type of the resulting [ [DataStream] ]. + * @return The converted [ [DataStream] ]. + * @deprecated This method only supports conversion of append-only tables. In order to + * make this more explicit in the future, please use toAppendStream() instead. + */ + @Deprecated + def toDataStream [T] (table: Table, clazz: Class [T] ): DataStream [T] = toAppendStream(table, clazz) + + /** + * Converts the given [ [Table] ] into an append [ [DataStream] ] of a specified type. + * + * The [ [Table] ] must only have insert (append) changes. If the [ [Table] ] is also modified + * by update or delete changes, the conversion will fail. + * + * The fields of the [ [Table] ] are mapped to [ [DataStream] ] fields as follows: + * - [ [org.apache.flink.types.Row] ] and [ [org.apache.flink.api.java.tuple.Tuple] ] + * types: Fields are mapped by position, field types must match. + * - POJO [ [DataStream] ] types: Fields are mapped by field name, field types must match. + * + * NOTE: This method only supports conversion of append-only tables. In order to make this + * more explicit in the future, please use [ [toAppendStream()] ] instead. + * If add and retract messages are required, use [ [toRetractStream()] ]. + * + * @param table The [ [Table] ] to convert. + * @param typeInfo The [ [TypeInformation] ] that specifies the type of the [ [DataStream] ]. + * @tparam T The type of the resulting [ [DataStream] ]. + * @return The converted [ [DataStream] ]. + * @deprecated This method only supports conversion of append-only tables. In order to + * make this more explicit in the future, please use toAppendStream() instead. + */ + def toDataStream [T] (table: Table, typeInfo: TypeInformation [T] ): DataStream [T] = + toAppendStream(table, typeInfo) + + /** + * Converts the given [ [Table] ] into an append [ [DataStream] ] of a specified type. + * + * The [ [Table] ] must only have insert (append) changes. If the [ [Table] ] is also modified + * by update or delete changes, the conversion will fail. + * + * The fields of the [ [Table] ] are mapped to [ [DataStream] ] fields as follows: + * - [ [org.apache.flink.types.Row] ] and [ [org.apache.flink.api.java.tuple.Tuple] ] + * types: Fields are mapped by position, field types must match. + * - POJO [ [DataStream] ] types: Fields are mapped by field name, field types must match. + * + * NOTE: This method only supports conversion of append-only tables. In order to make this + * more explicit in the future, please use [ [toAppendStream()] ] instead. + * If add and retract messages are required, use [ [toRetractStream()] ]. + * + * @param table The [ [Table] ] to convert. + * @param clazz The class of the type of the resulting [ [DataStream] ]. + * @param queryConfig The configuration of the query to generate. + * @tparam T The type of the resulting [ [DataStream] ]. + * @return The converted [ [DataStream] ]. + * @deprecated This method only supports conversion of append-only tables. In order to + * make this more explicit in the future, please use toAppendStream() instead. + */ + def toDataStream [T] ( + table: Table, + clazz: Class [T] , + queryConfig: StreamQueryConfig): DataStream [T] = toAppendStream(table, clazz, queryConfig) + + /** + * Converts the given [ [Table] ] into an append [ [DataStream] ] of a specified type. + * + * The [ [Table] ] must only have insert (append) changes. If the [ [Table] ] is also modified + * by update or delete changes, the conversion will fail. + * + * The fields of the [ [Table] ] are mapped to [ [DataStream] ] fields as follows: + * - [ [org.apache.flink.types.Row] ] and [ [org.apache.flink.api.java.tuple.Tuple] ] + * types: Fields are mapped by position, field types must match. + * - POJO [ [DataStream] ] types: Fields are mapped by field name, field types must match. + * + * NOTE: This method only supports conversion of append-only tables. In order to make this + * more explicit in the future, please use [ [toAppendStream()] ] instead. + * If add and retract messages are required, use [ [toRetractStream()] ]. + * + * @param table The [ [Table] ] to convert. + * @param typeInfo The [ [TypeInformation] ] that specifies the type of the [ [DataStream] ]. + * @param queryConfig The configuration of the query to generate. + * @tparam T The type of the resulting [ [DataStream] ]. + * @return The converted [ [DataStream] ]. + * @deprecated This method only supports conversion of append-only tables. In order to + * make this more explicit in the future, please use toAppendStream() instead. + */ + def toDataStream [T] ( End diff – add `@Deprecated` annotation
          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/flink/pull/3929#discussion_r117045613

          — Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/java/StreamTableEnvironment.scala —
          @@ -144,13 +144,119 @@ class StreamTableEnvironment(

          • types: Fields are mapped by position, field types must match.
          • - POJO [[DataStream]] types: Fields are mapped by field name, field types must match.
            *
            + * NOTE: This method only supports conversion of append-only tables. In order to make this
            + * more explicit in the future, please use [[toAppendStream()]] instead.
            + * If add and retract messages are required, use [[toRetractStream()]].
            + *
            + * @param table The [[Table]] to convert.
            + * @param clazz The class of the type of the resulting [[DataStream]].
            + * @tparam T The type of the resulting [[DataStream]].
            + * @return The converted [[DataStream]].
            + * @deprecated This method only supports conversion of append-only tables. In order to
            + * make this more explicit in the future, please use toAppendStream() instead.
            + */
            + @Deprecated
            + def toDataStream[T](table: Table, clazz: Class[T]): DataStream[T] = toAppendStream(table, clazz)
            +
            + /**
            + * Converts the given [[Table]] into an append [[DataStream]] of a specified type.
            + *
            + * The [[Table]] must only have insert (append) changes. If the [[Table]] is also modified
            + * by update or delete changes, the conversion will fail.
            + *
            + * The fields of the [[Table]] are mapped to [[DataStream]] fields as follows:
            + * - [[org.apache.flink.types.Row]] and [[org.apache.flink.api.java.tuple.Tuple]]
            + * types: Fields are mapped by position, field types must match.
            + * - POJO [[DataStream]] types: Fields are mapped by field name, field types must match.
            + *
            + * NOTE: This method only supports conversion of append-only tables. In order to make this
            + * more explicit in the future, please use [[toAppendStream()]] instead.
            + * If add and retract messages are required, use [[toRetractStream()]].
            + *
            + * @param table The [[Table]] to convert.
            + * @param typeInfo The [[TypeInformation]] that specifies the type of the [[DataStream]].
            + * @tparam T The type of the resulting [[DataStream]].
            + * @return The converted [[DataStream]].
            + * @deprecated This method only supports conversion of append-only tables. In order to
            + * make this more explicit in the future, please use toAppendStream() instead.
            + */
            + def toDataStream[T](table: Table, typeInfo: TypeInformation[T]): DataStream[T] =
              • End diff –

          add `@Deprecated` annotation

          Show
          githubbot ASF GitHub Bot added a comment - Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/3929#discussion_r117045613 — Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/java/StreamTableEnvironment.scala — @@ -144,13 +144,119 @@ class StreamTableEnvironment( types: Fields are mapped by position, field types must match. - POJO [ [DataStream] ] types: Fields are mapped by field name, field types must match. * + * NOTE: This method only supports conversion of append-only tables. In order to make this + * more explicit in the future, please use [ [toAppendStream()] ] instead. + * If add and retract messages are required, use [ [toRetractStream()] ]. + * + * @param table The [ [Table] ] to convert. + * @param clazz The class of the type of the resulting [ [DataStream] ]. + * @tparam T The type of the resulting [ [DataStream] ]. + * @return The converted [ [DataStream] ]. + * @deprecated This method only supports conversion of append-only tables. In order to + * make this more explicit in the future, please use toAppendStream() instead. + */ + @Deprecated + def toDataStream [T] (table: Table, clazz: Class [T] ): DataStream [T] = toAppendStream(table, clazz) + + /** + * Converts the given [ [Table] ] into an append [ [DataStream] ] of a specified type. + * + * The [ [Table] ] must only have insert (append) changes. If the [ [Table] ] is also modified + * by update or delete changes, the conversion will fail. + * + * The fields of the [ [Table] ] are mapped to [ [DataStream] ] fields as follows: + * - [ [org.apache.flink.types.Row] ] and [ [org.apache.flink.api.java.tuple.Tuple] ] + * types: Fields are mapped by position, field types must match. + * - POJO [ [DataStream] ] types: Fields are mapped by field name, field types must match. + * + * NOTE: This method only supports conversion of append-only tables. In order to make this + * more explicit in the future, please use [ [toAppendStream()] ] instead. + * If add and retract messages are required, use [ [toRetractStream()] ]. + * + * @param table The [ [Table] ] to convert. + * @param typeInfo The [ [TypeInformation] ] that specifies the type of the [ [DataStream] ]. + * @tparam T The type of the resulting [ [DataStream] ]. + * @return The converted [ [DataStream] ]. + * @deprecated This method only supports conversion of append-only tables. In order to + * make this more explicit in the future, please use toAppendStream() instead. + */ + def toDataStream [T] (table: Table, typeInfo: TypeInformation [T] ): DataStream [T] = End diff – add `@Deprecated` annotation
          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/flink/pull/3929#discussion_r117050100

          — Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/java/StreamTableEnvironment.scala —
          @@ -144,13 +144,119 @@ class StreamTableEnvironment(

          • types: Fields are mapped by position, field types must match.
          • - POJO [[DataStream]] types: Fields are mapped by field name, field types must match.
            *
            + * NOTE: This method only supports conversion of append-only tables. In order to make this
            + * more explicit in the future, please use [[toAppendStream()]] instead.
            + * If add and retract messages are required, use [[toRetractStream()]].
            + *
            + * @param table The [[Table]] to convert.
            + * @param clazz The class of the type of the resulting [[DataStream]].
            + * @tparam T The type of the resulting [[DataStream]].
            + * @return The converted [[DataStream]].
            + * @deprecated This method only supports conversion of append-only tables. In order to
            + * make this more explicit in the future, please use toAppendStream() instead.
            + */
            + @Deprecated
            + def toDataStream[T](table: Table, clazz: Class[T]): DataStream[T] = toAppendStream(table, clazz)
              • End diff –

          This method is still referenced from the `java` `package-info.java` file and the `java` `SqlITCase`.

          Show
          githubbot ASF GitHub Bot added a comment - Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/3929#discussion_r117050100 — Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/java/StreamTableEnvironment.scala — @@ -144,13 +144,119 @@ class StreamTableEnvironment( types: Fields are mapped by position, field types must match. - POJO [ [DataStream] ] types: Fields are mapped by field name, field types must match. * + * NOTE: This method only supports conversion of append-only tables. In order to make this + * more explicit in the future, please use [ [toAppendStream()] ] instead. + * If add and retract messages are required, use [ [toRetractStream()] ]. + * + * @param table The [ [Table] ] to convert. + * @param clazz The class of the type of the resulting [ [DataStream] ]. + * @tparam T The type of the resulting [ [DataStream] ]. + * @return The converted [ [DataStream] ]. + * @deprecated This method only supports conversion of append-only tables. In order to + * make this more explicit in the future, please use toAppendStream() instead. + */ + @Deprecated + def toDataStream [T] (table: Table, clazz: Class [T] ): DataStream [T] = toAppendStream(table, clazz) End diff – This method is still referenced from the `java` `package-info.java` file and the `java` `SqlITCase`.
          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/flink/pull/3929#discussion_r117045675

          — Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/java/StreamTableEnvironment.scala —
          @@ -144,13 +144,119 @@ class StreamTableEnvironment(

          • types: Fields are mapped by position, field types must match.
          • - POJO [[DataStream]] types: Fields are mapped by field name, field types must match.
            *
            + * NOTE: This method only supports conversion of append-only tables. In order to make this
            + * more explicit in the future, please use [[toAppendStream()]] instead.
            + * If add and retract messages are required, use [[toRetractStream()]].
            + *
            + * @param table The [[Table]] to convert.
            + * @param clazz The class of the type of the resulting [[DataStream]].
            + * @tparam T The type of the resulting [[DataStream]].
            + * @return The converted [[DataStream]].
            + * @deprecated This method only supports conversion of append-only tables. In order to
            + * make this more explicit in the future, please use toAppendStream() instead.
            + */
            + @Deprecated
            + def toDataStream[T](table: Table, clazz: Class[T]): DataStream[T] = toAppendStream(table, clazz)
            +
            + /**
            + * Converts the given [[Table]] into an append [[DataStream]] of a specified type.
            + *
            + * The [[Table]] must only have insert (append) changes. If the [[Table]] is also modified
            + * by update or delete changes, the conversion will fail.
            + *
            + * The fields of the [[Table]] are mapped to [[DataStream]] fields as follows:
            + * - [[org.apache.flink.types.Row]] and [[org.apache.flink.api.java.tuple.Tuple]]
            + * types: Fields are mapped by position, field types must match.
            + * - POJO [[DataStream]] types: Fields are mapped by field name, field types must match.
            + *
            + * NOTE: This method only supports conversion of append-only tables. In order to make this
            + * more explicit in the future, please use [[toAppendStream()]] instead.
            + * If add and retract messages are required, use [[toRetractStream()]].
            + *
            + * @param table The [[Table]] to convert.
            + * @param typeInfo The [[TypeInformation]] that specifies the type of the [[DataStream]].
            + * @tparam T The type of the resulting [[DataStream]].
            + * @return The converted [[DataStream]].
            + * @deprecated This method only supports conversion of append-only tables. In order to
            + * make this more explicit in the future, please use toAppendStream() instead.
            + */
            + def toDataStream[T](table: Table, typeInfo: TypeInformation[T]): DataStream[T] =
            + toAppendStream(table, typeInfo)
            +
            + /**
            + * Converts the given [[Table]] into an append [[DataStream]] of a specified type.
            + *
            + * The [[Table]] must only have insert (append) changes. If the [[Table]] is also modified
            + * by update or delete changes, the conversion will fail.
            + *
            + * The fields of the [[Table]] are mapped to [[DataStream]] fields as follows:
            + * - [[org.apache.flink.types.Row]] and [[org.apache.flink.api.java.tuple.Tuple]]
            + * types: Fields are mapped by position, field types must match.
            + * - POJO [[DataStream]] types: Fields are mapped by field name, field types must match.
            + *
            + * NOTE: This method only supports conversion of append-only tables. In order to make this
            + * more explicit in the future, please use [[toAppendStream()]] instead.
            + * If add and retract messages are required, use [[toRetractStream()]].
            + *
            + * @param table The [[Table]] to convert.
            + * @param clazz The class of the type of the resulting [[DataStream]].
            + * @param queryConfig The configuration of the query to generate.
            + * @tparam T The type of the resulting [[DataStream]].
            + * @return The converted [[DataStream]].
            + * @deprecated This method only supports conversion of append-only tables. In order to
            + * make this more explicit in the future, please use toAppendStream() instead.
            + */
            + def toDataStream[T](
              • End diff –

          add `@Deprecated` annotation

          Show
          githubbot ASF GitHub Bot added a comment - Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/3929#discussion_r117045675 — Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/java/StreamTableEnvironment.scala — @@ -144,13 +144,119 @@ class StreamTableEnvironment( types: Fields are mapped by position, field types must match. - POJO [ [DataStream] ] types: Fields are mapped by field name, field types must match. * + * NOTE: This method only supports conversion of append-only tables. In order to make this + * more explicit in the future, please use [ [toAppendStream()] ] instead. + * If add and retract messages are required, use [ [toRetractStream()] ]. + * + * @param table The [ [Table] ] to convert. + * @param clazz The class of the type of the resulting [ [DataStream] ]. + * @tparam T The type of the resulting [ [DataStream] ]. + * @return The converted [ [DataStream] ]. + * @deprecated This method only supports conversion of append-only tables. In order to + * make this more explicit in the future, please use toAppendStream() instead. + */ + @Deprecated + def toDataStream [T] (table: Table, clazz: Class [T] ): DataStream [T] = toAppendStream(table, clazz) + + /** + * Converts the given [ [Table] ] into an append [ [DataStream] ] of a specified type. + * + * The [ [Table] ] must only have insert (append) changes. If the [ [Table] ] is also modified + * by update or delete changes, the conversion will fail. + * + * The fields of the [ [Table] ] are mapped to [ [DataStream] ] fields as follows: + * - [ [org.apache.flink.types.Row] ] and [ [org.apache.flink.api.java.tuple.Tuple] ] + * types: Fields are mapped by position, field types must match. + * - POJO [ [DataStream] ] types: Fields are mapped by field name, field types must match. + * + * NOTE: This method only supports conversion of append-only tables. In order to make this + * more explicit in the future, please use [ [toAppendStream()] ] instead. + * If add and retract messages are required, use [ [toRetractStream()] ]. + * + * @param table The [ [Table] ] to convert. + * @param typeInfo The [ [TypeInformation] ] that specifies the type of the [ [DataStream] ]. + * @tparam T The type of the resulting [ [DataStream] ]. + * @return The converted [ [DataStream] ]. + * @deprecated This method only supports conversion of append-only tables. In order to + * make this more explicit in the future, please use toAppendStream() instead. + */ + def toDataStream [T] (table: Table, typeInfo: TypeInformation [T] ): DataStream [T] = + toAppendStream(table, typeInfo) + + /** + * Converts the given [ [Table] ] into an append [ [DataStream] ] of a specified type. + * + * The [ [Table] ] must only have insert (append) changes. If the [ [Table] ] is also modified + * by update or delete changes, the conversion will fail. + * + * The fields of the [ [Table] ] are mapped to [ [DataStream] ] fields as follows: + * - [ [org.apache.flink.types.Row] ] and [ [org.apache.flink.api.java.tuple.Tuple] ] + * types: Fields are mapped by position, field types must match. + * - POJO [ [DataStream] ] types: Fields are mapped by field name, field types must match. + * + * NOTE: This method only supports conversion of append-only tables. In order to make this + * more explicit in the future, please use [ [toAppendStream()] ] instead. + * If add and retract messages are required, use [ [toRetractStream()] ]. + * + * @param table The [ [Table] ] to convert. + * @param clazz The class of the type of the resulting [ [DataStream] ]. + * @param queryConfig The configuration of the query to generate. + * @tparam T The type of the resulting [ [DataStream] ]. + * @return The converted [ [DataStream] ]. + * @deprecated This method only supports conversion of append-only tables. In order to + * make this more explicit in the future, please use toAppendStream() instead. + */ + def toDataStream [T] ( End diff – add `@Deprecated` annotation
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user fhueske commented on the issue:

          https://github.com/apache/flink/pull/3929

          Will fix the remaining issues and merge this for RC2 of Flink 1.3.0.

          Show
          githubbot ASF GitHub Bot added a comment - Github user fhueske commented on the issue: https://github.com/apache/flink/pull/3929 Will fix the remaining issues and merge this for RC2 of Flink 1.3.0.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/flink/pull/3929

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/flink/pull/3929
          Hide
          fhueske Fabian Hueske added a comment -

          Done for 1.3.0 with 0246ce51aaa12ce6ce4ac95898e014916a99ccd2
          Done for 1.4.0 with 3a65e5acbcc29636b0ce1631815861089fc21dca

          Show
          fhueske Fabian Hueske added a comment - Done for 1.3.0 with 0246ce51aaa12ce6ce4ac95898e014916a99ccd2 Done for 1.4.0 with 3a65e5acbcc29636b0ce1631815861089fc21dca

            People

            • Assignee:
              twalthr Timo Walther
              Reporter:
              twalthr Timo Walther
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development