[
https://issues.apache.org/jira/browse/FLINK-5714?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15860548#comment-15860548
]
ASF GitHub Bot commented on FLINK-5714:
---------------------------------------
Github user wuchong commented on a diff in the pull request:
https://github.com/apache/flink/pull/3273#discussion_r100458059
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/sources/CsvTableSource.scala
---
@@ -44,15 +47,15 @@ import org.apache.flink.table.api.TableException
* @param lenient Flag to skip records with parse error instead to fail,
false by default.
*/
class CsvTableSource(
- path: String,
- fieldNames: Array[String],
- fieldTypes: Array[TypeInformation[_]],
- fieldDelim: String = CsvInputFormat.DEFAULT_FIELD_DELIMITER,
- rowDelim: String = CsvInputFormat.DEFAULT_LINE_DELIMITER,
- quoteCharacter: Character = null,
- ignoreFirstLine: Boolean = false,
- ignoreComments: String = null,
- lenient: Boolean = false)
+ private val path: String,
--- End diff --
Actually, I want to access these fields in the `equals(Object)` by
`that.path`. The `private val` modifier will create getter/setter implicitly.
> Use a builder pattern for creating CsvTableSource
> -------------------------------------------------
>
> Key: FLINK-5714
> URL: https://issues.apache.org/jira/browse/FLINK-5714
> Project: Flink
> Issue Type: Improvement
> Components: Table API & SQL
> Reporter: Timo Walther
> Assignee: Jark Wu
>
> Right now, the constructor of the CsvTableSource can have up to 9 parameters.
> In Scala this might not be a problem because of default values, but Java
> doesn't have this functionality.
> I propose to have a builder pattern here:
> {code}
> CsvTableSource
> .builder()
> .field("myfield", Types.STRING)
> .field("myfield2", Types.INT)
> .quoteCharacter(';')
> .build()
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)