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

    https://github.com/apache/spark/pull/23199#discussion_r238130900
  
    --- Diff: 
sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4 ---
    @@ -1045,6 +1046,11 @@ DOUBLE_LITERAL
         | DECIMAL_DIGITS EXPONENT? 'D' {isValidDecimal()}?
         ;
     
    +FLOAT_LITERAL
    +    : DIGIT+ EXPONENT? 'F'
    +    | DECIMAL_DIGITS EXPONENT? 'F' {isValidDecimal()}?
    --- End diff --
    
    This is implementation-specific;
    ```
    hive> create temporary table t1 as select 1.0F;
    hive> describe t1;
    OK
    f                           decimal(1,0)  
    
    hive> create temporary table t2 as select 1.0D;
    hive> describe t2;
    OK
    _c0                         double  
    ```
    ```
    postgres=# create temporary table t1 as select 1.0F;
    postgres=# \d t1
     f      | numeric | 
    
    postgres=# create temporary table t2 as select 1.0D;
    postgres=# \d t2
     d      | numeric | 
    
    ```
    ```
    mysql> create temporary table t1 as select 1.0F;
    mysql> describe t1;
    +-------+--------------+------+-----+---------+-------+
    | Field | Type         | Null | Key | Default | Extra |
    +-------+--------------+------+-----+---------+-------+
    | F     | decimal(2,1) | NO   |     | 0.0     | NULL  |
    +-------+--------------+------+-----+---------+-------+
    
    mysql> create temporary table t2 as select 1.0D;
    mysql> describe t2;
    +-------+--------------+------+-----+---------+-------+
    | Field | Type         | Null | Key | Default | Extra |
    +-------+--------------+------+-----+---------+-------+
    | D     | decimal(2,1) | NO   |     | 0.0     | NULL  |
    +-------+--------------+------+-----+---------+-------+
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to