Skip to content

select

Selects some values and discards the rest.

select (field|assignment)...

This operator keeps only the provided fields and drops the rest.

The field to keep. If it does not exist, it’s given the value null and a warning is emitted.

An assignment of the form <field>=<expr>.

Keep a and introduce y with the value of b:

from {a: 1, b: 2, c: 3}
select a, y=b
{a: 1, y: 2}

A more complex example with expressions and selection through records:

from {
name: "foo",
pos: {
x: 1,
y: 2,
},
state: "active",
}
select id=name.to_upper(), pos.x, added=true
{
id: "FOO",
pos: {
x: 1,
},
added: true,
}

drop, where