Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
maropu committed Dec 4, 2018
1 parent 7ef5f86 commit fbfbbff
Showing 1 changed file with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -609,18 +609,11 @@ class UnsafeRowConverterSuite extends SparkFunSuite with Matchers with PlanTestB
MapType(StringType, IntegerType),
MapType(MapType(IntegerType, StringType), MapType(StringType, ShortType)))

val mapResultRow = convertBackToInternalRow(mapRow, fields4).toSeq(fields4)
val mapExpectedRow = mapRow.toSeq(fields4)
// Since `ArrayBasedMapData` does not override `equals` and `hashCode`,
// we convert it into the two `Seq`s of keys and values for correct comparisons.
def toComparable(d: Any): Any = d match {
case map: ArrayBasedMapData =>
val keys = map.keyArray.array.map(toComparable).toSeq
val values = map.valueArray.array.map(toComparable).toSeq
(keys, values)
case o => o
}
assert(mapResultRow.map(toComparable) === mapExpectedRow.map(toComparable))
val mapResultRow = convertBackToInternalRow(mapRow, fields4)
val mapExpectedRow = mapRow
checkResult(mapExpectedRow, mapResultRow,
exprDataType = StructType(fields4.zipWithIndex.map(f => StructField(s"c${f._2}", f._1))),
exprNullable = false)

// UDT tests
val vector = new TestUDT.MyDenseVector(Array(1.0, 3.0, 5.0, 7.0, 9.0))
Expand Down

0 comments on commit fbfbbff

Please sign in to comment.