Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9CFDF200C72 for ; Fri, 28 Apr 2017 03:34:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9BB11160BA7; Fri, 28 Apr 2017 01:34:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CEDAF160BBC for ; Fri, 28 Apr 2017 03:34:09 +0200 (CEST) Received: (qmail 75663 invoked by uid 500); 28 Apr 2017 01:34:09 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 75513 invoked by uid 99); 28 Apr 2017 01:34:09 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Apr 2017 01:34:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 82401CCC99 for ; Fri, 28 Apr 2017 01:34:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id yfQLfqyX5dpX for ; Fri, 28 Apr 2017 01:34:07 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id CD93B5FD00 for ; Fri, 28 Apr 2017 01:34:06 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 83AD6E0BD5 for ; Fri, 28 Apr 2017 01:34:06 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id E81B121DFE for ; Fri, 28 Apr 2017 01:34:04 +0000 (UTC) Date: Fri, 28 Apr 2017 01:34:04 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-6334) Refactoring UDTF interface MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 28 Apr 2017 01:34:10 -0000 [ https://issues.apache.org/jira/browse/FLINK-6334?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1598= 8013#comment-15988013 ]=20 ASF GitHub Bot commented on FLINK-6334: --------------------------------------- Github user sunjincheng121 commented on a diff in the pull request: https://github.com/apache/flink/pull/3791#discussion_r113833504 =20 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/t= able/api/TableEnvironment.scala --- @@ -107,6 +107,11 @@ abstract class TableEnvironment(val config: TableC= onfig) { // registered external catalog names -> catalog private val externalCatalogs =3D new HashMap[String, ExternalCatalog= ] =20 + private lazy val tableFunctionParser =3D new TableFunctionParser(thi= s) + + // the method for converting a udtf String to Table for Java API + final def tableApply(udtf: String): Table =3D tableFunctionParser(ud= tf) --- End diff -- =20 `TableFunctionParser` only has one method named `apply`. IMO. It's a ut= il method. So here are 3 suggestions: * If a class only contains util methods, I suggest change `class` to `o= bject`, And tableEnv can be a param of method. * If `TableFunctionParser#apply` only used for `TableFunction`, I sugge= st 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 impl= emented internally in `TableEnvironment` =EF=BC=9F What do you think? @Xpray=20 > 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 th= is 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 (v6.3.15#6346)