cloud-fan commented on code in PR #52270: URL: https://github.com/apache/spark/pull/52270#discussion_r2333749494
########## sql/connect/common/src/main/scala/org/apache/spark/sql/connect/common/LiteralValueProtoConverter.scala: ########## @@ -434,11 +434,18 @@ object LiteralValueProtoConverter { case proto.DataType.KindCase.BOOLEAN => v => v.getBoolean case proto.DataType.KindCase.STRING => v => v.getString case proto.DataType.KindCase.BINARY => v => v.getBinary.toByteArray - case proto.DataType.KindCase.DATE => v => v.getDate - case proto.DataType.KindCase.TIMESTAMP => v => v.getTimestamp - case proto.DataType.KindCase.TIMESTAMP_NTZ => v => v.getTimestampNtz - case proto.DataType.KindCase.DAY_TIME_INTERVAL => v => v.getDayTimeInterval - case proto.DataType.KindCase.YEAR_MONTH_INTERVAL => v => v.getYearMonthInterval + case proto.DataType.KindCase.DATE => + v => SparkDateTimeUtils.toJavaDate(v.getDate) Review Comment: I need a bit more context to understand it better. So at the client side, `fn.typedLit` takes java classes like `LocalDate`, and convert it to int before putting it into the protobuf message. At the server side, `v.getDate` returns int and we need to convert it back to the `LocalDate`. This looks a bit messy to me. If the client side already knows how to convert external java objects to internal catalyst values, why does server need this conversion? -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org