Skip to content

Commit

Permalink
Merge branch 'apache:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
fusheng-rd authored Jan 6, 2024
2 parents 19a4c4b + e8dfcd3 commit 2f57fc6
Show file tree
Hide file tree
Showing 524 changed files with 17,959 additions and 13,734 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run-build:
strategy:
matrix:
pyversion: ["pypy3,python3.10", "python3.11,python3.12"]
pyversion: ["pypy3,python3.10", "python3.11", "python3.12"]
permissions:
packages: write
name: Run
Expand Down
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
Loading

0 comments on commit 2f57fc6

Please sign in to comment.