flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-6334) Refactoring UDTF interface
Date Fri, 28 Apr 2017 01:34:04 GMT

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

ASF GitHub Bot commented on FLINK-6334:

Github user sunjincheng121 commented on a diff in the pull request:

    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
    @@ -107,6 +107,11 @@ abstract class TableEnvironment(val config: TableConfig) {
       // registered external catalog names -> catalog
       private val externalCatalogs = new HashMap[String, ExternalCatalog]
    +  private lazy val tableFunctionParser = new TableFunctionParser(this)
    +  // the method for converting a udtf String to Table for Java API
    +  final def tableApply(udtf: String): Table = tableFunctionParser(udtf)
    --- End diff --
    `TableFunctionParser` only has one method named `apply`. IMO. It's a util method. So here
are 3 suggestions:
    * If a class only contains util methods, I suggest change `class` to `object`, And tableEnv
can be a param of method.
    * If `TableFunctionParser#apply` only used for `TableFunction`, I suggest move `apply`
method into `UserDefinedFunctionUtils` ,Because all of the functional methods of `UDF/UDTF/UDAF`
in that file.
    * if the method only used for `TableEnvironment`.Whether it can be implemented internally
in `TableEnvironment` ?
    What do you think? @Xpray 

> Refactoring UDTF interface
> --------------------------
>                 Key: FLINK-6334
>                 URL: https://issues.apache.org/jira/browse/FLINK-6334
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table API & SQL
>            Reporter: Ruidong Li
>            Assignee: Ruidong Li
> The current UDTF leverages the table.join(expression) interface, which is not a proper
interface in terms of semantics. We would like to refactor this to let UDTF use table.join(table)
interface. Very briefly,  UDTF's apply method will return a Table Type, so Join(UDTF('a, 'b,
...) as 'c) shall be viewed as join(Table)

This message was sent by Atlassian JIRA

View raw message