STRUCT 类型的列属性不能在 SELECT DISTINCT 中使用
Column attributes of type STRUCT cannot be used in SELECT DISTINCT
我有这个sql声明
Select distinct _data.attributes from rd-bigdata-lake-prd.lake_gcs.xyz
我收到这个错误
400 Column attributes of type STRUCT cannot be used in SELECT DISTINCT
_data.attributes的值为
{"url":"/services/data/v52.0/sobjects/Message/123456789","type":"Message"}
如何更改 sql 语句,字段 _data.attributes 可读且 select 不同?
我试图将 _data.attributes 转换为字符串。但是没用。
使用 to_json
将结构转换为字符串
select distinct
to_json(_data.attributes)
from rd-bigdata-lake-prd.lake_gcs.xyz
我有这个sql声明
Select distinct _data.attributes from rd-bigdata-lake-prd.lake_gcs.xyz
我收到这个错误
400 Column attributes of type STRUCT cannot be used in SELECT DISTINCT
_data.attributes的值为
{"url":"/services/data/v52.0/sobjects/Message/123456789","type":"Message"}
如何更改 sql 语句,字段 _data.attributes 可读且 select 不同? 我试图将 _data.attributes 转换为字符串。但是没用。
使用 to_json
将结构转换为字符串select distinct
to_json(_data.attributes)
from rd-bigdata-lake-prd.lake_gcs.xyz