Skip to main content
Version: v1.16.0

shape

Function

shape apply cast, fill, and order

Synopsis

shape(val: any, t: type) -> any

Description

The shape function applies the cast, fill, and order functions to its input to provide an overall data shaping operation.

Note that shape does not perform a crop function so extra fields in the input are propagated to the output.

Examples

Shape input records

echo '{b:1,a:2}{a:3}{b:4,c:5}' | zq -z 'shape(this, <{a:int64,b:string}>)' -

produces

{a:2,b:"1"}
{a:3,b:null(string)}
{a:null(int64),b:"4",c:5}