Return-Path: X-Original-To: apmail-flink-issues-archive@minotaur.apache.org Delivered-To: apmail-flink-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 61DE91865A for ; Wed, 2 Mar 2016 15:20:19 +0000 (UTC) Received: (qmail 65109 invoked by uid 500); 2 Mar 2016 15:20:18 -0000 Delivered-To: apmail-flink-issues-archive@flink.apache.org Received: (qmail 64990 invoked by uid 500); 2 Mar 2016 15:20:18 -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 64807 invoked by uid 99); 2 Mar 2016 15:20:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Mar 2016 15:20:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 9A2682C1F6A for ; Wed, 2 Mar 2016 15:20:18 +0000 (UTC) Date: Wed, 2 Mar 2016 15:20:18 +0000 (UTC) From: "Gyula Fora (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-3566) Input type validation often fails on custom TypeInfo implementations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLINK-3566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15175770#comment-15175770 ] Gyula Fora commented on FLINK-3566: ----------------------------------- Another example with KeySelectors and interfaces: interface Event { String getKey(); } public static class MyEvent implements Event { @Override public String getKey() { return ""; } } public static void main(String[] args) { StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); DataStream events = env.fromElements(new MyEvent()); applyKeySelector(events); } private static void applyKeySelector(DataStream events) { events.keyBy(e -> e.getKey()); } This gives a following exception: Input mismatch: Generic object type 'package.TypeTest.MyEvent' expected but was 'package.TypeTest.Event'. > Input type validation often fails on custom TypeInfo implementations > -------------------------------------------------------------------- > > Key: FLINK-3566 > URL: https://issues.apache.org/jira/browse/FLINK-3566 > Project: Flink > Issue Type: Bug > Components: Type Serialization System > Reporter: Gyula Fora > > Input type validation often fails when used with custom type infos. One example of this behaviour can be reproduced by creating a custom type info with our own field type: > StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); > env.generateSequence(1, 10).map(new MapFunction>>() { > @Override > public Tuple1> map(Long value) throws Exception { > return Tuple1.of(Optional.of(value)); > } > }).returns(new TupleTypeInfo<>(new OptionTypeInfo(BasicTypeInfo.LONG_TYPE_INFO))) > .keyBy(new KeySelector>, Optional>() { > @Override > public Optional getKey(Tuple1> value) throws Exception { > return value.f0; > } > }); > This will fail on Input type validation at the KeySelector (or any other function for example a mapper) with the following exception: > Input mismatch: Basic type expected. -- This message was sent by Atlassian JIRA (v6.3.4#6332)