diff options
author | hyukjinkwon <gurwls223@gmail.com> | 2016-10-07 17:59:24 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2016-10-07 17:59:24 -0700 |
commit | 24850c9415bfe18dc1edf66e5a7b4c554fff4f23 (patch) | |
tree | 29822daa9355648d23aca3fd6494eb05734adf25 | |
parent | 94b24b84a666517e31e9c9d693f92d9bbfd7f9ad (diff) | |
download | spark-24850c9415bfe18dc1edf66e5a7b4c554fff4f23.tar.gz spark-24850c9415bfe18dc1edf66e5a7b4c554fff4f23.tar.bz2 spark-24850c9415bfe18dc1edf66e5a7b4c554fff4f23.zip |
[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.
-rw-r--r-- | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcRelationProvider.scala | 2 |
1 files changed, 1 insertions, 1 deletions
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 3a8a197ef5..b1a061b6f7 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) |