Skip to content

Commit

Permalink
Support non-temporary writes for databricks
Browse files Browse the repository at this point in the history
Fixes #1418
  • Loading branch information
hadley committed Jan 11, 2024
1 parent 781d630 commit 3563fa7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# dbplyr (development version)

* The databricks backend now supports creating non-temporary tables too (#1418).

* Namespaced dplyr calls now error if the function doesn't exist, or
a translation is not available (#1426).

Expand Down
10 changes: 5 additions & 5 deletions R/backend-spark-sql.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ simulate_spark_sql <- function() simulate_dbi("Spark SQL")
analyze = TRUE,
in_transaction = FALSE) {

if (!temporary) {
cli::cli_abort("Spark SQL only support temporary tables")
if (temporary) {
sql <- sql_values_subquery(con, values, types = types, lvl = 1)
db_compute(con, table, sql, overwrite = overwrite)
} else {
NextMethod()
}

sql <- sql_values_subquery(con, values, types = types, lvl = 1)
db_compute(con, table, sql, overwrite = overwrite)
}

#' @export
Expand Down

0 comments on commit 3563fa7

Please sign in to comment.