diff options
author | gatorsmile <gatorsmile@gmail.com> | 2016-08-12 10:02:00 +0100 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2016-08-12 10:02:00 +0100 |
commit | 79e2caa1328843457841d71642b60be919ebb1e0 (patch) | |
tree | fa220c3122b03b264db197dc1611d7d59b7a30b2 | |
parent | f4482225c405b9cfe078deac74e4c28e2dcc97c3 (diff) | |
download | spark-79e2caa1328843457841d71642b60be919ebb1e0.tar.gz spark-79e2caa1328843457841d71642b60be919ebb1e0.tar.bz2 spark-79e2caa1328843457841d71642b60be919ebb1e0.zip |
[SPARK-16598][SQL][TEST] Added a test case for verifying the table identifier parsing
#### What changes were proposed in this pull request?
So far, the test cases of `TableIdentifierParserSuite` do not cover the quoted cases. We should add one for avoiding regression.
#### How was this patch tested?
N/A
Author: gatorsmile <gatorsmile@gmail.com>
Closes #14244 from gatorsmile/quotedIdentifiers.
-rw-r--r-- | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/TableIdentifierParserSuite.scala | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/TableIdentifierParserSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/TableIdentifierParserSuite.scala index 8bbf87e62d..dadb8a8def 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/TableIdentifierParserSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/TableIdentifierParserSuite.scala @@ -68,6 +68,14 @@ class TableIdentifierParserSuite extends SparkFunSuite { } } + test("quoted identifiers") { + assert(TableIdentifier("z", Some("x.y")) === parseTableIdentifier("`x.y`.z")) + assert(TableIdentifier("y.z", Some("x")) === parseTableIdentifier("x.`y.z`")) + assert(TableIdentifier("z", Some("`x.y`")) === parseTableIdentifier("```x.y```.z")) + assert(TableIdentifier("`y.z`", Some("x")) === parseTableIdentifier("x.```y.z```")) + assert(TableIdentifier("x.y.z", None) === parseTableIdentifier("`x.y.z`")) + } + test("table identifier - strict keywords") { // SQL Keywords. hiveStrictNonReservedKeyword.foreach { keyword => |