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/10/21 19:35:16 UTC
spark git commit: [SPARK-11037][SQL] using Option instead of Some in
JdbcDialects
Repository: spark
Updated Branches:
refs/heads/master 5cdea7d1e -> 8e82e5983
[SPARK-11037][SQL] using Option instead of Some in JdbcDialects
Using Option instead of Some in getCatalystType method.
Author: Pravin Gadakh <pr...@in.ibm.com>
Closes #9195 from pravingadakh/master.
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/8e82e598
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/8e82e598
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/8e82e598
Branch: refs/heads/master
Commit: 8e82e59834aefb74d49e45c9c9c926bb53143b4c
Parents: 5cdea7d
Author: Pravin Gadakh <pr...@in.ibm.com>
Authored: Wed Oct 21 10:35:09 2015 -0700
Committer: Reynold Xin <rx...@databricks.com>
Committed: Wed Oct 21 10:35:09 2015 -0700
----------------------------------------------------------------------
.../org/apache/spark/sql/jdbc/JdbcDialects.scala | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/8e82e598/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala
----------------------------------------------------------------------
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala b/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala
index a2ff4cc..88ae839 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala
@@ -198,15 +198,15 @@ case object PostgresDialect extends JdbcDialect {
override def getCatalystType(
sqlType: Int, typeName: String, size: Int, md: MetadataBuilder): Option[DataType] = {
if (sqlType == Types.BIT && typeName.equals("bit") && size != 1) {
- Some(BinaryType)
+ Option(BinaryType)
} else if (sqlType == Types.OTHER && typeName.equals("cidr")) {
- Some(StringType)
+ Option(StringType)
} else if (sqlType == Types.OTHER && typeName.equals("inet")) {
- Some(StringType)
+ Option(StringType)
} else if (sqlType == Types.OTHER && typeName.equals("json")) {
- Some(StringType)
+ Option(StringType)
} else if (sqlType == Types.OTHER && typeName.equals("jsonb")) {
- Some(StringType)
+ Option(StringType)
} else None
}
@@ -236,9 +236,9 @@ case object MySQLDialect extends JdbcDialect {
// This could instead be a BinaryType if we'd rather return bit-vectors of up to 64 bits as
// byte arrays instead of longs.
md.putLong("binarylong", 1)
- Some(LongType)
+ Option(LongType)
} else if (sqlType == Types.BIT && typeName.equals("TINYINT")) {
- Some(BooleanType)
+ Option(BooleanType)
} else None
}
@@ -279,7 +279,7 @@ case object MsSqlServerDialect extends JdbcDialect {
sqlType: Int, typeName: String, size: Int, md: MetadataBuilder): Option[DataType] = {
if (typeName.contains("datetimeoffset")) {
// String is recommend by Microsoft SQL Server for datetimeoffset types in non-MS clients
- Some(StringType)
+ Option(StringType)
} else None
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org