Skip to content

Commit

Permalink
Add assertions in order to reproduce SPARK-7858
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshRosen committed May 26, 2015
1 parent 8ba195c commit 5a00e66
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ object RDDConversions {
} else {
val bufferedIterator = iterator.buffered
val mutableRow = new SpecificMutableRow(schema.fields.map(_.dataType))
val schemaFields = schema.fields.toArray
val schemaFields = schema.fields
assert(mutableRow.length == schemaFields.length,
s"Input row has ${mutableRow.length} fields but schema has ${schemaFields.length}")
val converters = schemaFields.map {
f => CatalystTypeConverters.createToCatalystConverter(f.dataType)
}
Expand All @@ -65,7 +67,9 @@ object RDDConversions {
} else {
val bufferedIterator = iterator.buffered
val mutableRow = new GenericMutableRow(bufferedIterator.head.toSeq.toArray)
val schemaFields = schema.fields.toArray
val schemaFields = schema.fields
assert(mutableRow.length == schemaFields.length,
s"Input row has ${mutableRow.length} fields but schema has ${schemaFields.length}")
val converters = schemaFields.map {
f => CatalystTypeConverters.createToCatalystConverter(f.dataType)
}
Expand Down

0 comments on commit 5a00e66

Please sign in to comment.