twalthr commented on a change in pull request #11527:  [FLINK-16035] Updated 
Stream/BatchTableEnvironment.java to use Java's Expression DSL
URL: https://github.com/apache/flink/pull/11527#discussion_r398709063
 
 

 ##########
 File path: 
flink-table/flink-table-api-java-bridge/src/main/java/org/apache/flink/table/api/java/BatchTableEnvironment.java
 ##########
 @@ -105,9 +106,30 @@
         * @param fields The field names of the resulting {@link Table}.
         * @param <T> The type of the {@link DataSet}.
         * @return The converted {@link Table}.
+        * @deprecated use {@link #fromDataSet(DataSet, Expression...)}
         */
+       @Deprecated
        <T> Table fromDataSet(DataSet<T> dataSet, String fields);
 
+       /**
+        * Converts the given {@link DataSet} into a {@link Table} with 
specified field names.
+        *
+        * Example:
+        *
+        * <pre>
+        * {@code
+        *   DataSet<Tuple2<String, Long>> set = ...
+        *   Table tab = tableEnv.fromDataSet(set, $("a"), $("b").as("name"), 
$("timestamp").rowtime());
 
 Review comment:
   the example makes no sense. Let's use a tuple 3 and explain each expression.
   ```
   DataSet<Tuple3<String, Long, Timestamp>> set = ...
   Table tab = tableEnv.fromDataSet(
     set,
     $("f0"), // use the original field
     $("f1").as("name"), // give the original field a better name
     $("f2").as("timestamp").rowtime() // give the original field a better name 
and declare it as a rowtime attribute
   );
   ```

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


With regards,
Apache Git Services

Reply via email to