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
[VL] add div function #5574
Comments
@PHILO-HE PH hi, Can you help me check if the direction of the issuse I mentioned is correct. |
@Yohahaha yo hi, Can you help me check if the direction of the issuse I mentioned is correct. |
yeah, IntegralDivide for Long type is missed, you can verify it with an UT. |
@guixiaowen, the proposal looks good! Just left some comments on the velox PR. Thanks! |
OK. Thanks. |
Description
div function
expr1 div expr2 - Divide expr1 by expr2. It returns NULL if an operand is NULL or expr2 is 0. The result is casted to long.
Examples:
`
SELECT 3 div 2;
SELECT INTERVAL '1-1' YEAR TO MONTH div INTERVAL '-1' MONTH;
-13
`
In Spark, the implementation class of div is: IntegralDivide.
In 3.2.x, supports two types of div:
div(long, long) , return long result
div(decimal, decimal), return long result
After 3.3.x, add new type:
div(YearMonthIntervalType, YearMonthIntervalType), return long result
div(DayTimeIntervalType, DayTimeIntervalType), return long result
In velox, the currently supported DIV scenarios are:
divide(x, y) → double
divide(x, y) → decimal
//TODO:
To support div, add velox udf function.
divide(x, y) → long
div(long, long) , return long result
Pr:
facebookincubator/velox#9621
The text was updated successfully, but these errors were encountered: