You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by sr...@apache.org on 2016/08/12 09:02:03 UTC

spark git commit: [SPARK-16598][SQL][TEST] Added a test case for verifying the table identifier parsing

Repository: spark
Updated Branches:
  refs/heads/master f4482225c -> 79e2caa13


[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 <ga...@gmail.com>

Closes #14244 from gatorsmile/quotedIdentifiers.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/79e2caa1
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/79e2caa1
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/79e2caa1

Branch: refs/heads/master
Commit: 79e2caa1328843457841d71642b60be919ebb1e0
Parents: f448222
Author: gatorsmile <ga...@gmail.com>
Authored: Fri Aug 12 10:02:00 2016 +0100
Committer: Sean Owen <so...@cloudera.com>
Committed: Fri Aug 12 10:02:00 2016 +0100

----------------------------------------------------------------------
 .../sql/catalyst/parser/TableIdentifierParserSuite.scala     | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/79e2caa1/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/TableIdentifierParserSuite.scala
----------------------------------------------------------------------
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 8bbf87e..dadb8a8 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 =>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org