Skip to content

Commit

Permalink
Use JsonRDD.nullTypeToStringType to convert NullType to StringType.
Browse files Browse the repository at this point in the history
  • Loading branch information
yhuai committed Jan 8, 2015
1 parent 1eeb769 commit 50a03b0
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ private[sql] case class JSONRelation(
private def baseRDD = sqlContext.sparkContext.textFile(fileName)

override val schema = userSpecifiedSchema.getOrElse(
JsonRDD.inferSchema(
baseRDD,
samplingRatio,
sqlContext.columnNameOfCorruptRecord)
)
JsonRDD.nullTypeToStringType(
JsonRDD.inferSchema(
baseRDD,
samplingRatio,
sqlContext.columnNameOfCorruptRecord)))

override def buildScan() =
JsonRDD.jsonStringToRow(baseRDD, schema, sqlContext.columnNameOfCorruptRecord)
Expand Down

0 comments on commit 50a03b0

Please sign in to comment.