-
Notifications
You must be signed in to change notification settings - Fork 29k
removed lambda from sortByKey() #10640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
According to the documentation the sortByKey method does not take a lambda as an argument, thus the example is flawed. Removed the argument completely as this will default to ascending sort.
|
@udoklein can you survey all examples and put any changes you find into one PR? |
|
Good point. The documentation did not mention the keyfunc. However it is somewhat pointless to add the default as an argument. In particular if the default is lambda x: x. Conclusion: the documentation should be fixed instead. (http://spark.apache.org/docs/latest/programming-guide.html) Where would I find the sources for the programming guide? |
|
Look for |
|
@udoklein if you want to update the docs that's fine too -- let me know if you intend to, or want o merge as is |
|
Well, in order to fix the documentation I would need to understand how to properly document it such that it is also valid for other languages (Java / Scala). Since I am a beginner I do not. I double checked that the example was definitely bogus. If the function is replaced by lambda x: -x it does not change the sort order. I suggest to just merge as is. |
|
It's not an issue in other languages since the other APIs don't take a function in |
|
As I said, changing the sign does NOT change the sort order. The example is bogus. The lambda would have to be either the third argument or it has to be passed as a named argument. The way it is passed passes it into the first argument. |
|
Ah, that's the point. Yes, needs a fix for sure. |
|
Test build #2359 has finished for PR 10640 at commit
|
According to the documentation the sortByKey method does not take a lambda as an argument, thus the example is flawed. Removed the argument completely as this will default to ascending sort. Author: Udo Klein <[email protected]> Closes #10640 from udoklein/patch-1. (cherry picked from commit bd723bd) Signed-off-by: Sean Owen <[email protected]>
|
Merged to master/1.6/1.5 |
According to the documentation the sortByKey method does not take a lambda as an argument, thus the example is flawed. Removed the argument completely as this will default to ascending sort. Author: Udo Klein <[email protected]> Closes #10640 from udoklein/patch-1. (cherry picked from commit bd723bd) Signed-off-by: Sean Owen <[email protected]>
According to the documentation the sortByKey method does not take a lambda as an argument, thus the example is flawed. Removed the argument completely as this will default to ascending sort.