Newer Version Available
QueryBuilder Class
Namespace
wave
Usage
Use QueryBuilder and its associated classes, Wave.ProjectionNode and Wave.QueryNode, to incrementally build your SAQL statement. For example:
Examples
QueryBuilder is the core of this first phase of the Wave Apex SDK, so let’s take a closer look. Here’s a simple count query.
The resulting SAQL query looks like this:
Here’s a more complex example that uses a union statement.
The resulting SAQL query has two projection streams, qa and qb.
QueryBuilder Methods
The following are methods for QueryBuilder.
load(datasetID, datasetVersionID)
Signature
public static wave.QueryNode load(String datasetID, String datasetVersionID)
Parameters
Return Value
Type: wave.QueryNode
get(projection)
Signature
public static wave.ProjectionNode get(String proj)
Parameters
- proj
- Type: String
- The name of the column to query.
Return Value
Type: wave.ProjectionNode
union(unionNodes)
Signature
global static Wave.QueryNode union(List<Wave.QueryNode> unionNodes)
Parameters
- unionNodes
- Type: List<wave.QueryNode>
- List of nodes to combine.
Return Value
Type: wave.QueryNode
cogroup(cogroupNodes, groups)
Signature
global static Wave.QueryNode cogroup(List<Wave.QueryNode> cogroupNodes, List<List<String>> groups)
Parameters
- cogroupNodes
- Type: wave.QueryNode
- List of nodes to group.
- groups
- Type: String
- The type of grouping.
Return Value
Type: wave.QueryNode