[SPARK-9549][SQL] fix bugs in expressions#7882
Conversation
There was a problem hiding this comment.
add one for int/short/byte type too
There was a problem hiding this comment.
could this throw a bad exception if the input is some other type that is not Double/Float?
There was a problem hiding this comment.
I have this in Nanvl:
override def inputTypes: Seq[AbstractDataType] =
Seq(TypeCollection(DoubleType, FloatType), TypeCollection(DoubleType, FloatType))There was a problem hiding this comment.
can you double check that FunctionArgumentConversion is not called before the implicit cast rule?
|
Test build #39500 has finished for PR 7882 at commit
|
|
Test build #39505 has finished for PR 7882 at commit
|
|
LGTM |
|
Test build #39514 has finished for PR 7882 at commit
|
|
Thanks - I've merged this. |
There was a problem hiding this comment.
The above two statements can be replaced with:
val (currentYear, currentMonthInYear) = nonNegativeMonth /% 12
There was a problem hiding this comment.
/% is not defined for Int.
I read the notion in a Scala book which I have returned. I will read more once I have that book back.
JIRA: https://issues.apache.org/jira/browse/SPARK-9549
This PR fix the following bugs:
UnaryMinus's codegen version would fail to compile when the input isLong.MinValueBinaryComparisonwould fail to compile in codegen mode when comparing Boolean types.AddMonthwould fail if passed a huge negative month, which would lead accessing negative index ofmonthDaysarray.Nanvlwith different type operands.