QueryNode Class
Define each node of the query - such as projection, groups, order, filters. Execute the query.
wave
Refer to the QueryBuilder example.
The following are methods for QueryNode.
-
Build the query string represented by this QueryNode and assign it to a stream name.
-
Applies a set of expressions to every row in a dataset. This action is often referred to as projection.
-
Groups matched records (group by specific dataset attributes).
-
Groups matched records (group by all).
-
Sorts in ascending or descending order on one or more fields.
-
Limits the number of results that are returned.
-
Selects rows from a dataset based on a filter condition (a predicate).
-
Selects rows from a dataset based on multiple filter conditions (predicates).
-
Execute the query and return rows as JSON.
Build the query string represented by this QueryNode and assign it to a stream name.
public String build(String streamName)
-
streamName:
Type: String
The identifier for the stream - for example, “q”.
Type: String
The SAQL query string represented by the QueryNode.
Applies a set of expressions to every row in a dataset. This action is often referred to as projection.
public wave.QueryNode foreach(List<wave.ProjectionNode> projections)
-
projections:
Type: List<wave.ProjectionNode>
A list of ProjectionNodes to be added to this QueryNode.
Type: wave.QueryNode
Groups matched records (group by specific dataset attributes).
public wave.QueryNode group(List<String> groups)
-
groups:
Type: List<String>
A list of expressions.
Type: wave.QueryNode
Groups matched records (group by all).
public wave.QueryNode group()
Type: wave.QueryNode
Sorts in ascending or descending order on one or more fields.
public wave.QueryNode order(List<List<String>> orders)
-
orders: Type: List<List<String>> A list of column names and associated ascending or descending keywords, for example
Type: wave.QueryNode
Limits the number of results that are returned.
global Wave.QueryNode cap(Integer cap)
-
cap:
Type: Integer
The maximum number of rows to return.
Type: wave.QueryNode
Selects rows from a dataset based on a filter condition (a predicate).
public wave.QueryNode filter(String filterCondition)
-
filterCondition:
Type: String
For example:
filter('Name != \'My Name\'')
Type: wave.QueryNode
Selects rows from a dataset based on multiple filter conditions (predicates).
public wave.QueryNode filter(List<String> filterCondition)
-
filterCondition:
Type: List<String>
A list of filter conditions.
Type: wave.QueryNode
Execute the query and return rows as JSON.
global ConnectApi.LiteralJson execute(String streamName)
-
streamName:
Type: String
The query stream to execute. For example:
Type: ConnectApi.LiteralJson