Return-Path: X-Original-To: apmail-drill-dev-archive@www.apache.org Delivered-To: apmail-drill-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9429218F3A for ; Tue, 6 Oct 2015 18:45:26 +0000 (UTC) Received: (qmail 99661 invoked by uid 500); 6 Oct 2015 18:45:26 -0000 Delivered-To: apmail-drill-dev-archive@drill.apache.org Received: (qmail 99606 invoked by uid 500); 6 Oct 2015 18:45:26 -0000 Mailing-List: contact dev-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list dev@drill.apache.org Received: (qmail 99594 invoked by uid 99); 6 Oct 2015 18:45:26 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Oct 2015 18:45:26 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id ADD6E1A2146 for ; Tue, 6 Oct 2015 18:45:25 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4 X-Spam-Level: **** X-Spam-Status: No, score=4 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=3, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H2=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 7sCrPNWJrqKF for ; Tue, 6 Oct 2015 18:45:19 +0000 (UTC) Received: from mail-io0-f177.google.com (mail-io0-f177.google.com [209.85.223.177]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 5C65C20F7B for ; Tue, 6 Oct 2015 18:45:19 +0000 (UTC) Received: by ioiz6 with SMTP id z6so231948253ioi.2 for ; Tue, 06 Oct 2015 11:45:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=qqGbklc7Tnpml8UGBN6E91W6J6+rp9TlZan6tNvLxZc=; b=eM3MSp39zL7C8R8RtPpLoYEy5uZskDXinJyaMIdUhqltg486qWuT7jLgOAGDoY4wPY HukUb+eJFBqDAqVMhvgMUgTvcOOMxlv3t8DmDdWHsRbJC8m4UNmhJe4kOliHZTBQ3mn8 0MKepHvwJblBUnsReBYOhGptXx7AUot4Fi0Os+nUK/+x1A7qt+UW6YRv6N0VGcGywVBf Ad+ZIDEO7QAxHAX0OmbHZkngVOXJsj3/VKEO319Wleki0EN2xRBGhy7V4eXDkeTaMFGj piotgx4r/xnCU9D7micGxD2R3tOeEpSkrVofQ/JMwVGnx0uNDEtvyaggZ32B2cGbLsbV LpbA== X-Gm-Message-State: ALoCoQmHuYil+hB7tv1yTswHOF2WIqz4eO4PY8ZEyhu27cw72/SCKfopSj6TE0fmsW4VldTv7mQO MIME-Version: 1.0 X-Received: by 10.107.164.38 with SMTP id n38mr35176580ioe.66.1444157118691; Tue, 06 Oct 2015 11:45:18 -0700 (PDT) Received: by 10.107.162.76 with HTTP; Tue, 6 Oct 2015 11:45:18 -0700 (PDT) In-Reply-To: References: Date: Tue, 6 Oct 2015 11:45:18 -0700 Message-ID: Subject: Re: [UDF] How do I return NULL From: Steven Phillips To: dev@drill.apache.org Cc: Tugdual Grall Content-Type: multipart/alternative; boundary=001a114226320f643205217408c6 --001a114226320f643205217408c6 Content-Type: text/plain; charset=UTF-8 In addition, your UDF needs to have the attribute "nulls = NullHandling.INTERNAL" On Tue, Oct 6, 2015 at 8:32 AM, Abdel Hakim Deneche wrote: > Hi Tug, > > Let's say your UDF returns an int, your @output field will be defined like > this: > > @Output NullableIntHolder out; > > > To return a NULL you just have to set: > > out.isSet = 0; > > > Thanks > > On Tue, Oct 6, 2015 at 1:56 AM, Tugdual Grall wrote: > > > Hello Drillers, > > > > I am developing a custom function and I would like to return NULL (based > on > > the value, for example if the varchar is '' I want my function to return > > NULL) > > > > I have not found the way to do it. > > > > > > Regards > > Tug > > @tgrall > > > > > > -- > > Abdelhakim Deneche > > Software Engineer > > > > > Now Available - Free Hadoop On-Demand Training > < > http://www.mapr.com/training?utm_source=Email&utm_medium=Signature&utm_campaign=Free%20available > > > --001a114226320f643205217408c6--