Skip to content
Snippets Groups Projects
  • Yu ISHIKAWA's avatar
    f4bc01f1
    [SPARK-9855] [SPARKR] Add expression functions into SparkR whose params are simple · f4bc01f1
    Yu ISHIKAWA authored
    I added lots of expression functions for SparkR. This PR includes only functions whose params  are only `(Column)` or `(Column, Column)`.  And I think we need to improve how to test those functions. However, it would be better to work on another issue.
    
    ## Diff Summary
    
    - Add lots of functions in `functions.R` and their generic in `generic.R`
    - Add aliases for `ceiling` and `sign`
    - Move expression functions from `column.R` to `functions.R`
    - Modify `rdname` from `column` to `functions`
    
    I haven't supported `not` function, because the name has a collesion with `testthat` package. I didn't think of the way  to define it.
    
    ## New Supported Functions
    
    ```
    approxCountDistinct
    ascii
    base64
    bin
    bitwiseNOT
    ceil (alias: ceiling)
    crc32
    dayofmonth
    dayofyear
    explode
    factorial
    hex
    hour
    initcap
    isNaN
    last_day
    length
    log2
    ltrim
    md5
    minute
    month
    negate
    quarter
    reverse
    round
    rtrim
    second
    sha1
    signum (alias: sign)
    size
    soundex
    to_date
    trim
    unbase64
    unhex
    weekofyear
    year
    
    datediff
    levenshtein
    months_between
    nanvl
    pmod
    ```
    
    ## JIRA
    [[SPARK-9855] Add expression functions into SparkR whose params are simple - ASF JIRA](https://issues.apache.org/jira/browse/SPARK-9855)
    
    Author: Yu ISHIKAWA <yuu.ishikawa@gmail.com>
    
    Closes #8123 from yu-iskw/SPARK-9855.
    f4bc01f1
    History
    [SPARK-9855] [SPARKR] Add expression functions into SparkR whose params are simple
    Yu ISHIKAWA authored
    I added lots of expression functions for SparkR. This PR includes only functions whose params  are only `(Column)` or `(Column, Column)`.  And I think we need to improve how to test those functions. However, it would be better to work on another issue.
    
    ## Diff Summary
    
    - Add lots of functions in `functions.R` and their generic in `generic.R`
    - Add aliases for `ceiling` and `sign`
    - Move expression functions from `column.R` to `functions.R`
    - Modify `rdname` from `column` to `functions`
    
    I haven't supported `not` function, because the name has a collesion with `testthat` package. I didn't think of the way  to define it.
    
    ## New Supported Functions
    
    ```
    approxCountDistinct
    ascii
    base64
    bin
    bitwiseNOT
    ceil (alias: ceiling)
    crc32
    dayofmonth
    dayofyear
    explode
    factorial
    hex
    hour
    initcap
    isNaN
    last_day
    length
    log2
    ltrim
    md5
    minute
    month
    negate
    quarter
    reverse
    round
    rtrim
    second
    sha1
    signum (alias: sign)
    size
    soundex
    to_date
    trim
    unbase64
    unhex
    weekofyear
    year
    
    datediff
    levenshtein
    months_between
    nanvl
    pmod
    ```
    
    ## JIRA
    [[SPARK-9855] Add expression functions into SparkR whose params are simple - ASF JIRA](https://issues.apache.org/jira/browse/SPARK-9855)
    
    Author: Yu ISHIKAWA <yuu.ishikawa@gmail.com>
    
    Closes #8123 from yu-iskw/SPARK-9855.