[
https://issues.apache.org/jira/browse/SPARK-12904?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Reynold Xin updated SPARK-12904:
--------------------------------
Description:
We can do the following strength reduction for comparisons between an integral
column and a decimal literal:
1. int_col > decimal_literal => int_col > floor(decimal_literal)
2. int_col >= decimal_literal => int_col >= ceil(decimal_literal)
3. int_col < decimal_literal => int_col < ceil(decimal_literal)
4. int_col <= decimal_literal => int_col <= floor(decimal_literal)
5. decimal_literal > int_col => ceil(decimal_literal) > int_col
6. decimal_literal >= int_col => floor(decimal_literal) >= int_col
7. decimal_literal < int_col => floor(decimal_literal) < int_col
8. decimal_literal <= int_col => ceil(decimal_literal) <= int_col
This is more useful as soon as we start parsing floating point numeric literals
as decimals rather than doubles (SPARK-12848).
was:
We can do the following strength reduction for comparisons between an integral
column and a decimal literal:
1. int_col > decimal_literal => int_col > floor(decimal_literal)
2. int_col >= decimal_literal => int_col > ceil(decimal_literal)
3. int_col < decimal_literal => int_col < floor(decimal_literal)
4. int_col <= decimal_literal => int_col < ceil(decimal_literal)
This is more useful as soon as we start parsing floating point numeric literals
as decimals rather than doubles (SPARK-12848).
> Strength reduction for integer/decimal comparisons
> --------------------------------------------------
>
> Key: SPARK-12904
> URL: https://issues.apache.org/jira/browse/SPARK-12904
> Project: Spark
> Issue Type: Bug
> Components: Optimizer, SQL
> Reporter: Reynold Xin
> Assignee: Reynold Xin
> Fix For: 2.0.0
>
>
> We can do the following strength reduction for comparisons between an
> integral column and a decimal literal:
> 1. int_col > decimal_literal => int_col > floor(decimal_literal)
> 2. int_col >= decimal_literal => int_col >= ceil(decimal_literal)
> 3. int_col < decimal_literal => int_col < ceil(decimal_literal)
> 4. int_col <= decimal_literal => int_col <= floor(decimal_literal)
> 5. decimal_literal > int_col => ceil(decimal_literal) > int_col
> 6. decimal_literal >= int_col => floor(decimal_literal) >= int_col
> 7. decimal_literal < int_col => floor(decimal_literal) < int_col
> 8. decimal_literal <= int_col => ceil(decimal_literal) <= int_col
> This is more useful as soon as we start parsing floating point numeric
> literals as decimals rather than doubles (SPARK-12848).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]