Github user cloud-fan commented on a diff in the pull request: https://github.com/apache/spark/pull/20306#discussion_r162262394 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala --- @@ -838,6 +839,7 @@ case class Cast(child: Expression, dataType: DataType, timeZoneId: Option[String |$evPrim = $buffer.build(); """.stripMargin } + case pudt: PythonUserDefinedType => castToStringCode(pudt.sqlType, ctx) --- End diff -- This reminds me one thing: how shall we cast a UDT to string? Shall we just strip the UDT and cast the data as it's a catalyst value? or deserialize the catalyst value to customer object and call `toString`? Note that `Dataset.show` should definitely call customer object's `toString`, but I think cast is different as it's an SQL operation.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org