spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject spark git commit: [HOTFIX][BUILD] Do not use contains in Option in JdbcRelationProvider
Date Sat, 08 Oct 2016 00:59:28 GMT
Repository: spark
Updated Branches:
  refs/heads/master 94b24b84a -> 24850c941


[HOTFIX][BUILD] Do not use contains in Option in JdbcRelationProvider

## What changes were proposed in this pull request?

This PR proposes the fix the use of `contains` API which only exists from Scala 2.11.

## How was this patch tested?

Manually checked:

```scala
scala> val o: Option[Boolean] = None
o: Option[Boolean] = None

scala> o == Some(false)
res17: Boolean = false

scala> val o: Option[Boolean] = Some(true)
o: Option[Boolean] = Some(true)

scala> o == Some(false)
res18: Boolean = false

scala> val o: Option[Boolean] = Some(false)
o: Option[Boolean] = Some(false)

scala> o == Some(false)
res19: Boolean = true
```

Author: hyukjinkwon <gurwls223@gmail.com>

Closes #15393 from HyukjinKwon/hotfix.


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

Branch: refs/heads/master
Commit: 24850c9415bfe18dc1edf66e5a7b4c554fff4f23
Parents: 94b24b8
Author: hyukjinkwon <gurwls223@gmail.com>
Authored: Fri Oct 7 17:59:24 2016 -0700
Committer: Reynold Xin <rxin@databricks.com>
Committed: Fri Oct 7 17:59:24 2016 -0700

----------------------------------------------------------------------
 .../sql/execution/datasources/jdbc/JdbcRelationProvider.scala      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/24850c94/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcRelationProvider.scala
----------------------------------------------------------------------
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcRelationProvider.scala
b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcRelationProvider.scala
index 3a8a197..b1a061b 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcRelationProvider.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcRelationProvider.scala
@@ -70,7 +70,7 @@ class JdbcRelationProvider extends CreatableRelationProvider
       if (tableExists) {
         mode match {
           case SaveMode.Overwrite =>
-            if (isTruncate && isCascadingTruncateTable(url).contains(false)) {
+            if (isTruncate && isCascadingTruncateTable(url) == Some(false)) {
               // In this case, we should truncate table and then load.
               truncateTable(conn, table)
               saveTable(df, url, table, props)


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


Mime
View raw message