{"action":"created","comment":{"url":"https://api.github.com/repos/apache/carbondata/pulls/comments/186059780","pull_request_review_id":117576489,"id":186059780,"diff_hunk":"@@ -604,31 +604,58 @@ abstract class CarbonDDLSqlParser extends AbstractCarbonSparkSQLParser {\n         tableProperties.get(CarbonCommonConstants.DICTIONARY_EXCLUDE).get.split(',').map(_.trim)\n       dictExcludeCols\n         .foreach { dictExcludeCol =>\n-          if (!fields.exists(x => x.column.equalsIgnoreCase(dictExcludeCol))) {\n+          if (!checkFields(fields, dictExcludeCol)) {\n             val errormsg = \"DICTIONARY_EXCLUDE column: \" + dictExcludeCol +\n                            \" does not exist in table. Please check create table statement.\"\n             throw new MalformedCarbonCommandException(errormsg)\n           } else {\n-            val dataType = fields.find(x =>\n-              x.column.equalsIgnoreCase(dictExcludeCol)).get.dataType.get\n-            if (isComplexDimDictionaryExclude(dataType)) {\n-              val errormsg = \"DICTIONARY_EXCLUDE is unsupported for complex datatype column: \" +\n-                             dictExcludeCol\n-              throw new MalformedCarbonCommandException(errormsg)\n-            } else if (!isDataTypeSupportedForDictionary_Exclude(dataType)) {\n+            val dataType = findField(fields, dictExcludeCol).get.dataType.get\n+            if (!isDataTypeSupportedForDictionary_Exclude(dataType)) {\n               val errorMsg = \"DICTIONARY_EXCLUDE is unsupported for \" + dataType.toLowerCase() +\n                              \" data type column: \" + dictExcludeCol\n               throw new MalformedCarbonCommandException(errorMsg)\n             }\n           }\n         }\n     }\n+\n+\n+    def checkFields(y: Seq[Field], colToMatch: String): Boolean = {\n+      y.exists { fld =>\n+        if (fld.column.equalsIgnoreCase(colToMatch)) {\n+          true\n+        } else if (fld.children.isDefined && fld.children.get != null) {\n+          checkFields(fld.children.get, colToMatch)\n+        } else {\n+          false\n+        }\n+      }\n+    }\n+\n+    def findField(y: Seq[Field], colToMatch: String): Option[Field] = {","path":"integration/spark-common/src/main/scala/org/apache/spark/sql/catalyst/CarbonDDLSqlParser.scala","position":40,"original_position":40,"commit_id":"46fc3fe752f46914dc576f312cafa6622e6b715e","original_commit_id":"46fc3fe752f46914dc576f312cafa6622e6b715e","user":{"login":"sounakr","id":14341802,"avatar_url":"https://avatars3.githubusercontent.com/u/14341802?v=4","gravatar_id":"","url":"https://api.github.com/users/sounakr","html_url":"https://github.com/sounakr","followers_url":"https://api.github.com/users/sounakr/followers","following_url":"https://api.github.com/users/sounakr/following{/other_user}","gists_url":"https://api.github.com/users/sounakr/gists{/gist_id}","starred_url":"https://api.github.com/users/sounakr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sounakr/subscriptions","organizations_url":"https://api.github.com/users/sounakr/orgs","repos_url":"https://api.github.com/users/sounakr/repos","events_url":"https://api.github.com/users/sounakr/events{/privacy}","received_events_url":"https://api.github.com/users/sounakr/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2018-05-04T11:53:16Z","updated_at":"2018-05-04T11:53:16Z","html_url":"https://github.com/apache/carbondata/pull/2261#discussion_r186059780","pull_request_url":"https://api.github.com/repos/apache/carbondata/pulls/2261","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/carbondata/pulls/comments/186059780"},"html":{"href":"https://github.com/apache/carbondata/pull/2261#discussion_r186059780"},"pull_request":{"href":"https://api.github.com/repos/apache/carbondata/pulls/2261"}},"in_reply_to_id":186056119},"pull_request":{"url":"https://api.github.com/repos/apache/carbondata/pulls/2261","id":185611995,"html_url":"https://github.com/apache/carbondata/pull/2261","diff_url":"https://github.com/apache/carbondata/pull/2261.diff","patch_url":"https://github.com/apache/carbondata/pull/2261.patch","issue_url":"https://api.github.com/repos/apache/carbondata/issues/2261","number":2261,"state":"open","locked":false,"title":"[CARBONDATA-2430][SDK] Reshuffling of Columns given by user in SDK.","user":{"login":"sounakr","id":14341802,"avatar_url":"https://avatars3.githubusercontent.com/u/14341802?v=4","gravatar_id":"","url":"https://api.github.com/users/sounakr","html_url":"https://github.com/sounakr","followers_url":"https://api.github.com/users/sounakr/followers","following_url":"https://api.github.com/users/sounakr/following{/other_user}","gists_url":"https://api.github.com/users/sounakr/gists{/gist_id}","starred_url":"https://api.github.com/users/sounakr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sounakr/subscriptions","organizations_url":"https://api.github.com/users/sounakr/orgs","repos_url":"https://api.github.com/users/sounakr/repos","events_url":"https://api.github.com/users/sounakr/events{/privacy}","received_events_url":"https://api.github.com/users/sounakr/received_events","type":"User","site_admin":false},"body":"Reshuffling of Columns given by the user in SDK. Order should be Sort COlumns -> Dimension -> Complex --> Measure\r\n\r\n - [ ] Any interfaces changed?\r\n \r\n - [ ] Any backward compatibility impacted?\r\n \r\n - [ ] Document update required?\r\n\r\n - [ ] Testing done\r\n        Please provide details on \r\n        - Whether new unit test cases have been added or why no new tests are required?\r\n        - How it is tested? Please attach test report.\r\n        - Is it a performance related change? Please attach the performance test report.\r\n        - Any additional information to help reviewers in testing this change.\r\n       \r\n - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA. \r\n\r\n","created_at":"2018-05-03T03:54:19Z","updated_at":"2018-05-04T11:53:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9a952dd28e20bd895448a1e339ebc243a9b065e6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/carbondata/pulls/2261/commits","review_comments_url":"https://api.github.com/repos/apache/carbondata/pulls/2261/comments","review_comment_url":"https://api.github.com/repos/apache/carbondata/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/carbondata/issues/2261/comments","statuses_url":"https://api.github.com/repos/apache/carbondata/statuses/46fc3fe752f46914dc576f312cafa6622e6b715e","head":{"label":"sounakr:complex-type","ref":"complex-type","sha":"46fc3fe752f46914dc576f312cafa6622e6b715e","user":{"login":"sounakr","id":14341802,"avatar_url":"https://avatars3.githubusercontent.com/u/14341802?v=4","gravatar_id":"","url":"https://api.github.com/users/sounakr","html_url":"https://github.com/sounakr","followers_url":"https://api.github.com/users/sounakr/followers","following_url":"https://api.github.com/users/sounakr/following{/other_user}","gists_url":"https://api.github.com/users/sounakr/gists{/gist_id}","starred_url":"https://api.github.com/users/sounakr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sounakr/subscriptions","organizations_url":"https://api.github.com/users/sounakr/orgs","repos_url":"https://api.github.com/users/sounakr/repos","events_url":"https://api.github.com/users/sounakr/events{/privacy}","received_events_url":"https://api.github.com/users/sounakr/received_events","type":"User","site_admin":false},"repo":{"id":77815028,"name":"incubator-carbondata","full_name":"sounakr/incubator-carbondata","owner":{"login":"sounakr","id":14341802,"avatar_url":"https://avatars3.githubusercontent.com/u/14341802?v=4","gravatar_id":"","url":"https://api.github.com/users/sounakr","html_url":"https://github.com/sounakr","followers_url":"https://api.github.com/users/sounakr/followers","following_url":"https://api.github.com/users/sounakr/following{/other_user}","gists_url":"https://api.github.com/users/sounakr/gists{/gist_id}","starred_url":"https://api.github.com/users/sounakr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sounakr/subscriptions","organizations_url":"https://api.github.com/users/sounakr/orgs","repos_url":"https://api.github.com/users/sounakr/repos","events_url":"https://api.github.com/users/sounakr/events{/privacy}","received_events_url":"https://api.github.com/users/sounakr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sounakr/incubator-carbondata","description":"Mirror of Apache CarbonData (Incubating)","fork":true,"url":"https://api.github.com/repos/sounakr/incubator-carbondata","forks_url":"https://api.github.com/repos/sounakr/incubator-carbondata/forks","keys_url":"https://api.github.com/repos/sounakr/incubator-carbondata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sounakr/incubator-carbondata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sounakr/incubator-carbondata/teams","hooks_url":"https://api.github.com/repos/sounakr/incubator-carbondata/hooks","issue_events_url":"https://api.github.com/repos/sounakr/incubator-carbondata/issues/events{/number}","events_url":"https://api.github.com/repos/sounakr/incubator-carbondata/events","assignees_url":"https://api.github.com/repos/sounakr/incubator-carbondata/assignees{/user}","branches_url":"https://api.github.com/repos/sounakr/incubator-carbondata/branches{/branch}","tags_url":"https://api.github.com/repos/sounakr/incubator-carbondata/tags","blobs_url":"https://api.github.com/repos/sounakr/incubator-carbondata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sounakr/incubator-carbondata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sounakr/incubator-carbondata/git/refs{/sha}","trees_url":"https://api.github.com/repos/sounakr/incubator-carbondata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sounakr/incubator-carbondata/statuses/{sha}","languages_url":"https://api.github.com/repos/sounakr/incubator-carbondata/languages","stargazers_url":"https://api.github.com/repos/sounakr/incubator-carbondata/stargazers","contributors_url":"https://api.github.com/repos/sounakr/incubator-carbondata/contributors","subscribers_url":"https://api.github.com/repos/sounakr/incubator-carbondata/subscribers","subscription_url":"https://api.github.com/repos/sounakr/incubator-carbondata/subscription","commits_url":"https://api.github.com/repos/sounakr/incubator-carbondata/commits{/sha}","git_commits_url":"https://api.github.com/repos/sounakr/incubator-carbondata/git/commits{/sha}","comments_url":"https://api.github.com/repos/sounakr/incubator-carbondata/comments{/number}","issue_comment_url":"https://api.github.com/repos/sounakr/incubator-carbondata/issues/comments{/number}","contents_url":"https://api.github.com/repos/sounakr/incubator-carbondata/contents/{+path}","compare_url":"https://api.github.com/repos/sounakr/incubator-carbondata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sounakr/incubator-carbondata/merges","archive_url":"https://api.github.com/repos/sounakr/incubator-carbondata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sounakr/incubator-carbondata/downloads","issues_url":"https://api.github.com/repos/sounakr/incubator-carbondata/issues{/number}","pulls_url":"https://api.github.com/repos/sounakr/incubator-carbondata/pulls{/number}","milestones_url":"https://api.github.com/repos/sounakr/incubator-carbondata/milestones{/number}","notifications_url":"https://api.github.com/repos/sounakr/incubator-carbondata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sounakr/incubator-carbondata/labels{/name}","releases_url":"https://api.github.com/repos/sounakr/incubator-carbondata/releases{/id}","deployments_url":"https://api.github.com/repos/sounakr/incubator-carbondata/deployments","created_at":"2017-01-02T06:25:07Z","updated_at":"2017-01-02T06:25:13Z","pushed_at":"2018-05-04T08:01:03Z","git_url":"git://github.com/sounakr/incubator-carbondata.git","ssh_url":"git@github.com:sounakr/incubator-carbondata.git","clone_url":"https://github.com/sounakr/incubator-carbondata.git","svn_url":"https://github.com/sounakr/incubator-carbondata","homepage":null,"size":57550,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"d1139330f0225950b664b37447eb48ae5662ebb4","user":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","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":62117818,"name":"carbondata","full_name":"apache/carbondata","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","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/carbondata","description":"Mirror of Apache CarbonData","fork":false,"url":"https://api.github.com/repos/apache/carbondata","forks_url":"https://api.github.com/repos/apache/carbondata/forks","keys_url":"https://api.github.com/repos/apache/carbondata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/carbondata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/carbondata/teams","hooks_url":"https://api.github.com/repos/apache/carbondata/hooks","issue_events_url":"https://api.github.com/repos/apache/carbondata/issues/events{/number}","events_url":"https://api.github.com/repos/apache/carbondata/events","assignees_url":"https://api.github.com/repos/apache/carbondata/assignees{/user}","branches_url":"https://api.github.com/repos/apache/carbondata/branches{/branch}","tags_url":"https://api.github.com/repos/apache/carbondata/tags","blobs_url":"https://api.github.com/repos/apache/carbondata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/carbondata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/carbondata/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/carbondata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/carbondata/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/carbondata/languages","stargazers_url":"https://api.github.com/repos/apache/carbondata/stargazers","contributors_url":"https://api.github.com/repos/apache/carbondata/contributors","subscribers_url":"https://api.github.com/repos/apache/carbondata/subscribers","subscription_url":"https://api.github.com/repos/apache/carbondata/subscription","commits_url":"https://api.github.com/repos/apache/carbondata/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/carbondata/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/carbondata/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/carbondata/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/carbondata/contents/{+path}","compare_url":"https://api.github.com/repos/apache/carbondata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/carbondata/merges","archive_url":"https://api.github.com/repos/apache/carbondata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/carbondata/downloads","issues_url":"https://api.github.com/repos/apache/carbondata/issues{/number}","pulls_url":"https://api.github.com/repos/apache/carbondata/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/carbondata/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/carbondata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/carbondata/labels{/name}","releases_url":"https://api.github.com/repos/apache/carbondata/releases{/id}","deployments_url":"https://api.github.com/repos/apache/carbondata/deployments","created_at":"2016-06-28T07:00:06Z","updated_at":"2018-05-04T04:24:19Z","pushed_at":"2018-05-04T11:45:17Z","git_url":"git://github.com/apache/carbondata.git","ssh_url":"git@github.com:apache/carbondata.git","clone_url":"https://github.com/apache/carbondata.git","svn_url":"https://github.com/apache/carbondata","homepage":"","size":57398,"stargazers_count":657,"watchers_count":657,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":410,"mirror_url":null,"archived":false,"open_issues_count":104,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":410,"open_issues":104,"watchers":657,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/carbondata/pulls/2261"},"html":{"href":"https://github.com/apache/carbondata/pull/2261"},"issue":{"href":"https://api.github.com/repos/apache/carbondata/issues/2261"},"comments":{"href":"https://api.github.com/repos/apache/carbondata/issues/2261/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/carbondata/pulls/2261/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/carbondata/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/carbondata/pulls/2261/commits"},"statuses":{"href":"https://api.github.com/repos/apache/carbondata/statuses/46fc3fe752f46914dc576f312cafa6622e6b715e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"sounakr"}}