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
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---