{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/13059","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/13059/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/13059/comments","events_url":"https://api.github.com/repos/apache/spark/issues/13059/events","html_url":"https://github.com/apache/spark/pull/13059","id":154343308,"number":13059,"title":"[SPARK-15275] [SQL] CatalogTable should store sort ordering for sorted columns","user":{"login":"tejasapatil","id":3230057,"avatar_url":"https://avatars.githubusercontent.com/u/3230057?v=3","gravatar_id":"","url":"https://api.github.com/users/tejasapatil","html_url":"https://github.com/tejasapatil","followers_url":"https://api.github.com/users/tejasapatil/followers","following_url":"https://api.github.com/users/tejasapatil/following{/other_user}","gists_url":"https://api.github.com/users/tejasapatil/gists{/gist_id}","starred_url":"https://api.github.com/users/tejasapatil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tejasapatil/subscriptions","organizations_url":"https://api.github.com/users/tejasapatil/orgs","repos_url":"https://api.github.com/users/tejasapatil/repos","events_url":"https://api.github.com/users/tejasapatil/events{/privacy}","received_events_url":"https://api.github.com/users/tejasapatil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-11T21:07:31Z","updated_at":"2016-05-11T21:12:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/13059","html_url":"https://github.com/apache/spark/pull/13059","diff_url":"https://github.com/apache/spark/pull/13059.diff","patch_url":"https://github.com/apache/spark/pull/13059.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nJira link : https://issues.apache.org/jira/browse/SPARK-15275\r\n\r\nFor bucketed tables in Hive, one can also add constraint about column sortedness along with ordering.\r\nAs per the spec in [0], CREATE TABLE statement can allow SORT ordering as well:\r\n\r\n  [CLUSTERED BY (col_name, col_name, ...) [SORTED BY (col_name [ASC|DESC], ...)] INTO num_buckets BUCKETS]\r\n\r\n[0] : https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-CreateTable\r\n\r\nCurrently CatalogTable does not store any information about the sort ordering and just has the names of the sorted columns. This PR adds `CatalogSortOrder` to hold the sorted column name and the sorted order. Currently this information is *not* used in query execution but can be used as more support for bucketing is added. Possible advantage is ability to skip rows while performing predicate matching.\r\n\r\n## How was this patch tested?\r\n\r\nCurrently trunk does support creating bucketed hive tables. I am relying on existing tests. "},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/218591848","html_url":"https://github.com/apache/spark/pull/13059#issuecomment-218591848","issue_url":"https://api.github.com/repos/apache/spark/issues/13059","id":218591848,"user":{"login":"SparkQA","id":8108735,"avatar_url":"https://avatars.githubusercontent.com/u/8108735?v=3","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":"2016-05-11T21:12:35Z","updated_at":"2016-05-11T21:12:35Z","body":"**[Test build #58408 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58408/consoleFull)** for PR 13059 at commit [`c2f81ca`](https://github.com/apache/spark/commit/c2f81ca5447b4e928c666a8aae1667d54dc35378)."}}