[ 
https://issues.apache.org/jira/browse/PHOENIX-1814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494877#comment-14494877
 ] 

ASF GitHub Bot commented on PHOENIX-1814:
-----------------------------------------

Github user JamesRTaylor commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/67#discussion_r28370410
  
    --- Diff: phoenix-core/src/main/antlr3/PhoenixSQL.g ---
    @@ -967,9 +967,14 @@ NUMBER
         :   POSINTEGER
         ;
     
    -// Exponential format is not supported.
     DECIMAL
    --- End diff --
    
    Instead of creating a DECIMAL (which maps to PDecimal that uses a 
BigDecimal), create a rule for DOUBLE which matches the e notation and returns 
a PDouble instead (which uses a Java double). You could potentially 
conditionally return a PFloat versus a PDouble depending on the precision used, 
but not sure we really need to do that. This is the way I've seen other 
databases make it possible to define a literal that's a double instead of a 
DECIMAL or NUMERIC.


> Handle e notation for defining float/double
> -------------------------------------------
>
>                 Key: PHOENIX-1814
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1814
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: James Taylor
>            Assignee: Brian Esserlieu
>              Labels: Newbie
>
> We should allow a numeric literal to be defined with e notation for a 
> float/double like this: 
> {code}
> +1.5e-7
> 12E-5
> -.12345e+6789
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to