[ 
https://issues.apache.org/jira/browse/FLINK-2166?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14652926#comment-14652926
 ] 

ASF GitHub Bot commented on FLINK-2166:
---------------------------------------

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?


> Add fromCsvFile() to TableEnvironment
> -------------------------------------
>
>                 Key: FLINK-2166
>                 URL: https://issues.apache.org/jira/browse/FLINK-2166
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table API
>    Affects Versions: 0.9
>            Reporter: Fabian Hueske
>            Priority: Minor
>              Labels: starter
>
> Add a {{fromCsvFile()}} method to the {{TableEnvironment}} to read a 
> {{Table}} from a CSV file.
> The implementation should reuse Flink's CsvInputFormat.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to