[GLUTEN-9095][UT] Remove Vanilla Spark InternalRow based checkEvaluation#9096
Conversation
|
Run Gluten Clickhouse CI on x86 |
|
cc @jackylee-ch could you PTAL thanks |
|
cc @jackylee-ch @jinchengchenghh gentle reminder if you could please review thanks! |
| checkEvaluationWithUnsafeProjection(expr, catalystValue, inputRow) | ||
| } | ||
| checkEvaluationWithOptimization(expr, catalystValue, inputRow) | ||
| checkEvaluationWithFallback(expression, expected, inputRow) |
There was a problem hiding this comment.
Why do we need this extra functions? They looks same as before.
There was a problem hiding this comment.
The checkEvaluationWithFallback only calls checkEvaluationWithoutCodegen and checkEvaluationWithMutableProjection etc. Avoiding the glutenCheckExpression. Moved this logic to the new function to prevent code duplication.
With this change, a test can directly call checkEvaluationWithFallback and avoid the glutenCheckExpression when not supported. (Have done for the UT added)
There was a problem hiding this comment.
Can you please review if all looks good thanks!
|
cc @jackylee-ch, gentle reminder sorry for the ping thanks |
| val resolver = ResolveTimeZone | ||
| val expr = resolver.resolveTimeZones(expression) | ||
| val catalystValue = CatalystTypeConverters.convertToCatalyst(expected) | ||
| checkEvaluationWithoutCodegen(expr, catalystValue, inputRow) |
There was a problem hiding this comment.
It seems these function are testing vaniila Cast, not related to gluten. Why we need it here?
There was a problem hiding this comment.
This is the default flow for checkEvaluation in Gluten. For Array/Map other unsupported types where we can't convert to DF, currently all tests fallback to vanilla Spark's row based evaluation.
This refactor makes it directly accessable to the test, for cases when it can't be incorporated into canConvertToDataFrame
There was a problem hiding this comment.
gentle reminder thanks!
There was a problem hiding this comment.
I'm trying to reproduce the problem with checkExecution, but the local compilation environment has some problems. The tests added to gluten should be related to testing gluten trasformer. If a case is just for testing vanilla, there is really no need to add it.
cc @philo-he
There was a problem hiding this comment.
Yes it seems this case runs the test on Vanilla Spark and the test may not mean anything for Gluten. I can remove it altogether, just wanted to confirm if there is a good reason behind adding this? @jackylee-ch @philo-he
There was a problem hiding this comment.
For now, It seems useless. We may consider adding it later once we have a better reason.
2cbf133 to
5674dc0
Compare
|
Run Gluten Clickhouse CI on x86 |
5674dc0 to
0c130cd
Compare
|
Run Gluten Clickhouse CI on x86 |
|
cc @jackylee-ch removed the check as we discussed, could you please take a look. thanks! |
|
cc @jackylee-ch gentle reminder thanks! |
|
|
||
| if (canConvertToDataFrame(inputRow)) { | ||
| glutenCheckExpression(expr, expected, inputRow) | ||
| } else { |
There was a problem hiding this comment.
Could you add a comment to "checkEvaluation" to indicate that the function only verifies the native result and skips the vanilla check.
There was a problem hiding this comment.
Maybe, it would be better to add a warning log to indicate the evaluation is skipped.
| @@ -136,15 +135,6 @@ trait GlutenTestsTrait extends GlutenTestsCommonTrait { | |||
|
|
|||
| if (canConvertToDataFrame(inputRow)) { | |||
There was a problem hiding this comment.
Can we move the above expression resolving code into the if branch?
|
This patch may also have an impact on CH backend test. @zzcclp, could you also take a look? |
0c130cd to
48f420f
Compare
|
Run Gluten Clickhouse CI on x86 |
48f420f to
19f90d1
Compare
|
Run Gluten Clickhouse CI on x86 |
19f90d1 to
4ae8847
Compare
|
Run Gluten Clickhouse CI on x86 |
| } | ||
| checkEvaluationWithOptimization(expr, catalystValue, inputRow) | ||
| logWarning( | ||
| "Skipping evaluation - Expression could not be converted " + |
There was a problem hiding this comment.
Suggestion:
Skipping evaluation - Nonempty inputRow cannot be converted to DataFrame due to **
4ae8847 to
171165f
Compare
|
Run Gluten Clickhouse CI on x86 |
What changes were proposed in this pull request?
How was this patch tested?