Skip to content
Snippets Groups Projects
  • Narine Kokhlikyan's avatar
    e8f90d9d
    [SPARK-10836] [SPARKR] Added sort(x, decreasing, col, ... ) method to DataFrame · e8f90d9d
    Narine Kokhlikyan authored
    the sort function can be used as an alternative to arrange(... ).
    As arguments it accepts x - dataframe, decreasing - TRUE/FALSE, a list of orderings for columns and the list of columns, represented as string names
    
    for example:
    sort(df, TRUE, "col1","col2","col3","col5") # for example, if we want to sort some of the columns in the same order
    
    sort(df, decreasing=TRUE, "col1")
    sort(df, decreasing=c(TRUE,FALSE), "col1","col2")
    
    Author: Narine Kokhlikyan <narine.kokhlikyan@gmail.com>
    
    Closes #8920 from NarineK/sparkrsort.
    e8f90d9d
    History
    [SPARK-10836] [SPARKR] Added sort(x, decreasing, col, ... ) method to DataFrame
    Narine Kokhlikyan authored
    the sort function can be used as an alternative to arrange(... ).
    As arguments it accepts x - dataframe, decreasing - TRUE/FALSE, a list of orderings for columns and the list of columns, represented as string names
    
    for example:
    sort(df, TRUE, "col1","col2","col3","col5") # for example, if we want to sort some of the columns in the same order
    
    sort(df, decreasing=TRUE, "col1")
    sort(df, decreasing=c(TRUE,FALSE), "col1","col2")
    
    Author: Narine Kokhlikyan <narine.kokhlikyan@gmail.com>
    
    Closes #8920 from NarineK/sparkrsort.
test_sparkSQL.R 50.14 KiB