Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
miland-db committed Aug 9, 2024
1 parent 67fd0d4 commit 9675b3d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 2 additions & 0 deletions docs/sql-ref-ansi-compliance.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ Below is a list of all the keywords in Spark SQL.
|CONCATENATE|non-reserved|non-reserved|non-reserved|
|CONSTRAINT|reserved|non-reserved|reserved|
|CONTAINS|non-reserved|non-reserved|non-reserved|
|CONTINUE|non-reserved|non-reserved|non-reserved|
|COST|non-reserved|non-reserved|non-reserved|
|CREATE|reserved|non-reserved|reserved|
|CROSS|reserved|strict-non-reserved|reserved|
Expand Down Expand Up @@ -530,6 +531,7 @@ Below is a list of all the keywords in Spark SQL.
|GRANT|reserved|non-reserved|reserved|
|GROUP|reserved|non-reserved|reserved|
|GROUPING|non-reserved|non-reserved|reserved|
|HANDLER|non-reserved|non-reserved|non-reserved|
|HAVING|reserved|non-reserved|reserved|
|HOUR|non-reserved|non-reserved|non-reserved|
|HOURS|non-reserved|non-reserved|non-reserved|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,21 +357,20 @@ class SqlScriptingParserSuite extends SparkFunSuite with SQLHelper {
| DECLARE test CONDITION;
|END""".stripMargin
val tree = parseScript(sqlScriptText)
assert(tree.collection.length == 1)
assert(tree.collection.head.isInstanceOf[ErrorCondition])
assert(tree.collection.head.asInstanceOf[ErrorCondition].value.equals("45000"))
assert(tree.conditions.size == 1)
assert(tree.conditions("test").equals("45000")) // Default SQLSTATE
}

test("declare condition: custom sqlstate") {
val sqlScriptText =
"""
|BEGIN
| SELECT 1;
| DECLARE test CONDITION FOR '12000';
|END""".stripMargin
val tree = parseScript(sqlScriptText)
assert(tree.collection.length == 1)
assert(tree.collection.head.isInstanceOf[ErrorCondition])
assert(tree.collection.head.asInstanceOf[ErrorCondition].value.equals("12000"))
assert(tree.conditions.size == 1)
assert(tree.conditions("test").equals("12000"))
}

test("declare handler") {
Expand Down

0 comments on commit 9675b3d

Please sign in to comment.