uros-db commented on code in PR #52491:
URL: https://github.com/apache/spark/pull/52491#discussion_r2405499327


##########
sql/api/src/main/scala/org/apache/spark/sql/types/DataType.scala:
##########
@@ -217,6 +221,14 @@ object DataType {
       case CHAR_TYPE(length) => CharType(length.toInt)
       case VARCHAR_TYPE(length) => VarcharType(length.toInt)
       case STRING_WITH_COLLATION(collation) => StringType(collation)
+      // If the coordinate reference system (CRS) value is omitted, Parquet 
and other storage
+      // formats (Delta, Iceberg) consider "OGC:CRS84" to be the default value 
of the crs.
+      case "geometry" => GeometryType(GeometryType.DEFAULT_STORAGE_CRS)
+      case GEOMETRY_TYPE(crs) => GeometryType(crs)
+      case "geography" => GeographyType(GeographyType.GEOGRAPHY_DEFAULT_CRS)
+      case GEOGRAPHY_TYPE_CRS(crs) => GeographyType(crs, 
GeographyType.GEOGRAPHY_DEFAULT_ALGORITHM)
+      case GEOGRAPHY_TYPE_ALG(alg) => 
GeographyType(GeographyType.GEOGRAPHY_DEFAULT_CRS, alg)

Review Comment:
   It's the latter. These changes are required for datatype representation in 
Spark, ensuring proper JSON serialization/deseralization for geospatial types 
according to storage specs.



-- 
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]

Reply via email to