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_r347093144
##########
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:
The below notes from SQL standard might have some information to help us
whether or not to involve real or numeric
> An SQL-implementation is permitted to regard certain <exact numeric type>s
as equivalent, if they have the
same precision, scale, and radix, as permitted by the Syntax Rules of
Subclause 6.1, “<data type>”. When two
or more <exact numeric type>s are equivalent, the SQL-implementation chooses
one of these equivalent <exact
numeric type>s as the normal form representing that equivalence class of
<exact numeric type>s. The normal
form determines the name of the exact numeric type in the numeric type
descriptor.
Similarly, an SQL-implementation is permitted to regard certain <approximate
numeric type>s as equivalent,
as permitted by the Syntax Rules of Subclause 6.1, “<data type>”, in which
case the SQL-implementation
chooses a normal form to represent each equivalence class of <approximate
numeric type> and the normal
form determines the name of the approximate numeric 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]