Skip to content

Commit

Permalink
fix snowflake UDF
Browse files Browse the repository at this point in the history
  • Loading branch information
prantogg committed Dec 18, 2024
1 parent 55d7064 commit 5125a32
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,20 @@ public static double ST_Angle(byte[] geom1, byte[] geom2) {
}

@UDFAnnotations.ParamMeta(argNames = {"geom"})
public static Geometry ST_LabelPoint(byte[] geom) {
return Functions.labelPoint(GeometrySerde.deserialize(geom));
public static byte[] ST_LabelPoint(byte[] geom) {
return GeometrySerde.serialize(Functions.labelPoint(GeometrySerde.deserialize(geom)));
}

@UDFAnnotations.ParamMeta(argNames = {"geom", "gridResolution"})
public static Geometry ST_LabelPoint(byte[] geom, int gridResolution) {
return Functions.labelPoint(GeometrySerde.deserialize(geom), gridResolution);
public static byte[] ST_LabelPoint(byte[] geom, int gridResolution) {
return GeometrySerde.serialize(
Functions.labelPoint(GeometrySerde.deserialize(geom), gridResolution));
}

@UDFAnnotations.ParamMeta(argNames = {"geom", "gridResolution", "goodnessThreshold"})
public static Geometry ST_LabelPoint(byte[] geom, int gridResolution, double goodnessThreshold) {
return Functions.labelPoint(GeometrySerde.deserialize(geom), gridResolution, goodnessThreshold);
public static byte[] ST_LabelPoint(byte[] geom, int gridResolution, double goodnessThreshold) {
return GeometrySerde.serialize(
Functions.labelPoint(GeometrySerde.deserialize(geom), gridResolution, goodnessThreshold));
}

@UDFAnnotations.ParamMeta(argNames = {"geom1", "geom2", "geom3"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,24 @@ public static String ST_Affine(
@UDFAnnotations.ParamMeta(
argNames = {"geom"},
argTypes = {"Geometry"})
public static Geometry ST_LabelPoint(String geom) {
return Functions.labelPoint(GeometrySerde.deserGeoJson(geom));
public static String ST_LabelPoint(String geom) {
return GeometrySerde.serGeoJson(Functions.labelPoint(GeometrySerde.deserGeoJson(geom)));
}

@UDFAnnotations.ParamMeta(
argNames = {"geom", "gridResolution"},
argTypes = {"Geometry", "double"})
public static Geometry ST_LabelPoint(String geom, int gridResolution) {
return Functions.labelPoint(GeometrySerde.deserGeoJson(geom), gridResolution);
public static String ST_LabelPoint(String geom, int gridResolution) {
return GeometrySerde.serGeoJson(
Functions.labelPoint(GeometrySerde.deserGeoJson(geom), gridResolution));
}

@UDFAnnotations.ParamMeta(
argNames = {"geom", "gridResolution", "goodnessThreshold"},
argTypes = {"Geometry", "double", "double"})
public static Geometry ST_LabelPoint(String geom, int gridResolution, double goodnessThreshold) {
return Functions.labelPoint(
GeometrySerde.deserGeoJson(geom), gridResolution, goodnessThreshold);
public static String ST_LabelPoint(String geom, int gridResolution, double goodnessThreshold) {
return GeometrySerde.serGeoJson(
Functions.labelPoint(GeometrySerde.deserGeoJson(geom), gridResolution, goodnessThreshold));
}

@UDFAnnotations.ParamMeta(
Expand Down

0 comments on commit 5125a32

Please sign in to comment.