{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/21148","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/21148/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/21148/comments","events_url":"https://api.github.com/repos/apache/spark/issues/21148/events","html_url":"https://github.com/apache/spark/pull/21148","id":317474769,"node_id":"MDExOlB1bGxSZXF1ZXN0MTgzOTIyMTIw","number":21148,"title":"[SPARK-24079][SQL] Update the nullability of Join output based on inferred predicates","user":{"login":"maropu","id":692303,"node_id":"MDQ6VXNlcjY5MjMwMw==","avatar_url":"https://avatars3.githubusercontent.com/u/692303?v=4","gravatar_id":"","url":"https://api.github.com/users/maropu","html_url":"https://github.com/maropu","followers_url":"https://api.github.com/users/maropu/followers","following_url":"https://api.github.com/users/maropu/following{/other_user}","gists_url":"https://api.github.com/users/maropu/gists{/gist_id}","starred_url":"https://api.github.com/users/maropu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maropu/subscriptions","organizations_url":"https://api.github.com/users/maropu/orgs","repos_url":"https://api.github.com/users/maropu/repos","events_url":"https://api.github.com/users/maropu/events{/privacy}","received_events_url":"https://api.github.com/users/maropu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-04-25T04:26:46Z","updated_at":"2018-10-22T07:05:04Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/21148","html_url":"https://github.com/apache/spark/pull/21148","diff_url":"https://github.com/apache/spark/pull/21148.diff","patch_url":"https://github.com/apache/spark/pull/21148.patch"},"body":"## What changes were proposed in this pull request?\r\nThis pr added code to update the nullability of `Join.output` based on inferred predicates in `InferFiltersFromConstraints`. In the master, a logical `Join` node does not respect the nullability that the optimizer rule `InferFiltersFromConstraints` might change when inferred predicates have `IsNotNull`,\r\ne.g.,\r\n\r\n```\r\nscala> val df1 = Seq((Some(1), Some(2))).toDF(\"k\", \"v0\")\r\nscala> val df2 = Seq((Some(1), Some(3))).toDF(\"k\", \"v1\")\r\nscala> val joinedDf = df1.join(df2, df1(\"k\") === df2(\"k\"), \"inner\")\r\nscala> joinedDf.explain\r\n== Physical Plan ==\r\n*(2) BroadcastHashJoin [k#83], [k#92], Inner, BuildRight\r\n:- *(2) Project [_1#80 AS k#83, _2#81 AS v0#84]\r\n:  +- *(2) Filter isnotnull(_1#80)\r\n:     +- LocalTableScan [_1#80, _2#81]\r\n+- BroadcastExchange HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)))\r\n   +- *(1) Project [_1#89 AS k#92, _2#90 AS v1#93]\r\n      +- *(1) Filter isnotnull(_1#89)\r\n         +- LocalTableScan [_1#89, _2#90]\r\n\r\nscala> joinedDf.queryExecution.optimizedPlan.output.map(_.nullable)\r\nres15: Seq[Boolean] = List(true, true, true, true)\r\n```\r\n\r\nBut, these `nullable` values should be:\r\n\r\n```\r\nscala> joinedDf.queryExecution.optimizedPlan.output.map(_.nullable)\r\nres15: Seq[Boolean] = List(false, true, false, true)\r\n```\r\n\r\nThis ticket comes from the previous discussion: https://github.com/apache/spark/pull/18576#pullrequestreview-107585997\r\n\r\n## How was this patch tested?\r\nAdded tests in `UpdateNullabilityInAttributeReferencesSuite`.\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/431755787","html_url":"https://github.com/apache/spark/pull/21148#issuecomment-431755787","issue_url":"https://api.github.com/repos/apache/spark/issues/21148","id":431755787,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTc1NTc4Nw==","user":{"login":"SparkQA","id":8108735,"node_id":"MDQ6VXNlcjgxMDg3MzU=","avatar_url":"https://avatars1.githubusercontent.com/u/8108735?v=4","gravatar_id":"","url":"https://api.github.com/users/SparkQA","html_url":"https://github.com/SparkQA","followers_url":"https://api.github.com/users/SparkQA/followers","following_url":"https://api.github.com/users/SparkQA/following{/other_user}","gists_url":"https://api.github.com/users/SparkQA/gists{/gist_id}","starred_url":"https://api.github.com/users/SparkQA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SparkQA/subscriptions","organizations_url":"https://api.github.com/users/SparkQA/orgs","repos_url":"https://api.github.com/users/SparkQA/repos","events_url":"https://api.github.com/users/SparkQA/events{/privacy}","received_events_url":"https://api.github.com/users/SparkQA/received_events","type":"User","site_admin":false},"created_at":"2018-10-22T07:05:03Z","updated_at":"2018-10-22T07:05:03Z","author_association":"NONE","body":"**[Test build #97705 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/97705/testReport)** for PR 21148 at commit [`240ae7a`](https://github.com/apache/spark/commit/240ae7a976f03ce58bcdeed34f8022ebfea23a4c).\n * This patch **fails due to an unknown error code, -9**.\n * This patch **does not merge cleanly**.\n * This patch adds no public classes."}}
{"actor":{"display_login":"SparkQA"}}