Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-1599877 Move Session Parameter Related Tests to Non Sproc Suite #134

Merged
merged 1 commit into from
Aug 5, 2024
Merged
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.snowflake.snowpark_test

import com.snowflake.snowpark.TestData
import com.snowflake.snowpark.functions.col
import com.snowflake.snowpark.{SaveMode, TestData, UpdateResult}
import com.snowflake.snowpark.functions.{col, lit}

class DataFrameNonStoredProcSuite extends TestData {

Expand Down Expand Up @@ -82,4 +82,22 @@ class DataFrameNonStoredProcSuite extends TestData {
"enable",
skipIfParamNotExist = true)
}

test("ERROR_ON_NONDETERMINISTIC_UPDATE = true") {
val tableName: String = randomName()
createTable(tableName, "num int")
try {
runQuery(s"insert into $tableName values(1),(2),(3)", session)
withSessionParameters(Seq(("ERROR_ON_NONDETERMINISTIC_UPDATE", "true")), session) {
testData2.write.mode(SaveMode.Overwrite).saveAsTable(tableName)
val updatable = session.table(tableName)
testData2.write.mode(SaveMode.Overwrite).saveAsTable(tableName)
assert(
updatable.update(Map(col("a") -> lit(1), col("b") -> lit(0))) == UpdateResult(6, 0))
}
} finally {
dropTable(tableName)
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -388,14 +388,5 @@ class UpdatableSuite extends TestData {
dropTable(tableName)
}
}

test("ERROR_ON_NONDETERMINISTIC_UPDATE = true") {
withSessionParameters(Seq(("ERROR_ON_NONDETERMINISTIC_UPDATE", "true")), session) {
testData2.write.mode(SaveMode.Overwrite).saveAsTable(tableName)
val updatable = session.table(tableName)
testData2.write.mode(SaveMode.Overwrite).saveAsTable(tableName)
assert(updatable.update(Map(col("a") -> lit(1), col("b") -> lit(0))) == UpdateResult(6, 0))
}
}
}

Loading