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 8D531200CD6 for ; Mon, 31 Jul 2017 09:13:11 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8BADE164300; Mon, 31 Jul 2017 07:13:11 +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 D214C16416F for ; Mon, 31 Jul 2017 09:13:10 +0200 (CEST) Received: (qmail 41301 invoked by uid 500); 31 Jul 2017 07:13:10 -0000 Mailing-List: contact dev-help@datafu.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@datafu.incubator.apache.org Delivered-To: mailing list dev@datafu.incubator.apache.org Received: (qmail 41290 invoked by uid 99); 31 Jul 2017 07:13:09 -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; Mon, 31 Jul 2017 07:13:09 +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 6E11AC0B42 for ; Mon, 31 Jul 2017 07:13:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.001 X-Spam-Level: X-Spam-Status: No, score=-100.001 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] 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 C-Tf6MGX4_Oh for ; Mon, 31 Jul 2017 07:13:01 +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 5E7F75F6D2 for ; Mon, 31 Jul 2017 07:13:01 +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 D449FE0D54 for ; Mon, 31 Jul 2017 07:13:00 +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 2FD8924651 for ; Mon, 31 Jul 2017 07:13:00 +0000 (UTC) Date: Mon, 31 Jul 2017 07:13:00 +0000 (UTC) From: "Eyal Allweil (JIRA)" To: dev@datafu.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DATAFU-83) InUDF does not validate that types are compatible MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 31 Jul 2017 07:13:11 -0000 [ https://issues.apache.org/jira/browse/DATAFU-83?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16106894#comment-16106894 ] Eyal Allweil commented on DATAFU-83: ------------------------------------ Hi Kyle ([~ItsAUsernameRight?]) Your help is very welcome. I have two comments about the state of the contribution - I'll put them both here and in the review board for maximum visibility. 1. I think the output schema of this UDF is always boolean, not the schema of the first input field. I would make the outputSchema method identical to that in an existing Boolean UDF - for example, [Pig's ENDSWITH built-in function|https://github.com/apache/pig/blob/trunk/src/org/apache/pig/builtin/ENDSWITH.java#L62] 2. As Matthew already wrote in the review board, adding a case to the unit test is a good idea - you can probably just duplicate something from [the existing test|https://github.com/apache/incubator-datafu/blob/master/datafu-pig/src/test/java/datafu/test/pig/util/InTests.java]. Thanks! > InUDF does not validate that types are compatible > ------------------------------------------------- > > Key: DATAFU-83 > URL: https://issues.apache.org/jira/browse/DATAFU-83 > Project: DataFu > Issue Type: Improvement > Reporter: Matthew Hayes > Priority: Minor > Attachments: DATAFU-83.patch, rb36702.patch > > > See the example below. The input data is a long, but ints are provided to match against. Because it uses the Java equals to compare and these are different types, this will never match, which can lead to confusing results. I believe it should at least throw an error. > {code} > define I datafu.pig.util.InUDF(); > > data = LOAD 'input' AS (B: bag {T: tuple(v:LONG)}); > > data2 = FOREACH data { > C = FILTER B By I(v, 1,2,3); > GENERATE C; > } > > describe data2; > > STORE data2 INTO 'output'; > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)