-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multiplication on ANSI interval types #5105
Conversation
Signed-off-by: Chong Gao <res_life@163.com>
build |
build |
sql-plugin/src/main/330+/scala/org/apache/spark/sql/rapids/shims/intervalExpressions.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/330+/scala/org/apache/spark/sql/rapids/shims/intervalExpressions.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/330+/scala/org/apache/spark/sql/rapids/shims/intervalExpressions.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/330+/scala/org/apache/spark/sql/rapids/shims/intervalExpressions.scala
Outdated
Show resolved
Hide resolved
|
||
longResult.incRefCount() | ||
} | ||
case _: FloatType => // num is float |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try
case FloatType | DoubleType => interval.mul(numOperable, DType.FLOAT64)
instead of separating the float and double ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
sql-plugin/src/main/330+/scala/org/apache/spark/sql/rapids/shims/intervalExpressions.scala
Outdated
Show resolved
Hide resolved
* if(x == Long.MIN_VALUE && y == -1) throw exception | ||
* | ||
* @param x long cv or scalar | ||
* @param y long cv or scalar, will not be scalar if x is scalar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
y is declared to be a column vector in the below function, can not be a scalar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the comments.
sql-plugin/src/main/330+/scala/org/apache/spark/sql/rapids/shims/intervalExpressions.scala
Outdated
Show resolved
Hide resolved
* @param y long cv or scalar, will not be scalar if x is scalar | ||
* @param r is the result of x * y | ||
*/ | ||
def checkMultiplyOverflowSimpleImp(x: BinaryOperable, y: ColumnVector, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The postfix Imp
, personally , is not suitable here. Usually it is used in a class declaration for implementing an interface, or a concrete method declaration implementing an abstract method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
Waiting #5150 to merge, has some conflict on |
build |
build |
1 similar comment
build |
build |
sql-plugin/src/main/330+/scala/org/apache/spark/sql/rapids/shims/intervalExpressions.scala
Outdated
Show resolved
Hide resolved
build |
build |
build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Contributes #4151
Supports
Note: not support decimal type because of CUDF Decimal128 does not handle overflow, like:
Signed-off-by: Chong Gao res_life@163.com