Github user dongjoon-hyun commented on a diff in the pull request:
https://github.com/apache/spark/pull/20887#discussion_r176604372
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
---
@@ -1152,7 +1152,18 @@ class AstBuilder(conf: SQLConf) extends
SqlBaseBaseVisitor[AnyRef] with Logging
* Create a [[Cast]] expression.
*/
override def visitCast(ctx: CastContext): Expression = withOrigin(ctx) {
- Cast(expression(ctx.expression), visitSparkDataType(ctx.dataType))
+ typedVisit[DataType](ctx.dataType) match {
+ case t: CharType =>
+ validate(t.length > 0, s"Char length ${t.length} is out of range
[1, 255]", ctx)
--- End diff --
This one and line 1161 is the same error message with Hive.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]