{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/90157966","pull_request_review_id":10681183,"id":90157966,"diff_hunk":"@@ -714,6 +714,17 @@ object TypeCoercion {\n         // try to find the first one we can implicitly cast.\n         case (_, TypeCollection(types)) => types.flatMap(implicitCast(e, _)).headOption.orNull\n \n+        case (ArrayType(_, nullable), ArrayType(internalType: DataType, expectedNullable))\n+          if (expectedNullable || nullable == expectedNullable) =>","path":"sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala","position":5,"original_position":5,"commit_id":"374b4f82bb59ef4ea3279c22dd6e9cd22f710ec9","original_commit_id":"374b4f82bb59ef4ea3279c22dd6e9cd22f710ec9","user":{"login":"viirya","id":68855,"avatar_url":"https://avatars.githubusercontent.com/u/68855?v=3","gravatar_id":"","url":"https://api.github.com/users/viirya","html_url":"https://github.com/viirya","followers_url":"https://api.github.com/users/viirya/followers","following_url":"https://api.github.com/users/viirya/following{/other_user}","gists_url":"https://api.github.com/users/viirya/gists{/gist_id}","starred_url":"https://api.github.com/users/viirya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viirya/subscriptions","organizations_url":"https://api.github.com/users/viirya/orgs","repos_url":"https://api.github.com/users/viirya/repos","events_url":"https://api.github.com/users/viirya/events{/privacy}","received_events_url":"https://api.github.com/users/viirya/received_events","type":"User","site_admin":false},"body":"We should also consider the case forcing the casting result is null. Please see https://github.com/apache/spark/blob/7eb2ca8e338e04034a662920261e028f56b07395/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala#L94\r\n","created_at":"2016-11-30T02:19:28Z","updated_at":"2016-11-30T02:19:28Z","html_url":"https://github.com/apache/spark/pull/16057#discussion_r90157966","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/16057","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/90157966"},"html":{"href":"https://github.com/apache/spark/pull/16057#discussion_r90157966"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/16057"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/16057","id":95662969,"html_url":"https://github.com/apache/spark/pull/16057","diff_url":"https://github.com/apache/spark/pull/16057.diff","patch_url":"https://github.com/apache/spark/pull/16057.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/16057","number":16057,"state":"open","locked":false,"title":"[SPARK-18624][SQL] Implicit cast complex types","user":{"login":"jiangxb1987","id":4784782,"avatar_url":"https://avatars.githubusercontent.com/u/4784782?v=3","gravatar_id":"","url":"https://api.github.com/users/jiangxb1987","html_url":"https://github.com/jiangxb1987","followers_url":"https://api.github.com/users/jiangxb1987/followers","following_url":"https://api.github.com/users/jiangxb1987/following{/other_user}","gists_url":"https://api.github.com/users/jiangxb1987/gists{/gist_id}","starred_url":"https://api.github.com/users/jiangxb1987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiangxb1987/subscriptions","organizations_url":"https://api.github.com/users/jiangxb1987/orgs","repos_url":"https://api.github.com/users/jiangxb1987/repos","events_url":"https://api.github.com/users/jiangxb1987/events{/privacy}","received_events_url":"https://api.github.com/users/jiangxb1987/received_events","type":"User","site_admin":false},"body":"## What changes were proposed in this pull request?\r\n\r\nCurrently `ImplicitTypeCasts` doesn't handle casts between `ArrayType`s, this is not convenient, we should add a rule to enable casting from `ArrayType(InternalType)` to `ArrayType(newInternalType)`.\r\n\r\nGoals:\r\n1. Add a rule to `ImplicitTypeCasts` to enable casting between `ArrayType`s;\r\n2. Simplify `Percentile` and `ApproximatePercentile`.\r\n\r\n## How was this patch tested?\r\n\r\nUpdated test cases in `TypeCoercionSuite`.","created_at":"2016-11-29T10:21:04Z","updated_at":"2016-11-30T02:19:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a3d38c8f05250988be633fcb61c13d15cb382f2b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/16057/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/16057/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/16057/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/374b4f82bb59ef4ea3279c22dd6e9cd22f710ec9","head":{"label":"jiangxb1987:implicit-cast-complex-types","ref":"implicit-cast-complex-types","sha":"374b4f82bb59ef4ea3279c22dd6e9cd22f710ec9","user":{"login":"jiangxb1987","id":4784782,"avatar_url":"https://avatars.githubusercontent.com/u/4784782?v=3","gravatar_id":"","url":"https://api.github.com/users/jiangxb1987","html_url":"https://github.com/jiangxb1987","followers_url":"https://api.github.com/users/jiangxb1987/followers","following_url":"https://api.github.com/users/jiangxb1987/following{/other_user}","gists_url":"https://api.github.com/users/jiangxb1987/gists{/gist_id}","starred_url":"https://api.github.com/users/jiangxb1987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiangxb1987/subscriptions","organizations_url":"https://api.github.com/users/jiangxb1987/orgs","repos_url":"https://api.github.com/users/jiangxb1987/repos","events_url":"https://api.github.com/users/jiangxb1987/events{/privacy}","received_events_url":"https://api.github.com/users/jiangxb1987/received_events","type":"User","site_admin":false},"repo":{"id":35214686,"name":"spark","full_name":"jiangxb1987/spark","owner":{"login":"jiangxb1987","id":4784782,"avatar_url":"https://avatars.githubusercontent.com/u/4784782?v=3","gravatar_id":"","url":"https://api.github.com/users/jiangxb1987","html_url":"https://github.com/jiangxb1987","followers_url":"https://api.github.com/users/jiangxb1987/followers","following_url":"https://api.github.com/users/jiangxb1987/following{/other_user}","gists_url":"https://api.github.com/users/jiangxb1987/gists{/gist_id}","starred_url":"https://api.github.com/users/jiangxb1987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiangxb1987/subscriptions","organizations_url":"https://api.github.com/users/jiangxb1987/orgs","repos_url":"https://api.github.com/users/jiangxb1987/repos","events_url":"https://api.github.com/users/jiangxb1987/events{/privacy}","received_events_url":"https://api.github.com/users/jiangxb1987/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jiangxb1987/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/jiangxb1987/spark","forks_url":"https://api.github.com/repos/jiangxb1987/spark/forks","keys_url":"https://api.github.com/repos/jiangxb1987/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jiangxb1987/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jiangxb1987/spark/teams","hooks_url":"https://api.github.com/repos/jiangxb1987/spark/hooks","issue_events_url":"https://api.github.com/repos/jiangxb1987/spark/issues/events{/number}","events_url":"https://api.github.com/repos/jiangxb1987/spark/events","assignees_url":"https://api.github.com/repos/jiangxb1987/spark/assignees{/user}","branches_url":"https://api.github.com/repos/jiangxb1987/spark/branches{/branch}","tags_url":"https://api.github.com/repos/jiangxb1987/spark/tags","blobs_url":"https://api.github.com/repos/jiangxb1987/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jiangxb1987/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jiangxb1987/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/jiangxb1987/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jiangxb1987/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/jiangxb1987/spark/languages","stargazers_url":"https://api.github.com/repos/jiangxb1987/spark/stargazers","contributors_url":"https://api.github.com/repos/jiangxb1987/spark/contributors","subscribers_url":"https://api.github.com/repos/jiangxb1987/spark/subscribers","subscription_url":"https://api.github.com/repos/jiangxb1987/spark/subscription","commits_url":"https://api.github.com/repos/jiangxb1987/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/jiangxb1987/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/jiangxb1987/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/jiangxb1987/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/jiangxb1987/spark/contents/{+path}","compare_url":"https://api.github.com/repos/jiangxb1987/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jiangxb1987/spark/merges","archive_url":"https://api.github.com/repos/jiangxb1987/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jiangxb1987/spark/downloads","issues_url":"https://api.github.com/repos/jiangxb1987/spark/issues{/number}","pulls_url":"https://api.github.com/repos/jiangxb1987/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/jiangxb1987/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/jiangxb1987/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jiangxb1987/spark/labels{/name}","releases_url":"https://api.github.com/repos/jiangxb1987/spark/releases{/id}","deployments_url":"https://api.github.com/repos/jiangxb1987/spark/deployments","created_at":"2015-05-07T10:48:35Z","updated_at":"2016-04-06T08:58:13Z","pushed_at":"2016-11-29T10:11:44Z","git_url":"git://github.com/jiangxb1987/spark.git","ssh_url":"git@github.com:jiangxb1987/spark.git","clone_url":"https://github.com/jiangxb1987/spark.git","svn_url":"https://github.com/jiangxb1987/spark","homepage":null,"size":243078,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"f830bb9170f6b853565d9dd30ca7418b93a54fe3","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":17165658,"name":"spark","full_name":"apache/spark","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/spark","description":"Mirror of Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","deployments_url":"https://api.github.com/repos/apache/spark/deployments","created_at":"2014-02-25T08:00:08Z","updated_at":"2016-11-30T02:17:08Z","pushed_at":"2016-11-30T02:17:19Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":null,"size":616738,"stargazers_count":10901,"watchers_count":10901,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10180,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":452,"forks":10180,"open_issues":452,"watchers":10901,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/16057"},"html":{"href":"https://github.com/apache/spark/pull/16057"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/16057"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/16057/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/16057/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/16057/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/374b4f82bb59ef4ea3279c22dd6e9cd22f710ec9"}}}}
{"actor":{"display_login":"viirya"}}