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 E3ED1200C47 for ; Wed, 22 Feb 2017 15:44:49 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E182F160B72; Wed, 22 Feb 2017 14:44:49 +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 24AB7160B49 for ; Wed, 22 Feb 2017 15:44:48 +0100 (CET) Received: (qmail 66638 invoked by uid 500); 22 Feb 2017 14:44:48 -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 66524 invoked by uid 99); 22 Feb 2017 14:44:48 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Feb 2017 14:44:48 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id C36FCC20D7 for ; Wed, 22 Feb 2017 14:44:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.8 X-Spam-Level: * X-Spam-Status: No, score=1.8 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 3h5ZaS3vWRvV for ; Wed, 22 Feb 2017 14:44:47 +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 F3E1B618B8 for ; Wed, 22 Feb 2017 14:44:46 +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 0C9C6E0BDE for ; Wed, 22 Feb 2017 14:44:46 +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 0444324158 for ; Wed, 22 Feb 2017 14:44:45 +0000 (UTC) Date: Wed, 22 Feb 2017 14:44:45 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-5881) ScalarFunction(UDF) should support variable types and variable arguments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 22 Feb 2017 14:44:50 -0000 [ https://issues.apache.org/jira/browse/FLINK-5881?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15878350#comment-15878350 ] ASF GitHub Bot commented on FLINK-5881: --------------------------------------- Github user wuchong commented on a diff in the pull request: https://github.com/apache/flink/pull/3389#discussion_r102465907 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/functions/utils/UserDefinedFunctionUtils.scala --- @@ -87,10 +87,16 @@ object UserDefinedFunctionUtils { // go over all signatures and find one matching actual signature .find { curSig => // match parameters of signature to actual parameters - actualSignature.length == curSig.length && + (actualSignature.length == curSig.length && curSig.zipWithIndex.forall { case (clazz, i) => parameterTypeEquals(actualSignature(i), clazz) - } + }) || + // matching the style which last argument is variable, eg. "Type..." "Type*" + (actualSignature.length >= curSig.length && + curSig.zipWithIndex.forall { case (clazz, i) => + parameterTypeEquals(actualSignature(i), clazz) || + (i == curSig.length - 1 && clazz.isArray) --- End diff -- We should make sure that the component type of the array class is equal to all of the types of the last `actualSignature .length - curSig.length + 1` actual parameters. > ScalarFunction(UDF) should support variable types and variable arguments > ------------------------------------------------------------------------- > > Key: FLINK-5881 > URL: https://issues.apache.org/jira/browse/FLINK-5881 > Project: Flink > Issue Type: Sub-task > Reporter: Zhuoluo Yang > Assignee: Zhuoluo Yang > > As a sub-task of FLINK-5826. We would like to support the ScalarFunction first and make the review a little bit easier. -- This message was sent by Atlassian JIRA (v6.3.15#6346)