SELECT
Define output fields by completely replacing the current field set.
Syntax
SELECT assignmentClause [, assignmentClause]* [,]?
Parameters
- assignmentClause - Either a simple expression or an assignment (
identifier = expression)
Description
The SELECT command completely redefines the field structure of the dataset,
replacing all existing fields with only those you explicitly specify. Unlike
SET, which adds or modifies fields while preserving others, SELECT gives
you complete control over the output schema.
Each assignmentClause can be either a simple expression (which preserves
the original field name when referencing a field) or an assignment that
creates a new field with a specified name. When you use assignment syntax,
the identifier becomes the field name and the expression provides the value.
When you don't use assignment syntax, Hamelin automatically generates field
names based on the expression (see Automatic Field Names
for details).
The SELECT command evaluates expressions against the current row context.
You can reference any fields available at that point in the pipeline,
including original dataset fields, fields created by previous SET commands,
and fields from joined datasets.
Related Commands
- SET - Add or modify fields while preserving others