Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
Impala 2.5.0
Description
The conversion rules for mixing decimals and integers are a little confusing.
select 10.0 / 3
results in a double because it has a decimal literal and non-decimal literal argument.
But
select 10.0 / 3.0
results in a decimal because it has two decimal literal arguments.
Part of the justification for this is that decimal was significantly slower than double, so we didn't want users to see sudden performance regressions. However, we've since improved decimal performance a lot so we should consider revisiting this behaviour.
The relevant code is Expr.convertNumericLiteralsFromDecimal()
Attachments
Issue Links
- blocks
-
IMPALA-4924 Make DECIMAL_V2 the default mode
-
- Resolved
-
- is duplicated by
-
IMPALA-1879 mod() function doesn't always interpret fractional arguments as DECIMAL
-
- Resolved
-
- is related to
-
IMPALA-4129 integer division should result in decimal not double
-
- Resolved
-