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_r346870158
##########
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 want to gather more information about these before sending an email to
discuss.
1. postgresql
https://www.postgresql.org/docs/9.3/datatype-numeric.html
Name | Storage Size | Description | Range
-- | -- | -- | --
decimal | variable | user-specified precision, exact | up to 131072 digits
before the decimal point; up to 16383 digits after the decimal point
numeric | variable | user-specified precision, exact | up to 131072 digits
before the decimal point; up to 16383 digits after the decimal point
real | 4 bytes | variable-precision, inexact | 6 decimal digits precision
double precision | 8 bytes | variable-precision, inexact | 15 decimal digits
precision
> The types decimal and numeric are equivalent. Both types are part of the
SQL standard.
----------------------------------------------------------------
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]