jiayuasu commented on code in PR #2073:
URL: https://github.com/apache/sedona/pull/2073#discussion_r2193630836
##########
spark/common/src/main/scala/org/apache/sedona/python/wrapper/utils/implicits.scala:
##########
@@ -50,10 +50,13 @@ object implicits {
def userDataToUtf8ByteArray: Array[Byte] = {
geometry.getUserData match {
+ // Case when user data is null: return an empty UTF-8 byte array
case null => EMPTY_STRING.getBytes(StandardCharsets.UTF_8)
+ // Case when user data is a String: convert the string to a UTF-8 byte
array
case data: String => data.getBytes(StandardCharsets.UTF_8)
+ // Case for any other type: convert to string, then to a UTF-8 byte
array
+ case data => data.toString.getBytes(StandardCharsets.UTF_8)
Review Comment:
Why convert it to string? I believe this will lose the types of data in
`UserData` field.
--
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]