amaliujia commented on code in PR #39084:
URL: https://github.com/apache/spark/pull/39084#discussion_r1051076834
##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -270,6 +271,24 @@ class SparkConnectPlanner(session: SparkSession) {
.logicalPlan
}
+ private def transformToSchema(rel: proto.ToSchema): LogicalPlan = {
+ val schemaType = if (rel.hasDatatype) {
+ DataTypeProtoConverter.toCatalystType(rel.getDatatype)
+ } else {
+ parseDatatypeString(rel.getDatatypeStr)
+ }
+
+ val schemaStruct = schemaType match {
+ case s: StructType => s
+ case d => StructType(Seq(StructField("value", d)))
Review Comment:
so it is not guaranteed that the client side always sends a StructType as
schema when it is not a string?
--
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]