Skip to content

Instantly share code, notes, and snippets.

@KKcorps
Last active January 3, 2023 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KKcorps/feb3cf53b2fdcd2001fd1ab2d98e1655 to your computer and use it in GitHub Desktop.
Save KKcorps/feb3cf53b2fdcd2001fd1ab2d98e1655 to your computer and use it in GitHub Desktop.
package org.apache.pinot.custom.function;
import com.github.davidmoten.geo.GeoHash;
import org.apache.pinot.spi.annotations.ScalarFunction;
public class CustomScalarFunctions {
@ScalarFunction(names = {"encode_geohash"})
public static String latLngToGeo(Double latitude, Double longitude, Integer geoLength) {
return GeoHash.encodeHash(latitude, longitude, geoLength);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment