Skip to content

Commit

Permalink
[SPARK-46624][BUILD] Upgrade joda-time to 2.12.6
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?
This pr aims to upgrade  joda-time  from 2.12.5 to 2.12.6

### Why are the changes needed?
The new version brings the following fixes:
- JodaOrg/joda-time#733
- JodaOrg/joda-time#755
- JodaOrg/joda-time#731

The full release notes as follows:
- https://github.com/JodaOrg/joda-time/releases/tag/v2.12.6

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
Pass GitHub Actions

### Was this patch authored or co-authored using generative AI tooling?
No

Closes #44626 from LuciferYang/SPARK-46624.

Authored-by: yangjie01 <yangjie01@baidu.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
  • Loading branch information
a0x8o committed Jan 8, 2024
1 parent 886a29e commit 00bd1a5
Show file tree
Hide file tree
Showing 597 changed files with 21,688 additions and 13,840 deletions.
14 changes: 14 additions & 0 deletions R/pkg/R/functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,20 @@ setMethod("dayofyear",
column(jc)
})

#' @details
#' \code{monthname}: Extracts the three-letter abbreviated month name from a
#' given date/timestamp/string.
#'
#' @rdname column_datetime_functions
#' @aliases monthname monthname,Column-method
#' @note monthname since 4.0.0
setMethod("monthname",
signature(x = "Column"),
function(x) {
jc <- callJStatic("org.apache.spark.sql.functions", "monthname", x@jc)
column(jc)
})

#' @details
#' \code{decode}: Computes the first argument into a string from a binary using the provided
#' character set.
Expand Down
4 changes: 4 additions & 0 deletions R/pkg/R/generics.R
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,10 @@ setGeneric("dayofweek", function(x) { standardGeneric("dayofweek") })
#' @name NULL
setGeneric("dayofyear", function(x) { standardGeneric("dayofyear") })

#' @rdname column_datetime_functions
#' @name NULL
setGeneric("monthname", function(x) { standardGeneric("monthname") })

#' @rdname column_string_functions
#' @name NULL
setGeneric("decode", function(x, charset) { standardGeneric("decode") })
Expand Down
3 changes: 2 additions & 1 deletion R/pkg/tests/fulltests/test_sparkSQL.R
Original file line number Diff line number Diff line change
Expand Up @@ -1414,7 +1414,7 @@ test_that("test HiveContext", {

# Invalid mode
expect_error(saveAsTable(df, "parquetest", "parquet", mode = "abc", path = parquetDataPath),
"illegal argument - Unknown save mode: abc")
"Error in mode : analysis error - \\[INVALID_SAVE_MODE\\].*")
unsetHiveContext()
}
})
Expand Down Expand Up @@ -2062,6 +2062,7 @@ test_that("date functions on a DataFrame", {
expect_equal(collect(select(df, weekofyear(df$b)))[, 1], c(50, 50, 51))
expect_equal(collect(select(df, year(df$b)))[, 1], c(2012, 2013, 2014))
expect_equal(collect(select(df, month(df$b)))[, 1], c(12, 12, 12))
expect_equal(collect(select(df, monthname(df$b)))[, 1], c("Dec", "Dec", "Dec"))
expect_equal(collect(select(df, last_day(df$b)))[, 1],
c(as.Date("2012-12-31"), as.Date("2013-12-31"), as.Date("2014-12-31")))
expect_equal(collect(select(df, next_day(df$b, "MONDAY")))[, 1],
Expand Down

0 comments on commit 00bd1a5

Please sign in to comment.