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 7B0F2200D31 for ; Sat, 21 Oct 2017 00:04:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 79A87160BCB; Fri, 20 Oct 2017 22:04:04 +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 C0881160BED for ; Sat, 21 Oct 2017 00:04:03 +0200 (CEST) Received: (qmail 88170 invoked by uid 500); 20 Oct 2017 22:04: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 88161 invoked by uid 99); 20 Oct 2017 22:04:02 -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; Fri, 20 Oct 2017 22:04:02 +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 15282C1DE9 for ; Fri, 20 Oct 2017 22:04:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-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 QNiynlfrulED for ; Fri, 20 Oct 2017 22:04: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 0816D5FD38 for ; Fri, 20 Oct 2017 22:04: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 7ECDAE00C9 for ; Fri, 20 Oct 2017 22:04: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 3369E21EE4 for ; Fri, 20 Oct 2017 22:04:00 +0000 (UTC) Date: Fri, 20 Oct 2017 22:04:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-7755) Null values are not correctly handled by batch inner and outer joins MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 20 Oct 2017 22:04:04 -0000 [ https://issues.apache.org/jira/browse/FLINK-7755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16213322#comment-16213322 ] ASF GitHub Bot commented on FLINK-7755: --------------------------------------- Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/4858#discussion_r146076115 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/rules/dataSet/DataSetJoinRule.scala --- @@ -41,8 +41,7 @@ class DataSetJoinRule val joinInfo = join.analyzeCondition // joins require an equi-condition or a conjunctive predicate with at least one equi-condition - // and disable outer joins with non-equality predicates(see FLINK-5520) - !joinInfo.pairs().isEmpty && (joinInfo.isEqui || join.getJoinType == JoinRelType.INNER) + !joinInfo.pairs().isEmpty --- End diff -- Yes, that is true but the rule are also applied in different contexts. `FlinkLogicalJoin` is used for the initial translation of batch and stream programs and `DataSetJoinRule` only for batch. I think it's OK to have these checks as safety net. > Null values are not correctly handled by batch inner and outer joins > -------------------------------------------------------------------- > > Key: FLINK-7755 > URL: https://issues.apache.org/jira/browse/FLINK-7755 > Project: Flink > Issue Type: Bug > Components: Table API & SQL > Affects Versions: 1.4.0, 1.3.2 > Reporter: Fabian Hueske > Assignee: Fabian Hueske > Priority: Blocker > Fix For: 1.4.0, 1.3.3 > > > Join predicates of batch joins are not correctly evaluated according to three-value logic. > This affects inner as well as outer joins. > The problem is that some equality predicates are only evaluated by the internal join algorithms of Flink which are based on {{TypeComparator}}. The field {{TypeComparator}} for {{Row}} are implemented such that {{null == null}} results in {{TRUE}} to ensure correct ordering and grouping. However, three-value logic requires that {{null == null}} results to {{UNKNOWN}} (or null). The code generator implements this logic correctly, but for equality predicates, no code is generated. > For outer joins, the problem is a bit tricker because these do not support code-generated predicates yet (see FLINK-5520). FLINK-5498 proposes a solution for this issue. > We also need to extend several of the existing tests and add null values to ensure that the join logic is correctly implemented. -- This message was sent by Atlassian JIRA (v6.4.14#64029)