I need to pick non-null(geographypoint) from my grouped dataset. The max function gives the following error.
MAX is not defined for arguments of type GEOGRAPHY at [65:11]
Consider the sample data:
╔════════════════════╦══════════════════════════════╗
║id ║Point ║
╠════════════════════╬══════════════════════════════╣
║1 ║POINT(-79.3123031 43.6839641) ║
║1 ║null ║
╚════════════════════╩══════════════════════════════╝
I need to pick out the non null value from the grouped data. For numeric/string values, we can use max
Is there a way to tackle this for Geography data in bigquery?
I need to pick out the non null value from the grouped data
Consider below approach
select id, any_value(point) point
from data
where not point is null
group by id
MAX is not meaningful for spatial types because they are not simple values. I think you need to use the Geography functions and either
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.