yaooqinn 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_r347094308
 
 

 ##########
 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:
   > 25) For the exact numeric types DECIMAL and NUMERIC:
   a) The maximum value of precision is implementation-defined. precision shall 
not be greater than this value.
   b) The maximum value of scale is implementation-defined. scale shall not be 
greater than this maximum value.
   > 26) NUMERIC specifies the data type exact numeric, with the decimal 
precision and scale specified by the precision and scale.
   > 27) DECIMAL specifies the data type exact numeric, with the decimal scale 
specified by the scale and the implementation-defined decimal precision equal 
to or greater than the value of the specified precision.
   
   I don't know why 26th - NUMERIC and 27th - DECIMAL have different 
definitions, but IIUC with restraint of the 25th, they are even, both with 
`implementation-defined` precision and scale, the user-specified ones can not 
be greater than these.

----------------------------------------------------------------
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