Analytics context
Batch analytics in FeatureQL enables large-scale feature computation across entity populations. This section covers the tools for connecting to external data sources and processing features at scale.
Key capabilities
Data source integration:
EXTERNAL_COLUMNS(): Map features to table columns declarativelyEXTERNAL_SQL(): Map features to custom SQL queries for complex preprocessingBIND_KEYSET(): Define entity populations as inputs to your FeatureQL queries
Analytics operations:
- Grouping & aggregation:
GROUP BYwith standard SQL aggregation functions - Unnesting:
UNNEST()arrays for rows as a table for final presentation - Filtering & sorting:
WHERE,ORDER BY,LIMIT,OFFSETclauses
Hybrid queries:
- Embed FeatureQL within SQL for seamless integration with existing analytics tools
- Use FeatureQL as CTEs or subqueries in standard SQL workflows
Query structure
WITH
[feature definitions]
SELECT
[features to compute]
FOR
[bind entity keys]
WHERE [filter]
GROUP BY [aggregate]
ORDER BY [sort]
LIMIT [rows] sql
Note: Analytics clauses (WHERE, GROUP BY, ORDER BY, LIMIT) work only in evaluation queries, not in CREATE FEATURES statements.
On this page