{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/14629","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/14629/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/14629/comments","events_url":"https://api.github.com/repos/apache/spark/issues/14629/events","html_url":"https://github.com/apache/spark/pull/14629","id":171000842,"number":14629,"title":"[WIP][SPARK-17046][SQL] prevent user using dataframe.select with empty param list","user":{"login":"WeichenXu123","id":19235986,"avatar_url":"https://avatars.githubusercontent.com/u/19235986?v=3","gravatar_id":"","url":"https://api.github.com/users/WeichenXu123","html_url":"https://github.com/WeichenXu123","followers_url":"https://api.github.com/users/WeichenXu123/followers","following_url":"https://api.github.com/users/WeichenXu123/following{/other_user}","gists_url":"https://api.github.com/users/WeichenXu123/gists{/gist_id}","starred_url":"https://api.github.com/users/WeichenXu123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeichenXu123/subscriptions","organizations_url":"https://api.github.com/users/WeichenXu123/orgs","repos_url":"https://api.github.com/users/WeichenXu123/repos","events_url":"https://api.github.com/users/WeichenXu123/events{/privacy}","received_events_url":"https://api.github.com/users/WeichenXu123/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-08-13T09:13:39Z","updated_at":"2016-08-13T20:13:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/14629","html_url":"https://github.com/apache/spark/pull/14629","diff_url":"https://github.com/apache/spark/pull/14629.diff","patch_url":"https://github.com/apache/spark/pull/14629.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nWe can see the DataFrame API:\r\n`def select(col: String, cols: String*)`\r\nsuch definition can prevent user to call `select` in such way: `df.select( )`\r\n\r\nbut, currently we can still use `df.select( )` and pass compiling, \r\nbecause it match the API\r\n`def select(cols: Column*)`\r\n\r\nso, my modification is, add an API such as:\r\n`def select(col: Column, cols: Column*)`\r\nand change `def select(cols: Column*)` into `private[spark] def select(cols: Column*)`\r\nso that the public `select` API can only be called with non-empty param list.\r\n\r\n## How was this patch tested?\r\n\r\nExisting test.\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/239639311","html_url":"https://github.com/apache/spark/pull/14629#issuecomment-239639311","issue_url":"https://api.github.com/repos/apache/spark/issues/14629","id":239639311,"user":{"login":"srowen","id":822522,"avatar_url":"https://avatars.githubusercontent.com/u/822522?v=3","gravatar_id":"","url":"https://api.github.com/users/srowen","html_url":"https://github.com/srowen","followers_url":"https://api.github.com/users/srowen/followers","following_url":"https://api.github.com/users/srowen/following{/other_user}","gists_url":"https://api.github.com/users/srowen/gists{/gist_id}","starred_url":"https://api.github.com/users/srowen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srowen/subscriptions","organizations_url":"https://api.github.com/users/srowen/orgs","repos_url":"https://api.github.com/users/srowen/repos","events_url":"https://api.github.com/users/srowen/events{/privacy}","received_events_url":"https://api.github.com/users/srowen/received_events","type":"User","site_admin":false},"created_at":"2016-08-13T20:13:01Z","updated_at":"2016-08-13T20:13:01Z","body":"Yes that's a good question. A 0-column DataFrame is valid, though that's a little different from being able to select 0 columns from a DataFrame. I don't have a database handy, but can you select no columns in any SQL syntax? Maybe best to emulate that?"}}
{"actor":{"display_login":"srowen"}}