Skip to content

Commit

Permalink
[SPARK-43362][SQL][FOLLOWUP] Special handling of JSON type for MySQL …
Browse files Browse the repository at this point in the history
…connector
  • Loading branch information
wangjunbo committed Apr 3, 2024
1 parent 360a3f9 commit 5fc0ee3
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ private case class MySQLDialect() extends JdbcDialect with SQLConfHelper {
case Types.VARCHAR if "TINYTEXT".equalsIgnoreCase(typeName) =>
// TINYTEXT is Types.VARCHAR(63) from mysql jdbc, but keep it AS-IS for historical reason
Some(StringType)
case Types.VARCHAR if "JSON".equalsIgnoreCase(typeName) =>
// Some MySQL JDBC drivers converts JSON type into Types.VARCHAR with a precision of -1.
case Types.VARCHAR | Types.CHAR if "JSON".equalsIgnoreCase(typeName) =>
// Some MySQL JDBC drivers converts JSON type into Types.VARCHAR with a precision of -1
// or Types.CHAR with a precision of Int.Max.
// Explicitly converts it into StringType here.
Some(StringType)
case Types.TINYINT =>
Expand Down

0 comments on commit 5fc0ee3

Please sign in to comment.