From user-return-25305-archive-asf-public=cust-asf.ponee.io@flink.apache.org Sun Jan 13 19:17:07 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 60A4A18062C for ; Sun, 13 Jan 2019 19:17:07 +0100 (CET) Received: (qmail 41308 invoked by uid 500); 13 Jan 2019 18:17:01 -0000 Mailing-List: contact user-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list user@flink.apache.org Received: (qmail 41298 invoked by uid 99); 13 Jan 2019 18:17:01 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Jan 2019 18:17:01 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id AD50A180D48 for ; Sun, 13 Jan 2019 18:17:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.111 X-Spam-Level: *** X-Spam-Status: No, score=3.111 tagged_above=-999 required=6.31 tests=[DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URI_HEX=1.313] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id kneOred82naN for ; Sun, 13 Jan 2019 18:16:57 +0000 (UTC) Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 7B4685FB0C for ; Sun, 13 Jan 2019 18:16:57 +0000 (UTC) Received: by mail-lf1-f67.google.com with SMTP id l10so14061067lfh.9 for ; Sun, 13 Jan 2019 10:16:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qXggGLDzgVD9lri99trg9vH5Rx328XpQtRcyqrT0W4s=; b=BcY3lnANmnFiZv2YMZ3ZwMfXYsbMTPFlRuBQqIRMC13SSdt20mWe4Xid9B14YoOGA9 jxA0ejLanbfrXBohEB9tLU+945QqUgLtGd+r9D9hPAouicUYCvWrCgxBhramCCJkIu8L 06nyRk6/wbqZBTJzRF23XL1YmwNOSwPWI4QnPpUSKTJya8/5RirAKQImMLFVuOYkjTqJ k8wI1S2YdMlJ+WWF+ErXRnFuAQPhm0x1FR+NhNuiWIUoZwCE6qjcmfSEHMj5SNcPMME1 /OOk3LgpG/3/J+lybklPU/cpMVl9ygFCnJWdrWpR02UQo8n4+GwhHcMPjins7Q68md4F MXTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qXggGLDzgVD9lri99trg9vH5Rx328XpQtRcyqrT0W4s=; b=h1D/p8sG0KPQBI//qrhu6w3Tu8MEgAUjyHB+Fjepe7/htUo3xoGRdr9yVTKUX6ErUU f++68fRG+Fiqh0eHE6bC9Q5bU/3P2FnbKe/2JLegDPglDClm2rALYiZas7ZTdt8Y/Thl 2WoUoZjzhYwVCiyiOU9G1gfkD2WQM/zuRMdTpwVKLGrZ8ccFxpP/4ma/3D4IfaAAYaHl tk7R6cTBzLEFT5YldIKdAiCVpID6gw4tMfAOa7k+wpAPamv8w8FPCsXzA9AMO+UrLQRH UoZ/b6dD8A8leu/w7ogNjdwSfL4Q/xvn/0dNjLmWyU6usGvUrJOawhmGi6iksT3onuE2 vihw== X-Gm-Message-State: AJcUukfOuyOi1dZYxUEDeyJoJ5+sWwiy2fQ7ELiSErjcY/NCuGVIbh+8 rvEl4TedrQicfIn3vy1c7pZ+m2p4aDaQ6JeYytM= X-Google-Smtp-Source: ALg8bN7YO3BMByaFZ1yT5GZSleoe8t+zafkrwMtf0di7oCh9UV2MJE9PDCKawqPPblEvja+0MCbU1Qcljieg70AmCmc= X-Received: by 2002:ac2:53bc:: with SMTP id j28mr12471246lfh.86.1547403416589; Sun, 13 Jan 2019 10:16:56 -0800 (PST) MIME-Version: 1.0 References: <1547233924411-0.post@n4.nabble.com> <1547365364166-0.post@n4.nabble.com> In-Reply-To: <1547365364166-0.post@n4.nabble.com> From: Rong Rong Date: Sun, 13 Jan 2019 10:16:45 -0800 Message-ID: Subject: Re: Is the eval method invoked in a thread safe manner in Fink UDF To: Anil Cc: user Content-Type: multipart/alternative; boundary="000000000000f85b16057f5aee84" --000000000000f85b16057f5aee84 Content-Type: text/plain; charset="UTF-8" According to the codegen result, I think each field is invoked sequentially. However, if you maintain internal state within your UDF, it is your responsibility to maintain the internal state consistency. Are you invoking external RPC in your "GetName" UDF method and that has to be async? -- Rong On Sat, Jan 12, 2019 at 11:42 PM Anil wrote: > Thanks Hequn!. Is it also thread safe when the same UDF is called multiple > times in the same record. > Is the UDF called sequentially for each fields a single record, I have a > query like - > select GetName(data.id, 'city'), GetName(data.id, 'zone') from ...... > > > > > -- > Sent from: > http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/ > --000000000000f85b16057f5aee84 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
According to the codegen result, I think each field is inv= oked sequentially.=C2=A0

However, if you maintain intern= al state within your UDF, it is your responsibility to maintain the interna= l state consistency.=C2=A0
Are you invoking external RPC in your = "GetName" UDF method and that has to be async?

<= /div>
--
Rong

On Sat, Jan 12, 2019 at 11:42 PM Anil <anilsingh.jsr@gmail.com> wrote:<= br>
Thanks Hequn!. I= s it also thread safe when the same UDF is called multiple
times in the same record.
Is the UDF called sequentially for each fields a single record,=C2=A0 I hav= e a
query like=C2=A0 -
=C2=A0 =C2=A0 =C2=A0select GetName(data.id, 'city'), GetName(data.id, 'zone&#= 39;) from ......




--
Sent from: http://apache-flink-u= ser-mailing-list-archive.2336050.n4.nabble.com/
--000000000000f85b16057f5aee84--