Why can not UDF be used in Where
?
select * from user_by_location
where distanceOf(latlng.lat,latlng.lng,42.15444,34.58511) > 1;
SyntaxException: line 1:47 no viable alternative at input '(' (
select * from user_by_location where [distanceOf](...)
You cannot use UDFs in where clauses (to filter queries).
The feature request to allow this is here if you'd like to follow it. To summarize, it requires rearranging some major parts of code and could result in slow performance and/or stale data.
(By the way, it looks like you're trying to work with geospatial data, so you might find it helpful to look into how to handle that with Spark or DSE.)