Querying geopoints

hey! i have a question about geolocation functions: in cases like mongodb, you can’t do field mappings. When you get coordinates, you’ll have to run these functions (i.e., ST_GEOPOINT) at runtime. If I have something like this:

– get the distance between 2 buildings
SELECT price, ST_DISTANCE(
ST_GEOGPOINT(-122.4938, 37.4958),
ST_GEOGPOINT(TRY_CAST(longitude as float), TRY_CAST(latitude as float))
) distance
FROM commons.houseDistance
where ST_DISTANCE(
ST_GEOGPOINT(-122.4938, 37.4958),
ST_GEOGPOINT(TRY_CAST(longitude as float), TRY_CAST(latitude as float))
) is not null and airbnbData2.review_scores_checkin = 10order by
ST_DISTANCE(
ST_GEOGPOINT(-122.4938, 37.4958),
ST_GEOGPOINT(TRY_CAST(longitude as float), TRY_CAST(latitude as float))
)
;

will it still work as expected? or do we need to do field mappings for this function to work?

HI @karenshi !

Totally, in short, the functions should work as expected. The field mappings effect how the data is indexed.

Best,
n