Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/7855#discussion_r36051711
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala
---
@@ -36,7 +36,11 @@ case class UnaryMinus(child: Expression) extends
UnaryExpression with ExpectsInp
override def genCode(ctx: CodeGenContext, ev: GeneratedExpressionCode):
String = dataType match {
case dt: DecimalType => defineCodeGen(ctx, ev, c =>
s"$c.unary_$$minus()")
- case dt: NumericType => defineCodeGen(ctx, ev, c =>
s"(${ctx.javaType(dt)})(-($c))")
+ case dt: NumericType => nullSafeCodeGen(ctx, ev, eval => {
+ s"""
+ ${ctx.javaType(dt)} um = (${ctx.javaType(dt)})($eval);
--- End diff --
what is um?
Don't you need to use a fresh name for this?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]