Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use added method.
  • Loading branch information
viirya committed Apr 11, 2018
commit 5711ea12574a67ee4e309b81c6d616e8841c4dd6
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,12 @@ trait ExpressionEvalHelper extends GeneratorDrivenPropertyChecks {
checkEvaluationWithOptimization(expr, catalystValue, inputRow)
}


private def getActualDataType(dt: DataType): DataType = dt match {
case u: UserDefinedType[_] => getActualDataType(u.sqlType)
case _ => dt
}

/**
* Check the equality between result of expression and expected value, it will handle
* Array[Byte], Spread[Double], MapData and Row.
*/
protected def checkResult(result: Any, expected: Any, exprDataType: DataType): Boolean = {
val dataType = getActualDataType(exprDataType)
val dataType = UserDefinedType.sqlType(exprDataType)

(result, expected) match {
case (result: Array[Byte], expected: Array[Byte]) =>
Expand Down