Ngone51 commented on a change in pull request #26472: [SPARK-29838][SQL]
PostgreSQL dialect: cast to timestamp
URL: https://github.com/apache/spark/pull/26472#discussion_r348887939
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/postgreSQL/PostgreCastBase.scala
##########
@@ -68,16 +91,47 @@ case class PostgreCastToBoolean(child: Expression,
timeZoneId: Option[String])
throw new IllegalArgumentException("invalid input syntax for type
boolean: $c");
}
"""
-
case IntegerType =>
super.castToBooleanCode(from)
}
+}
- override def dataType: DataType = BooleanType
+case class PostgreCastToTimestamp(child: Expression, timeZoneId:
Option[String])
Review comment:
I think we can and should combine them into a single one(both rule and
expression) when more types get in. Just like the original `Cast` does. But I'm
not sure where shall we start. Maybe, this one ?
----------------------------------------------------------------
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]