Skip to content

Commit

Permalink
fix NullType MatchError in JavaSchemaRDD when sql has null
Browse files Browse the repository at this point in the history
  • Loading branch information
YanTangZhai committed Dec 1, 2014
1 parent 6e643f8 commit 896c7b7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sql/core/src/main/scala/org/apache/spark/sql/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,16 @@ package object sql {
@DeveloperApi
val ShortType = catalyst.types.ShortType

/**
* :: DeveloperApi ::
*
* The data type representing `NULL` values.
*
* @group dataType
*/
@DeveloperApi
val NullType = catalyst.types.NullType

/**
* :: DeveloperApi ::
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ protected[sql] object DataTypeConversions {
case IntegerType => JDataType.IntegerType
case LongType => JDataType.LongType
case ShortType => JDataType.ShortType
case NullType => JDataType.StringType

case arrayType: ArrayType => JDataType.createArrayType(
asJavaDataType(arrayType.elementType), arrayType.containsNull)
Expand Down

0 comments on commit 896c7b7

Please sign in to comment.