radekaadek commented on PR #2452:
URL: https://github.com/apache/sedona/pull/2452#issuecomment-3448691642
I have been looking through the code and it seems to me that either there
was a mistake or I'm missing something because all of the functions in
`flink/src/main/java/org/apache/sedona/flink/expressions/Functions.java` have
this:
` @DataTypeHint(value = "RAW", bridgedTo =
org.locationtech.jts.geom.Geometry.class)`
For example:
```
public static class ST_Centroid extends ScalarFunction {
@DataTypeHint(value = "RAW", bridgedTo =
org.locationtech.jts.geom.Geometry.class)
public Geometry eval(
@DataTypeHint(value = "RAW", bridgedTo =
org.locationtech.jts.geom.Geometry.class)
Object o) {
Geometry geom = (Geometry) o;
return org.apache.sedona.common.Functions.getCentroid(geom);
}
}
```
The documentation of this `DataTypeHint` states that this way of defining
hints leads to using the Flink's default serializer:
```
* <p>{@code @DataTypeHint(value = "RAW", bridgedTo = MyCustomClass.class)}
defines a RAW data type
* with Flink's default serializer for class {@code MyCustomClass}.
```
Making the functions use custom serializers requires passing a
`rawSerializer`:
```
* <p>{@code @DataTypeHint(value = "RAW", rawSerializer =
MyCustomSerializer.class)} defines a RAW
* data type with a custom serializer class.
```
What do you think about this @Imbruced?
--
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]