amaliujia commented on code in PR #38970:
URL: https://github.com/apache/spark/pull/38970#discussion_r1042809371
##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -518,9 +518,16 @@ class SparkConnectPlanner(session: SparkSession) {
}
private def transformCast(cast: proto.Expression.Cast): Expression = {
- Cast(
- transformExpression(cast.getExpr),
- DataTypeProtoConverter.toCatalystType(cast.getCastToType))
+ cast.getCastToTypeCase match {
+ case proto.Expression.Cast.CastToTypeCase.TYPE =>
+ Cast(
+ transformExpression(cast.getExpr),
+ DataTypeProtoConverter.toCatalystType(cast.getType))
+ case _ =>
+ Cast(
+ transformExpression(cast.getExpr),
+ session.sessionState.sqlParser.parseDataType(cast.getTypeStr))
Review Comment:
I am not following this? Can you give some example proto/sample code?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]