Open guixiaowen opened 6 months ago
@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.
@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.
@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.
@Yohahaha 3q.
@guixiaowen, the proposal looks good! Just left some comments on the velox PR. Thanks!
@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: https://github.com/facebookincubator/velox/pull/9621