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 declaratively
  • EXTERNAL_SQL(): Map features to custom SQL queries for complex preprocessing
  • BIND_KEYSET(): Define entity populations as inputs to your FeatureQL queries

Analytics operations:

  • Grouping & aggregation: GROUP BY with standard SQL aggregation functions
  • Unnesting: UNNEST() arrays for rows as a table for final presentation
  • Filtering & sorting: WHERE, ORDER BY, LIMIT, OFFSET clauses

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.

Last update at: 2025/12/05 16:03:14
Last updated: 2025-12-05 16:07:55