You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by rx...@apache.org on 2015/05/12 02:02:15 UTC

spark git commit: [SQL] Show better error messages for incorrect join types in DataFrames.

Repository: spark
Updated Branches:
  refs/heads/master 91dc3dfd7 -> 4f4dbb030


[SQL] Show better error messages for incorrect join types in DataFrames.

As a follow-up to https://github.com/apache/spark/pull/5944

Author: Reynold Xin <rx...@databricks.com>

Closes #6064 from rxin/jointype-better-error and squashes the following commits:

7629bf7 [Reynold Xin] [SQL] Show better error messages for incorrect join types in DataFrames.


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

Branch: refs/heads/master
Commit: 4f4dbb030c208caba18f314a1ef1751696627d26
Parents: 91dc3df
Author: Reynold Xin <rx...@databricks.com>
Authored: Mon May 11 17:02:11 2015 -0700
Committer: Reynold Xin <rx...@databricks.com>
Committed: Mon May 11 17:02:11 2015 -0700

----------------------------------------------------------------------
 .../org/apache/spark/sql/catalyst/plans/joinTypes.scala   | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/4f4dbb03/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/joinTypes.scala
----------------------------------------------------------------------
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/joinTypes.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/joinTypes.scala
index 5dc0539..77dec7c 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/joinTypes.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/joinTypes.scala
@@ -24,6 +24,16 @@ object JoinType {
     case "leftouter" | "left" => LeftOuter
     case "rightouter" | "right" => RightOuter
     case "leftsemi" => LeftSemi
+    case _ =>
+      val supported = Seq(
+        "inner",
+        "outer", "full", "fullouter",
+        "leftouter", "left",
+        "rightouter", "right",
+        "leftsemi")
+
+      throw new IllegalArgumentException(s"Unsupported join type '$typ'. " +
+        "Supported join types include: " + supported.mkString("'", "', '", "'") + ".")
   }
 }
 


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