From issues-return-189790-archive-asf-public=cust-asf.ponee.io@flink.apache.org Fri Sep 21 08:27:04 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 811D5180671 for ; Fri, 21 Sep 2018 08:27:03 +0200 (CEST) Received: (qmail 49312 invoked by uid 500); 21 Sep 2018 06:27:02 -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 49303 invoked by uid 99); 21 Sep 2018 06:27:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Sep 2018 06:27:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 27A7CC1EB2 for ; Fri, 21 Sep 2018 06:27:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 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, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id c2-mR1j9SsCA for ; Fri, 21 Sep 2018 06:27: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 DCD385F3CC for ; Fri, 21 Sep 2018 06:27:00 +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 5AD31E02F1 for ; Fri, 21 Sep 2018 06:27: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 0B00823F99 for ; Fri, 21 Sep 2018 06:27:00 +0000 (UTC) Date: Fri, 21 Sep 2018 06:27:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-10380) Check if key is not nul before assign to group in KeyedStream MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLINK-10380?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D166= 23132#comment-16623132 ]=20 ASF GitHub Bot commented on FLINK-10380: ---------------------------------------- satybald commented on issue #6724: [FLINK-10380] Add precondition for assig= nToKeyGroup method URL: https://github.com/apache/flink/pull/6724#issuecomment-423427348 =20 =20 @StephanEwen agree, try expression doesn't incur any performance penalti= es. Another option that doesn't affect performance is to document that the = key must be not null in keyBy() method. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. =20 For queries about this service, please contact Infrastructure at: users@infra.apache.org > Check if key is not nul before assign to group in KeyedStream > ------------------------------------------------------------- > > Key: FLINK-10380 > URL: https://issues.apache.org/jira/browse/FLINK-10380 > Project: Flink > Issue Type: Task > Affects Versions: 1.6.0 > Reporter: Sayat Satybaldiyev > Priority: Minor > Labels: pull-request-available > > If a user creates a KeyedStream and partition by key which might be null,= Flink job throws NullPointerExceptoin at runtime. However, NPE that Flink = throws hard to debug and understand as it doesn't refer to place=C2=A0in Fl= ink job. > *Suggestion:* > Add precondition that checks if the key is not null and throw a descripti= ve error if it's a null. > =C2=A0 > *Job Example*: > =C2=A0 > {code:java} > DataStream stream =3D env.fromCollection(Arrays.asList("aaa", "bb= b")) > .map(x -> (String)null) > .keyBy(x -> x);{code} > =C2=A0 > =C2=A0 > An error that is thrown: > =C2=A0 > {code:java} > Exception in thread "main" org.apache.flink.runtime.client.JobExecutionEx= ception: java.lang.RuntimeException > at org.apache.flink.runtime.minicluster.MiniCluster.executeJobBlocking(M= iniCluster.java:623) > at org.apache.flink.streaming.api.environment.LocalStreamEnvironment.exe= cute(LocalStreamEnvironment.java:123) > at org.myorg.quickstart.BuggyKeyedStream.main(BuggyKeyedStream.java:61) > Caused by: java.lang.RuntimeException > at org.apache.flink.streaming.runtime.io.RecordWriterOutput.pushToRecord= Writer(RecordWriterOutput.java:110) > at org.apache.flink.streaming.runtime.io.RecordWriterOutput.collect(Reco= rdWriterOutput.java:89)16:26:43,110 INFO org.apache.flink.runtime.rpc.akka.= AkkaRpcService - Stopped Akka RPC service. > at org.apache.flink.streaming.runtime.io.RecordWriterOutput.collect(Recor= dWriterOutput.java:45) > at org.apache.flink.streaming.api.operators.AbstractStreamOperator$Count= ingOutput.collect(AbstractStreamOperator.java:689) > at org.apache.flink.streaming.api.operators.AbstractStreamOperator$Count= ingOutput.collect(AbstractStreamOperator.java:667) > at org.apache.flink.streaming.api.operators.StreamMap.processElement(Str= eamMap.java:41) > at org.apache.flink.streaming.runtime.io.StreamInputProcessor.processInp= ut(StreamInputProcessor.java:202) > at org.apache.flink.streaming.runtime.tasks.OneInputStreamTask.run(OneIn= putStreamTask.java:105) > at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask= .java:300) > at org.apache.flink.runtime.taskmanager.Task.run(Task.java:711) > at java.lang.Thread.run(Thread.java:748) > Caused by: java.lang.NullPointerException > at org.apache.flink.runtime.state.KeyGroupRangeAssignment.assignToKeyGro= up(KeyGroupRangeAssignment.java:59) > at org.apache.flink.runtime.state.KeyGroupRangeAssignment.assignKeyToPar= allelOperator(KeyGroupRangeAssignment.java:48) > at org.apache.flink.streaming.runtime.partitioner.KeyGroupStreamPartitio= ner.selectChannels(KeyGroupStreamPartitioner.java:63) > at org.apache.flink.streaming.runtime.partitioner.KeyGroupStreamPartitio= ner.selectChannels(KeyGroupStreamPartitioner.java:32) > at org.apache.flink.runtime.io.network.api.writer.RecordWriter.emit(Reco= rdWriter.java:104) > at org.apache.flink.streaming.runtime.io.StreamRecordWriter.emit(StreamR= ecordWriter.java:81) > at org.apache.flink.streaming.runtime.io.RecordWriterOutput.pushToRecord= Writer(RecordWriterOutput.java:107) > {code} > ... 10 more -- This message was sent by Atlassian JIRA (v7.6.3#76005)