[英]Bigquery non-null(geographypoint) in grouped dataset
I need to pick non-null(geographypoint) from my grouped dataset.我需要从我的分组数据集中选择非空(地理点)。 The max function gives the following error.最大 function 给出以下错误。
MAX is not defined for arguments of type GEOGRAPHY at [65:11] MAX 未在 [65:11] 处为 GEOGRAPHY 类型的 arguments 定义
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.我需要从分组数据中挑选出非 null 值。 For numeric/string values, we can use max
Is there a way to tackle this for Geography data in bigquery?对于数字/字符串值,我们可以使用max
有没有办法在 bigquery 中为地理数据解决这个问题?
I need to pick out the non null value from the grouped data我需要从分组数据中挑选出非 null 值
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. MAX 对于空间类型没有意义,因为它们不是简单的值。 I think you need to use the Geography functions and either我认为您需要使用Geography 函数,或者
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.