我有一个配置单元表包含类型为的列 array 以及 map 我想过滤数组/Map列包含n个以上元素的记录,怎么做?ddl地址:
array
map
create table test (id string, v1 array<int>, v2 map<string,string>)
查询:
select * from test where length(v1)>10 or length(v2)>10
imzjd6km1#
select * from test where size(v1)>10 or size(v2)>10
演示
create table test (id string, v1 array<int>, v2 map<string,string>); insert into test select 1,array(1,2,3,4,5),map('K1','V1','K2','V2','K3','V3');
select size(v1),size(v2) from test ;
+----+----+ | c0 | c1 | +----+----+ | 5 | 3 | +----+----+
1条答案
按热度按时间imzjd6km1#
演示