Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
c7abad3
Added stringDataType option to jdbc connection properties
rama-mullapudi Aug 22, 2015
f1d0b9e
Added maxlength for field metadata so string types can use for VARCHAR.
rama-mullapudi Aug 27, 2015
faff507
Added maxlength for field metadata so string types can use for VARCHAR.
rama-mullapudi Aug 27, 2015
c4b4477
Added maxlength for field metadata so string types can use for VARCHAR.
rama-mullapudi Aug 27, 2015
35e61f3
Added method override for getJDBCType to take 2 parameters DataType a…
rama-mullapudi Sep 14, 2015
dd22b2f
Sync to master
rama-mullapudi Sep 14, 2015
cd809c5
Sync Master
rama-mullapudi Sep 26, 2015
0cfeefa
Sync Master
rama-mullapudi Sep 26, 2015
dddc137
Updated a call with added parameter
rama-mullapudi Sep 26, 2015
5f532e8
Fixed spark code style where comment exceeded 100 chars, and changed …
rama-mullapudi Sep 28, 2015
03f4d96
Merge remote-tracking branch 'upstream/master'
rama-mullapudi Sep 28, 2015
27f118b
Fixed sync with master issue
rama-mullapudi Sep 28, 2015
44e1978
Fixed JDBCSuite for DB2 to send extra parameter for getJDBCType
rama-mullapudi Sep 28, 2015
e605a11
Fixed JDBCSuite for DB2 to send extra parameter for getJDBCType
rama-mullapudi Sep 28, 2015
4cae11b
Fixed JDBCSuite for DB2 to send extra parameter for getJDBCType
rama-mullapudi Sep 29, 2015
4c2a7a4
Updated JDBCDialects to save VARCHAR size to metadata
rama-mullapudi Sep 29, 2015
a0cb024
Updated JDBCDialects to save VARCHAR size to metadata
rama-mullapudi Sep 29, 2015
d50bdf7
Changed call for getJDBCType to call both methods with datatype and m…
rama-mullapudi Oct 4, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Sync to master
Conflicts:
	sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala
	sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala
  • Loading branch information
rama-mullapudi committed Sep 14, 2015
commit dd22b2f9f653ad0cb203853fe10c350db9c95cc6
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,12 @@ object JdbcDialects {

registerDialect(MySQLDialect)
registerDialect(PostgresDialect)
<<<<<<< HEAD
registerDialect(OracleDialect)
registerDialect(NetezzaDialect)
=======
registerDialect(DB2Dialect)
>>>>>>> upstream/master

/**
* Fetch the JdbcDialect class corresponding to a given database url.
Expand Down Expand Up @@ -235,9 +239,26 @@ case object MySQLDialect extends JdbcDialect {

/**
* :: DeveloperApi ::
* Default Oracle dialect, mapping string/boolean on write to valid Oracle types.
* Default DB2 dialect, mapping string/boolean on write to valid DB2 types.
* By default string, and boolean gets mapped to db2 invalid types TEXT, and BIT(1).
*/
@DeveloperApi
case object DB2Dialect extends JdbcDialect {

override def canHandle(url: String): Boolean = url.startsWith("jdbc:db2")

override def getJDBCType(dt: DataType, md: Metadata): Option[JdbcType] = dt match {
case StringType => Some(JdbcType("CLOB", java.sql.Types.CLOB))
case BooleanType => Some(JdbcType("CHAR(1)", java.sql.Types.CHAR))
case _ => None
}
}

/**
* :: DeveloperApi ::
* Default Oracle dialect, mapping string/boolean on write to valid Oracle types.
*/
@DeveloperApi
case object OracleDialect extends JdbcDialect {

override def canHandle(url: String): Boolean = url.startsWith("jdbc:oracle")
Expand Down Expand Up @@ -273,4 +294,4 @@ case object NetezzaDialect extends JdbcDialect {
Some(JdbcType("BOOLEAN", java.sql.Types.BOOLEAN))
} else None
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ class JDBCSuite extends SparkFunSuite with BeforeAndAfter with SharedSQLContext
assert(JdbcDialects.get("jdbc:postgresql://127.0.0.1/db") == PostgresDialect)
assert(JdbcDialects.get("jdbc:oracle://127.0.0.1/db") == OracleDialect)
assert(JdbcDialects.get("jdbc:netezza://127.0.0.1/db") == NetezzaDialect)
assert(JdbcDialects.get("jdbc:db2://127.0.0.1/db") == DB2Dialect)
assert(JdbcDialects.get("test.invalid") == NoopDialect)
}

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.