Release Notes September 8, 2023

No updates for this week.

OPAL Language Updates

nullsfirst

Description

Specify the ordering as nulls first when processing data. This is used by ordered windowing functions (like lag and last), ordered aggregation functions (like array_agg) and the sort verb.

Return type

ordering

Domain

This is a scalar function since it calculates a single output value for a single input row.

Categories

Usage

nullsfirst( columnname )

Argument

Type

Required

Multiple

columnname

ordering

Required

Only one

Examples

sort nullsfirst(foo)

Sort the dataset with nulls first in column foo.

statsby list:array_agg(username, asc(nullsfirst(timestamp))), group_by(hostname)

Lists all users for each host, in order of ascending timestamp with nulls first within each host assuming you have a table with columns timestamp, hostname, and username.

nullslast

Description

Specify the ordering as nulls last when processing data. This is used by ordered windowing functions (like lag and last), ordered aggregation functions (like array_agg) and the sort verb.

Return type

ordering

Domain

This is a scalar function since it calculates a single output value for a single input row.

Categories

Usage

nullslast( columnname )

Argument

Type

Required

Multiple

columnname

ordering

Required

Only one

Examples

sort nullslast(desc(foo))

Sort the dataset in with nulls appearing last in descending order by values in column foo.

statsby list:array_agg(username, nullslast(timestamp)), group_by(hostname)

Lists all users for each host, in order of ascending timestamp (default ordering) with nulls appearing last within each host assuming you have a table with columns timestamp, hostname and username.