From issues-return-152450-archive-asf-public=cust-asf.ponee.io@flink.apache.org Tue Feb 13 19:14:06 2018 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 3114A18067B for ; Tue, 13 Feb 2018 19:14:06 +0100 (CET) Received: (qmail 89664 invoked by uid 500); 13 Feb 2018 18:14:05 -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 89655 invoked by uid 99); 13 Feb 2018 18:14:05 -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; Tue, 13 Feb 2018 18:14:05 +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 C8581C05E9 for ; Tue, 13 Feb 2018 18:14:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 20KRZdDvvX0J for ; Tue, 13 Feb 2018 18:14:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 8D8665FAC2 for ; Tue, 13 Feb 2018 18:14:02 +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 117B5E0294 for ; Tue, 13 Feb 2018 18:14:01 +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 4578C24112 for ; Tue, 13 Feb 2018 18:14:00 +0000 (UTC) Date: Tue, 13 Feb 2018 18:14:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-8649) Scala StreamExecutionEnvironment.createInput should pass on the TypeInfo 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-8649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16362771#comment-16362771 ] ASF GitHub Bot commented on FLINK-8649: --------------------------------------- GitHub user ggevay opened a pull request: https://github.com/apache/flink/pull/5479 [FLINK-8649] [scala api] Pass on TypeInfo in StreamExecutionEnvironment.createInput ## What is the purpose of the change In the Scala API, modify `StreamExecutionEnvironment.createInput` to pass through the implicitly got TypeInfo to the java `createInput` call. With the old code, the Java API tries to figure out the TypeInfo on its own, which doesn't always work as well as the TypeInfo creation of the Scala API. Note that if the input format implements `ResultTypeQueryable`, then we would like to retain the old behaviour, so we just do the call into the Java API in the old way in this case. (`ResultTypeQueryable` can sometimes give a better type than the Scala TypeInfo creation, e.g. when the result type depends on parametrization of the input format.) ## Verifying this change This change is a trivial rework / code cleanup without any test coverage. ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): no - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no - The serializers: no - The runtime per-record code paths (performance sensitive): no - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: no - The S3 file system connector: no ## Documentation - Does this pull request introduce a new feature? no You can merge this pull request into a Git repository by running: $ git pull https://github.com/ggevay/flink createInput-typeInfo Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/5479.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #5479 ---- commit d03b67feed45c07f8b886eca1042781d658b1af0 Author: Gabor Gevay Date: 2018-02-13T17:09:05Z [FLINK-8649] [scala api] Pass on TypeInfo in StreamExecutionEnvironment.createInput ---- > Scala StreamExecutionEnvironment.createInput should pass on the TypeInfo > ------------------------------------------------------------------------ > > Key: FLINK-8649 > URL: https://issues.apache.org/jira/browse/FLINK-8649 > Project: Flink > Issue Type: Bug > Components: Scala API > Affects Versions: 1.4.0 > Reporter: Gabor Gevay > Assignee: Gabor Gevay > Priority: Trivial > Fix For: 1.5.0 > > > This is {{StreamExecutionEnvironment.createInput}} in the Scala API: > {code} > def createInput[T: TypeInformation](inputFormat: InputFormat[T, _]): DataStream[T] = > asScalaStream(javaEnv.createInput(inputFormat)) > {code} > It should pass on the implicitly got {{TypeInformation}} to Java like this: > {code} > def createInput[T: TypeInformation](inputFormat: InputFormat[T, _]): DataStream[T] = > asScalaStream(javaEnv.createInput(inputFormat, implicitly[TypeInformation[T]])) > {code} > The current situation creates a problem, for example, when we have generics in the type like in the following code, where the Java API can't deduce the {{TypeInformation}} on its own: > {code} > StreamExecutionEnvironment.getExecutionEnvironment.createInput[Tuple2[Integer, Integer]](new ParallelIteratorInputFormat[Tuple2[Integer, Integer]](null)) > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)