cloud-fan commented on a change in pull request #26537: [SPARK-29587][SQL] 
Support SQL Standard type real as float(4) numeric as decimal
URL: https://github.com/apache/spark/pull/26537#discussion_r346688874
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
 ##########
 @@ -2154,17 +2154,17 @@ class AstBuilder(conf: SQLConf) extends 
SqlBaseBaseVisitor[AnyRef] with Logging
       case ("smallint" | "short", Nil) => ShortType
       case ("int" | "integer", Nil) => IntegerType
       case ("bigint" | "long", Nil) => LongType
-      case ("float", Nil) => FloatType
+      case ("float" | "real", Nil) => FloatType
 
 Review comment:
   I take a look at SQL standard, float and real are different
   ```
   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.
   
   REAL specifies the data type approximate numeric, with 
implementation-defined precision.
   ```
   
   We can say that now Spark supports real type, and its precision is the same 
as java float. But it needs to be proposed explicitly, e.g. send an email to 
dev list.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to