Description
Currently, Spark SQL defines literal constructors as:
| identifier stringLit #typeConstructor
where identifier is parsed later by visitTypeConstructor():
valueType match { case "DATE" => val zoneId = getZoneId(conf.sessionLocalTimeZone) val specialDate = convertSpecialDate(value, zoneId).map(Literal(_, DateType)) specialDate.getOrElse(toLiteral(stringToDate, DateType)) case "TIMESTAMP_NTZ" => ...
So, the literal constructors are not Spark SQL keywords, and this causes some inconveniences while analysing/transforming the lexer tree. For example, while forming the stable column aliases.
Need to define literal constructors in SqlBaseParser.g4.
Attachments
Issue Links
- is a clone of
-
SPARK-42873 Define Spark SQL types as keywords
- Resolved