Skip to main content
Version: v1.1.0


Aggregate Function

fuse compute a fused type of input values


fuse(any) -> type


The fuse aggregate function applies type fusion to its input and returns the fused type.

This aggregation is useful with group-by for data exploration and discovery
when searching for shaping rules to cluster a large number of varied input types to a smaller number of fused types each from a set of interrelated types.


Fuse two records:

echo '{a:1,b:2}{a:2,b:"foo"}' | zq -z 'fuse(this)' -



Fuse records with a group-by key:

echo '{a:1,b:"bar"}{a:2.1,b:"foo"}{a:3,b:"bar"}' | zq -z 'fuse(this) by b | sort' -