Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/1867#discussion_r59224299
--- Diff: docs/apis/batch/libs/table.md ---
@@ -408,3 +428,132 @@ Here, `literal` is a valid Java literal and `field
reference` specifies a column
column names follow Java identifier syntax.
Only the types `LONG` and `STRING` can be casted to `DATE` and vice versa.
A `LONG` casted to `DATE` must be a milliseconds timestamp. A `STRING` casted
to `DATE` must have the format "`yyyy-MM-dd HH:mm:ss.SSS`", "`yyyy-MM-dd`",
"`HH:mm:ss`", or a milliseconds timestamp. By default, all timestamps refer to
the UTC timezone beginning from January 1, 1970, 00:00:00 in milliseconds.
+
+{% top %}
+
+SQL
+----
+The Table API also supports embedded SQL queries.
+In order to use a `Table` or `DataSet` in a SQL query, it has to be
registered in the `TableEnvironment`, using a unique name.
+A registered `Table` can be retrieved back from the `TableEnvironment`
using the `scan` method:
+
+<div class="codetabs" markdown="1">
+<div data-lang="java" markdown="1">
+{% highlight java %}
+ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
+// create a Table environment
+TableEnvironment tableEnv = new TableEnvironment();
+// reset the translation context: this will erase existing registered
Tables
+TranslationContext.reset();
+// read a DataSet from an external source
+DataSet<Tuple2<Integer, Long>> ds = env.readTextFile(...);
--- End diff --
`readTextFile()` results in a `DataSet<String>`. We need to add a `map`
step or use `readCsvFile()`.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---