{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/7478","labels_url":"https://api.github.com/repos/apache/spark/issues/7478/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/7478/comments","events_url":"https://api.github.com/repos/apache/spark/issues/7478/events","html_url":"https://github.com/apache/spark/pull/7478","id":95735901,"number":7478,"title":"[SPARK-8003][SQL] Added virtual column support to Spark","user":{"login":"JDrit","id":2280727,"avatar_url":"https://avatars.githubusercontent.com/u/2280727?v=3","gravatar_id":"","url":"https://api.github.com/users/JDrit","html_url":"https://github.com/JDrit","followers_url":"https://api.github.com/users/JDrit/followers","following_url":"https://api.github.com/users/JDrit/following{/other_user}","gists_url":"https://api.github.com/users/JDrit/gists{/gist_id}","starred_url":"https://api.github.com/users/JDrit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JDrit/subscriptions","organizations_url":"https://api.github.com/users/JDrit/orgs","repos_url":"https://api.github.com/users/JDrit/repos","events_url":"https://api.github.com/users/JDrit/events{/privacy}","received_events_url":"https://api.github.com/users/JDrit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":74,"created_at":"2015-07-17T20:15:58Z","updated_at":"2015-07-28T19:27:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/7478","html_url":"https://github.com/apache/spark/pull/7478","diff_url":"https://github.com/apache/spark/pull/7478.diff","patch_url":"https://github.com/apache/spark/pull/7478.patch"},"body":"Added virtual column support by adding a new resolution role to the query analyzer. Additional virtual columns can be added by adding case expressions to [the new rule](https://github.com/JDrit/spark/blob/virt_columns/sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala#L1026) and my modifying the [logical plan](https://github.com/JDrit/spark/blob/virt_columns/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala#L216) to resolve them.\r\n\r\nThis also solves [SPARK-8003](https://issues.apache.org/jira/browse/SPARK-8003)\r\n\r\nThis allows you to perform queries such as:\r\n```sql\r\nselect spark__partition__id, count(*) as c from table group by spark__partition__id;\r\n```"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/125728490","html_url":"https://github.com/apache/spark/pull/7478#issuecomment-125728490","issue_url":"https://api.github.com/repos/apache/spark/issues/7478","id":125728490,"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":"2015-07-28T19:27:18Z","updated_at":"2015-07-28T19:27:18Z","body":"  [Test build #38752 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/38752/consoleFull) for   PR 7478 at commit [`7932bf0`](https://github.com/apache/spark/commit/7932bf090671dc99e9f38c0eeb52e73c150303ca)."}}