Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

* SQL Server: `if`/`ifelse()`, and `if_else()` now use `CASE WHEN` instead of `IIF`. This ensures the handling of `NULL`s matches the R's `NA` handling rules (#1569).
* `if_else()` uses simpler translation for `missing` (#1573).
* New translations for stringr function `str_ilike()` for Postgres, Redshift, and Snowflake (@edward-burn, #1628).
* New translations for stringr function `str_ilike()` for Postgres, Redshift, Snowflake, and Spark (@edward-burn, #1628).
* Argument `ignore_case` for `str_like()` has been deprecated (@edward-burn, #1630).
* Corrected error message for `quantile()` and `median()` in `mutate()` on Redshift (@edward-burn, #1571).
* All set operations now error if you pass extra arguments (instead of silently ignoring then) (#1585).
Expand Down
12 changes: 12 additions & 0 deletions R/backend-spark-sql.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ simulate_spark_sql <- function() simulate_dbi("Spark SQL")
sql_variant(
sql_translator(
.parent = base_odbc_scalar,
# stringr ---------------------------------------------------------------
str_like = function(string, pattern, ignore_case = deprecated()) {
ignore_case <- deprecate_ignore_case(ignore_case)
if (ignore_case) {
sql_expr(!!string %ILIKE% !!pattern)
} else {
sql_expr(!!string %LIKE% !!pattern)
}
},
str_ilike = function(string, pattern) {
sql_expr(!!string %ILIKE% !!pattern)
},
# clock ---------------------------------------------------------------
add_days = function(x, n, ...) {
check_dots_empty()
Expand Down
Loading