ProjectionNode Class

Add aggregate functions to the query, or define an alias.

Namespace

wave

Usage

Refer to the QueryBuilder example.

ProjectionNode Methods

The following are methods for ProjectionNode.

  • sum()
    Returns the sum of a numeric field.
  • avg()
    Returns the average value of a numeric field.
  • min()
    Returns the minimum value of a field.
  • max()
    Returns the maximum value of a field.
  • count()
    Returns the number of rows that match the query criteria.
  • unique()
    Returns the count of unique values.
  • alias(name)
    Define output column names.

sum()

Returns the sum of a numeric field.

Signature

public wave.ProjectionNode sum()

Return Value

Type: wave.ProjectionNode

avg()

Returns the average value of a numeric field.

Signature

public wave.ProjectionNode avg()

Return Value

Type: wave.ProjectionNode

min()

Returns the minimum value of a field.

Signature

public wave.ProjectionNode min()

Return Value

Type: wave.ProjectionNode

max()

Returns the maximum value of a field.

Signature

public wave.ProjectionNode max()

Return Value

Type: wave.ProjectionNode

count()

Returns the number of rows that match the query criteria.

Signature

public wave.ProjectionNode count()

Return Value

Type: wave.ProjectionNode

unique()

Returns the count of unique values.

Signature

public wave.ProjectionNode unique()

Return Value

Type: wave.ProjectionNode

alias(name)

Define output column names.

Signature

public wave.ProjectionNode alias(String name)

Parameters

name
Type: String
The name to use for this column. For example, this code defines the alias c:
Wave.ProjectionNode[] projs = new Wave.ProjectionNode[]{Wave.QueryBuilder.count().alias('c')};

Return Value

Type: wave.ProjectionNode