我有一个 bigquery sql 命令,它以某种格式从数据库获取数据。我希望它处于物化视图中,但我收到以下错误
Incremental materialized views may not use the ARRAY function.
这是 SELECT SQL 命令
SELECT
'' as Status,
Country,
'US-Docketing' as Source,
customer_name as CustomerName,
customer_number as CustomerNumber,
client_number as ClientName,
ClientId,
application_number as `ApplicationNo`,
docket_queue_id as `DocketNo`,
attorney_docket_number as `AttorneyDocketNo`,
DateReceived as `ReceivedDate`,
ARRAY_AGG(
STRUCT(
document_details_unnest.DocumentCode,
document_details_unnest.Title,
document_details_unnest.JobDocumentId,
document_details_unnest.JobDocumentSourceId,
ARRAY(SELECT AS STRUCT
annotationaId,
display_name,
Value,
source
FROM UNNEST(document_details_unnest.annotations)) as annotations
)
) as DocumentDetails
FROM `PROJECT.POC.sample_mat_view`, UNNEST(document_details) as document_details_unnest
GROUP BY 1,2,3,4,5,6,7,8,9,10,11;
我也尝试了物化视图的非增量版本,但它的最短陈旧时间可能是 30 分钟。而且我似乎无法手动刷新它。
如果无法创建增量materializd视图,我如何更改SQL命令以在不使用ARRAY函数的情况下提供相同的模式。
如有任何帮助,我们将不胜感激。预先感谢。