Skip to content

Commit

Permalink
Remove unit tests associated with spark translation rules that were r…
Browse files Browse the repository at this point in the history
…emoved
  • Loading branch information
anthonysena committed Sep 26, 2023
1 parent 9aaef1a commit c806a47
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions tests/testthat/test-translate-spark.R
Original file line number Diff line number Diff line change
Expand Up @@ -376,35 +376,6 @@ test_that("translate sql server -> spark DROP TABLE IF EXISTS", {
expect_equal_ignore_spaces(sql, "DROP TABLE IF EXISTS test;")
})

test_that("translate sql server -> spark INSERT INTO SELECT", {
sql <- translate("INSERT INTO a (b int) SELECT c FROM cte1;",
targetDialect = "spark"
)
expect_equal_ignore_spaces(
sql,
"WITH insertion_temp AS (\n(SELECT c FROM cte1) UNION ALL (SELECT b int FROM a ))\nINSERT OVERWRITE TABLE a (b int) SELECT * FROM insertion_temp;"
)
})

test_that("translate sql server -> spark INSERT INTO VALUES", {
sql <- translate("INSERT INTO my_table (key,value) VALUES (1,0),(2,0),(3,1);",
targetDialect = "spark"
)
expect_equal_ignore_spaces(
sql,
"WITH insertion_temp AS (\n(SELECT * FROM VALUES (1,0),(2,0),(3,1) T(key,value)) UNION ALL (SELECT key,value FROM my_table ))\nINSERT OVERWRITE TABLE my_table (key,value) SELECT * FROM insertion_temp;"
)
})

test_that("translate sql server -> spark DELETE FROM WHERE", {
sql <- translate("DELETE FROM my_table WHERE a=1;",
targetDialect = "spark"
)
expect_equal_ignore_spaces(
sql,
"INSERT OVERWRITE TABLE my_table SELECT * FROM my_table WHERE NOT (a=1);"
)
})
test_that("translate sql server -> spark double CTE INSERT INTO", {
sql <- translate(
"WITH a AS (
Expand Down

0 comments on commit c806a47

Please sign in to comment.