Skip to content
  • Herman van Hovell's avatar
    10173279
    [SPARK-12848][SQL] Change parsed decimal literal datatype from Double to Decimal · 10173279
    Herman van Hovell authored
    The current parser turns a decimal literal, for example ```12.1```, into a Double. The problem with this approach is that we convert an exact literal into a non-exact ```Double```. The PR changes this behavior, a Decimal literal is now converted into an extact ```BigDecimal```.
    
    The behavior for scientific decimals, for example ```12.1e01```, is unchanged. This will be converted into a Double.
    
    This PR replaces the ```BigDecimal``` literal by a ```Double``` literal, because the ```BigDecimal``` is the default now. You can use the double literal by appending a 'D' to the value, for instance: ```3.141527D```
    
    cc davies rxin
    
    Author: Herman van Hovell <hvanhovell@questtec.nl>
    
    Closes #10796 from hvanhovell/SPARK-12848.
    10173279
    [SPARK-12848][SQL] Change parsed decimal literal datatype from Double to Decimal
    Herman van Hovell authored
    The current parser turns a decimal literal, for example ```12.1```, into a Double. The problem with this approach is that we convert an exact literal into a non-exact ```Double```. The PR changes this behavior, a Decimal literal is now converted into an extact ```BigDecimal```.
    
    The behavior for scientific decimals, for example ```12.1e01```, is unchanged. This will be converted into a Double.
    
    This PR replaces the ```BigDecimal``` literal by a ```Double``` literal, because the ```BigDecimal``` is the default now. You can use the double literal by appending a 'D' to the value, for instance: ```3.141527D```
    
    cc davies rxin
    
    Author: Herman van Hovell <hvanhovell@questtec.nl>
    
    Closes #10796 from hvanhovell/SPARK-12848.
Loading