Github user jamescao commented on the pull request:
https://github.com/apache/flink/pull/939#issuecomment-127451006
It turns out that moving `TableEnvironment` to `org.apache.flink.api.table`
may not be a clean solution to this problem. the `toDataSet()` and
`toDataStream()` methods of `TableEnvironment` will return java DataSet and
java DataStream while for scala api, there are already `toDataSet` and
`toDataStream` in `TableConversions` that return correct scala types.
I personally feel that to read csv into a table in scala api, a user could
do
`val data = env.readCsvFile(...)`
`Table t = data.toTable()`
To combine these two lines in to a `fromCsvFile()` method doesn't make the
task much easier. A lot of duplicated code needs to be writen to pass the csv
parsing options and type infos from `fromCsvFile()` to `readCsvFile()`. Any
advice on this point?
@chiwanpark @fhueske
For the java api, If we pass `CsvReader` as an argument to `fromCsvFile()`
or rename it to `fromCsvReader()`, then we don't need to introduce CsvOptions
any more. Which will save a lot of duplicated code in my opinion. Any
suggestions?
---
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.
---