{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/7854","labels_url":"https://api.github.com/repos/apache/spark/issues/7854/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/7854/comments","events_url":"https://api.github.com/repos/apache/spark/issues/7854/events","html_url":"https://github.com/apache/spark/pull/7854","id":98544420,"number":7854,"title":"[SPARK-9525] [PySpark] [MLlib] Optimize SparseVector initialization","user":{"login":"MechCoder","id":1867024,"avatar_url":"https://avatars.githubusercontent.com/u/1867024?v=3","gravatar_id":"","url":"https://api.github.com/users/MechCoder","html_url":"https://github.com/MechCoder","followers_url":"https://api.github.com/users/MechCoder/followers","following_url":"https://api.github.com/users/MechCoder/following{/other_user}","gists_url":"https://api.github.com/users/MechCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/MechCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MechCoder/subscriptions","organizations_url":"https://api.github.com/users/MechCoder/orgs","repos_url":"https://api.github.com/users/MechCoder/repos","events_url":"https://api.github.com/users/MechCoder/events{/privacy}","received_events_url":"https://api.github.com/users/MechCoder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-01T15:28:45Z","updated_at":"2015-08-25T02:10:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/7854","html_url":"https://github.com/apache/spark/pull/7854","diff_url":"https://github.com/apache/spark/pull/7854.diff","patch_url":"https://github.com/apache/spark/pull/7854.patch"},"body":"1. Remove sorting of indices and assume that the user gives a sorted tuple of indices, values etc\r\n\r\n2. Avoid iterating twice to get the indices and values if the argument provided is a dict.\r\n\r\n3. Add checks such that the length of the indices should be less than the size provided.\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/134449433","html_url":"https://github.com/apache/spark/pull/7854#issuecomment-134449433","issue_url":"https://api.github.com/repos/apache/spark/issues/7854","id":134449433,"user":{"login":"feynmanliang","id":990069,"avatar_url":"https://avatars.githubusercontent.com/u/990069?v=3","gravatar_id":"","url":"https://api.github.com/users/feynmanliang","html_url":"https://github.com/feynmanliang","followers_url":"https://api.github.com/users/feynmanliang/followers","following_url":"https://api.github.com/users/feynmanliang/following{/other_user}","gists_url":"https://api.github.com/users/feynmanliang/gists{/gist_id}","starred_url":"https://api.github.com/users/feynmanliang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feynmanliang/subscriptions","organizations_url":"https://api.github.com/users/feynmanliang/orgs","repos_url":"https://api.github.com/users/feynmanliang/repos","events_url":"https://api.github.com/users/feynmanliang/events{/privacy}","received_events_url":"https://api.github.com/users/feynmanliang/received_events","type":"User","site_admin":false},"created_at":"2015-08-25T02:10:21Z","updated_at":"2015-08-25T02:10:21Z","body":"It looks like the Python constructors enforce sorted indices (consistent with Scala) only with numeric (and not String) args. This should be made consistent, but it's not clear whether we should guarantee ordering at the cost of sorting overhead or relax this constraint at the risk of breaking code elsewhere.\r\n\r\nWe should clarify and clearly document if there is any guarantee on the ordering of indices, since features like #7794 depend on this ordering.\r\n\r\nCC @mengxr @jkbradley "}}