Github user hvanhovell commented on a diff in the pull request: https://github.com/apache/spark/pull/20748#discussion_r172513927 --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ExpressionEvalHelper.scala --- @@ -93,6 +95,40 @@ trait ExpressionEvalHelper extends GeneratorDrivenPropertyChecks { } } + protected def checkExceptionInExpression[T <: Throwable]( + expression: => Expression, + inputRow: InternalRow, + expectedErrMsg: String)( + implicit classTag: ClassTag[T]): Unit = { + val clazz = classTag.runtimeClass + val serializer = new JavaSerializer(new SparkConf()).newInstance + val resolver = ResolveTimeZone(new SQLConf) + val expr = resolver.resolveTimeZones( + serializer.deserialize[Expression](serializer.serialize(expression))) + + def checkException(eval: => Unit, testMode: String): Unit = { --- End diff -- Can we use the existing `intercept[...]` infrastructure here (not sure if it is possible)?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org