maropu commented on a change in pull request #20176:
URL: https://github.com/apache/spark/pull/20176#discussion_r462636447
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
##########
@@ -259,6 +259,29 @@ case class Cast(child: Expression, dataType: DataType,
timeZoneId: Option[String
builder.append("]")
builder.build()
})
+ case StructType(fields) =>
+ buildCast[InternalRow](_, row => {
+ val builder = new UTF8StringBuilder
+ builder.append("[")
Review comment:
I think we have no strong reason. In this PR, I just followed the
existing format. Looks like we can change it to `{` for consistency. cc:
@cloud-fan
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
##########
@@ -259,6 +259,29 @@ case class Cast(child: Expression, dataType: DataType,
timeZoneId: Option[String
builder.append("]")
builder.build()
})
+ case StructType(fields) =>
+ buildCast[InternalRow](_, row => {
+ val builder = new UTF8StringBuilder
+ builder.append("[")
Review comment:
I think we have no strong reason. In this PR, I just followed the
existing format. Looks like we can change it to `{` for consistency (But, we
might need to update the migration doc cuz it change the casting behaivour).
cc: @cloud-fan
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]