首页 > 解决方案 > 雪花视图:尝试从另一个表连接数据时超出最大 LOB 大小错误

问题描述

我对雪花很陌生,我有这个视图将一个大的子表与主表连接起来。我在这个过程中需要一个数组对象。但我越来越

“超出最大 LOB 大小 (16777216) 错误”

在尝试查询视图时。

有什么办法可以解决这个问题吗?

create or replace view SAMPLE_DB.SAMPLE_SCHEMA.V_VIEW as
  select
  cata.cat_key, sec.CAT_DATA
  from SAMPLE_DB.SAMPLE_SCHEMA.SAMPLE_ITEM  cata 

left join (select sec.cat_key,
              array_agg(OBJECT_CONSTRUCT(
                   'one_num', sec.one_num,
                   'two_num', sec.two_num)) CAT_DATA
                   from SAMPLE_DB.SAMPLE_SCHEMA.SEC_TABLE sec
                   group by sec.cat_key) pol on (cata.cat_key = sec.cat_key) ;

标签: sqlviewleft-joinsnowflake-cloud-data-platform

解决方案


请参考雪花社区 链接中的答案

 group by & aggregate on key where there might be no data.

推荐阅读