You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by li...@apache.org on 2017/08/06 23:41:17 UTC
spark git commit: Add "full_outer" name to join types
Repository: spark
Updated Branches:
refs/heads/master 55aa4da28 -> 438c38158
Add "full_outer" name to join types
I have discovered that "full_outer" name option is working in Spark 2.0, but it is not printed in exception. Please verify.
## What changes were proposed in this pull request?
(Please fill in changes proposed in this fix)
## How was this patch tested?
(Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
(If this patch involves UI changes, please attach a screenshot; otherwise, remove this)
Please review http://spark.apache.org/contributing.html before opening a pull request.
Author: BartekH <ba...@gmail.com>
Closes #17985 from BartekH/patch-1.
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/438c3815
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/438c3815
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/438c3815
Branch: refs/heads/master
Commit: 438c3815846d1ba17d0b1dae8e69a96f10107904
Parents: 55aa4da
Author: BartekH <ba...@gmail.com>
Authored: Sun Aug 6 16:40:59 2017 -0700
Committer: Xiao Li <ga...@gmail.com>
Committed: Sun Aug 6 16:40:59 2017 -0700
----------------------------------------------------------------------
.../spark/sql/catalyst/plans/joinTypes.scala | 10 ++--
.../sql/catalyst/plans/JoinTypesTest.scala | 62 ++++++++++++++++++++
2 files changed, 67 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/438c3815/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 90d11d6..c778490 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
@@ -33,11 +33,11 @@ object JoinType {
case _ =>
val supported = Seq(
"inner",
- "outer", "full", "fullouter",
- "leftouter", "left",
- "rightouter", "right",
- "leftsemi",
- "leftanti",
+ "outer", "full", "fullouter", "full_outer",
+ "leftouter", "left", "left_outer",
+ "rightouter", "right", "right_outer",
+ "leftsemi", "left_semi",
+ "leftanti", "left_anti",
"cross")
throw new IllegalArgumentException(s"Unsupported join type '$typ'. " +
http://git-wip-us.apache.org/repos/asf/spark/blob/438c3815/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/JoinTypesTest.scala
----------------------------------------------------------------------
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/JoinTypesTest.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/JoinTypesTest.scala
new file mode 100644
index 0000000..d56f979
--- /dev/null
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/JoinTypesTest.scala
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.spark.sql.catalyst.plans
+
+import org.apache.spark.SparkFunSuite
+
+class JoinTypesTest extends SparkFunSuite {
+
+ test("construct an Inner type") {
+ assert(JoinType("inner") === Inner)
+ }
+
+ test("construct a FullOuter type") {
+ assert(JoinType("fullouter") === FullOuter)
+ assert(JoinType("full_outer") === FullOuter)
+ assert(JoinType("outer") === FullOuter)
+ assert(JoinType("full") === FullOuter)
+ }
+
+ test("construct a LeftOuter type") {
+ assert(JoinType("leftouter") === LeftOuter)
+ assert(JoinType("left_outer") === LeftOuter)
+ assert(JoinType("left") === LeftOuter)
+ }
+
+ test("construct a RightOuter type") {
+ assert(JoinType("rightouter") === RightOuter)
+ assert(JoinType("right_outer") === RightOuter)
+ assert(JoinType("right") === RightOuter)
+ }
+
+ test("construct a LeftSemi type") {
+ assert(JoinType("leftsemi") === LeftSemi)
+ assert(JoinType("left_semi") === LeftSemi)
+ }
+
+ test("construct a LeftAnti type") {
+ assert(JoinType("leftanti") === LeftAnti)
+ assert(JoinType("left_anti") === LeftAnti)
+ }
+
+ test("construct a Cross type") {
+ assert(JoinType("cross") === Cross)
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org