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_r346904525
 
 

 ##########
 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:
   3. SQL Server
   
   
https://docs.microsoft.com/en-us/openspecs/standards_support/MS-STDSUPLP/17a32be7-10b3-4025-bea4-133a66b4c689
   
   #### Decimal
   
   > SQL Server 2008 R2 and SQL Server 2012 vary as follows:
   >> Transact-SQL partially supports this data type. The xs:decimal type 
represents arbitrary precision
   decimal numbers. Transact-SQL does not support variable precision decimals. 
Minimally conforming
   XML processors are required to support decimal numbers with a minimum of 
totalDigits=18. TransactSQL supports totalDigits=38, but limits the fractional 
digits to 10. All xs:decimal-instanced values are
   represented internally on the server by the SQL type numeric (38, 10).
   
   >> Values of this type need to comply with the format of the **SQL numeric 
type**. This type internally
   represents the support of numbers up to a total of 38 digits, with 10 of 
those digit positions reserved
   for fractional precision.
   
   ### Float
   > SQL Server 2008 R2 and SQL Server 2012 vary as follows:
   >> Transact-SQL partially supports this data type. Values of this type need 
to comply with the format of
   the **SQL real type**
   

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