cloud-fan commented on code in PR #42434:
URL: https://github.com/apache/spark/pull/42434#discussion_r1290790074
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ExpressionEvalHelper.scala:
##########
@@ -80,11 +80,16 @@ trait ExpressionEvalHelper extends
ScalaCheckDrivenPropertyChecks with PlanTestB
}
protected def checkEvaluation(
- expression: => Expression, expected: Any, inputRow: InternalRow =
EmptyRow): Unit = {
+ expression: => Expression, expected: Any, inputRow: InternalRow =
EmptyRow,
+ withCodegen: Boolean = false): Unit = {
// Make it as method to obtain fresh expression everytime.
def expr = prepareEvaluation(expression)
val catalystValue = CatalystTypeConverters.convertToCatalyst(expected)
- checkEvaluationWithoutCodegen(expr, catalystValue, inputRow)
+ if (withCodegen) {
+ checkEvaluation(expr, catalystValue, inputRow)
+ } else {
+ checkEvaluationWithoutCodegen(expr, catalystValue, inputRow)
+ }
checkEvaluationWithMutableProjection(expr, catalystValue, inputRow)
if (GenerateUnsafeProjection.canSupport(expr.dataType)) {
checkEvaluationWithUnsafeProjection(expr, catalystValue, inputRow)
Review Comment:
The test already checked codegen before. We don't need to touch this file,
just update the test to put null in the first element.
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ExpressionEvalHelper.scala:
##########
@@ -80,11 +80,16 @@ trait ExpressionEvalHelper extends
ScalaCheckDrivenPropertyChecks with PlanTestB
}
protected def checkEvaluation(
- expression: => Expression, expected: Any, inputRow: InternalRow =
EmptyRow): Unit = {
+ expression: => Expression, expected: Any, inputRow: InternalRow =
EmptyRow,
+ withCodegen: Boolean = false): Unit = {
// Make it as method to obtain fresh expression everytime.
def expr = prepareEvaluation(expression)
val catalystValue = CatalystTypeConverters.convertToCatalyst(expected)
- checkEvaluationWithoutCodegen(expr, catalystValue, inputRow)
+ if (withCodegen) {
+ checkEvaluation(expr, catalystValue, inputRow)
+ } else {
+ checkEvaluationWithoutCodegen(expr, catalystValue, inputRow)
+ }
checkEvaluationWithMutableProjection(expr, catalystValue, inputRow)
if (GenerateUnsafeProjection.canSupport(expr.dataType)) {
checkEvaluationWithUnsafeProjection(expr, catalystValue, inputRow)
Review Comment:
The test already checks codegen. We don't need to touch this file, just
update the test to put null in the first element.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]