File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
sql/core/src/main/scala/org/apache/spark/sql/execution Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,9 @@ object RDDConversions {
3838 } else {
3939 val bufferedIterator = iterator.buffered
4040 val mutableRow = new SpecificMutableRow (schema.fields.map(_.dataType))
41- val schemaFields = schema.fields.toArray
41+ val schemaFields = schema.fields
42+ assert(mutableRow.length == schemaFields.length,
43+ s " Input row has ${mutableRow.length} fields but schema has ${schemaFields.length}" )
4244 val converters = schemaFields.map {
4345 f => CatalystTypeConverters .createToCatalystConverter(f.dataType)
4446 }
@@ -65,7 +67,9 @@ object RDDConversions {
6567 } else {
6668 val bufferedIterator = iterator.buffered
6769 val mutableRow = new GenericMutableRow (bufferedIterator.head.toSeq.toArray)
68- val schemaFields = schema.fields.toArray
70+ val schemaFields = schema.fields
71+ assert(mutableRow.length == schemaFields.length,
72+ s " Input row has ${mutableRow.length} fields but schema has ${schemaFields.length}" )
6973 val converters = schemaFields.map {
7074 f => CatalystTypeConverters .createToCatalystConverter(f.dataType)
7175 }
You can’t perform that action at this time.
0 commit comments