Return-Path: X-Original-To: apmail-flink-dev-archive@www.apache.org Delivered-To: apmail-flink-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 D2D44188E4 for ; Mon, 9 Nov 2015 09:04:59 +0000 (UTC) Received: (qmail 15584 invoked by uid 500); 9 Nov 2015 09:04:59 -0000 Delivered-To: apmail-flink-dev-archive@flink.apache.org Received: (qmail 15519 invoked by uid 500); 9 Nov 2015 09:04:59 -0000 Mailing-List: contact dev-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 dev@flink.apache.org Received: (qmail 15505 invoked by uid 99); 9 Nov 2015 09:04:59 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Nov 2015 09:04:59 +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 D78B1180440 for ; Mon, 9 Nov 2015 09:04:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.987 X-Spam-Level: ** X-Spam-Status: No, score=2.987 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.008, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id KxmwqW2xC3V3 for ; Mon, 9 Nov 2015 09:04:58 +0000 (UTC) Received: from mail-qk0-f180.google.com (mail-qk0-f180.google.com [209.85.220.180]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id AB05421270 for ; Mon, 9 Nov 2015 09:04:57 +0000 (UTC) Received: by qkcn129 with SMTP id n129so68658213qkc.1 for ; Mon, 09 Nov 2015 01:04:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=crlxCzeLtKznMzSptgbCJdCx7n1vCU7Ljdd7jq+FUv8=; b=CV7ndQDvX39m9m1yanAQQ3Kx7lUoRQJj9wfngb3c/+Ig0/sQUyilSBQ6WXSJQfr1RR Sm7MCuLylWdCXOTSyoCefvJpdgfSUdj5li5JzB3YKjNWJioDQgshM8bsZmB+roPw4Abp yGde4E4zE/xC3H+q718Oq4v63fTFAAPlz8q4mgtR/73MrhJZXw72LU0lqi2koOJii7Hg RXSzGUdfHr1G25OV7GfwKKbaN20eLOD/zXhFRozujc8HFSwitegjicY26wSORma8qmos sMs8C5BenIH4nHPVGjZQzWoK4J7iAoNeeRhewPnTDRkiiepxavP2whnpFgvom/ZzXX9s 0N8g== MIME-Version: 1.0 X-Received: by 10.55.71.146 with SMTP id u140mr27852748qka.17.1447059896776; Mon, 09 Nov 2015 01:04:56 -0800 (PST) Sender: ewenstephan@gmail.com Received: by 10.55.147.1 with HTTP; Mon, 9 Nov 2015 01:04:56 -0800 (PST) In-Reply-To: <56405A16.30004@apache.org> References: <563FCC3A.2060208@apache.org> <563FD076.40003@apache.org> <83AE6276-D61F-4C22-BC58-A80DFB0D3A32@apache.org> <56405A16.30004@apache.org> Date: Mon, 9 Nov 2015 10:04:56 +0100 X-Google-Sender-Auth: PQE8ue4tznAlfIAyUaDJmh0wWGc Message-ID: Subject: Re: Function input type validation From: Stephan Ewen To: "dev@flink.apache.org" Content-Type: multipart/alternative; boundary=001a114a7b961dbcd3052417e35f --001a114a7b961dbcd3052417e35f Content-Type: text/plain; charset=UTF-8 I think this originally comes from the fact that we need to match the input TypeInfo against the generic signature, for example to figure out what "T" means in a MapFunction, T>. That is the reason why Flink can support generic functions even though there is type erasure at runtime. Much nice than nullable types is to use Option[Type] for a field that may be null. In Scala, the OptionTypeInfo adds a null/not-null byte, which is probably what your custom nullable type also does. By adding this for Java (with Java 8 options, or a custom option type) would solve that issue as well. It would also let us retain the benefit that non-nullable fields are efficiently serialized. On Mon, Nov 9, 2015 at 9:32 AM, Chesnay Schepler wrote: > On 09.11.2015 08:49, Aljoscha Krettek wrote: > >> In the case of the TupleTypeInfo subclass it only works because the >> equals method of TypleTypeInfo is used, IMHO. >> > I've overridden the equals method to check specifically for my > implementation and not TupleTypeInfo, implemented a different serializer > (and verified that it is used), and it still works. > --001a114a7b961dbcd3052417e35f--