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

Daniel Barclay (Drill) commented on DRILL-2064:
-----------------------------------------------

In considering the renaming, note that SQL's lower- and higher-precision types 
are REAL and DOUBLE PRECISION, not FLOAT and DOUBLE PRECISION:

The SQL spec (ISO/IEC 9075:2011 Part 2 ยง 6.1 <data type>) says:
- <approximate numeric type> ::=
    FLOAT [ <left paren> <precision> <right paren> ]
    | REAL
    | DOUBLE PRECISION
  ...
- If a <precision> is omitted, then an implementation-defined <precision> is 
implicit.
  ...
- REAL specifies the data type approximate numeric, with implementation-defined 
precision.
- DOUBLE PRECISION specifies the data type approximate numeric, with 
implementation-defined precision
that is greater than the implementation-defined precision of REAL.
- FLOAT specifies the data type approximate numeric, with binary precision 
equal to or greater than the
value of the specified <precision>. The maximum value of <precision> is 
implementation-defined. <precision>
shall not be greater than this value.

That is:
- SQL REAL must map in Drill to Java float and the things currently named with 
"Float4" (so that DOUBLE PRECISION can have greater precision than it).
- SQL DOUBLE PRECISION maps to Java double and the things currently named with 
"Float8" (so that is has greater precision that REAL does).
- SQL FLOAT can map to whichever (of float/Float4 and double/Float8) Drill 
chooses (and Drill is supposed to document the chosen precision).
- SQL FLOAT(<precision>) must map to Java double/etc. if <precision> is greater 
than 24.  (If the requested precision is less, FLOAT(<precision>) can be mapped 
to either of float/Float4 or double/Float8.) 


> Internal "Float4" and "Float8" names are confusing; rename using "Float" and 
> "Double"
> -------------------------------------------------------------------------------------
>
>                 Key: DRILL-2064
>                 URL: https://issues.apache.org/jira/browse/DRILL-2064
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Data Types
>            Reporter: Daniel Barclay (Drill)
>            Priority: Minor
>             Fix For: 1.0.0
>
>
> [For/from Jacques:]
> The internal names (e.g., enumerations,  vector subtypes, function names) 
> containing "Float4" and "Float8" are confusing since they don't correspond to 
> type names "float" and "double" in Java, etc.
> Things currently named using "Float4" should be renamed to names using 
> "Float"; things currently named using "Float8" should be renamed using 
> "Double".



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

Reply via email to