Create a feature group

Afeature groupis aFeature Registryresource that's associated with a BigQuery table or view containingyour feature data. A feature group can contain multiplefeatures, whereeach feature is associated with a column in the feature data source. If you wantto register your feature data source in the Feature Registry, create afeature group and thenadd features to it.

After you create a feature group and associate the BigQuery datasource, you cancreate features associatedwith the columns in the data source. Note that although it's optional toassociate a data source while creating a feature group, you must associatea BigQuery table or view before you create features within thatfeature group. Each feature corresponds to a column in the data sourceassociated with the feature group.

Why use feature groups and features?

Registering your feature data source is optional. However, you mustregister your feature data by creating feature groups and featuresin the following scenarios:

When not to use feature groups and features

If you want toserve embeddingsfrom your feature data source, then don't register the data source by creatingfeature groups and features. In this scenario, you must set up online serving bydirectly associating the BigQuery table or view with your featureviews.

For more information about setting up online serving without registering yourfeature data source, seeCreate a feature view from a BigQuery source.

Control access

You can control access for a feature group at the following levels:

Before you begin

Before you create a feature group, complete the following prerequisites:

Create a feature group to register a feature data source

Use the following samples to create a feature group and associate afeature data source, such as a BigQuery table or view.

Console

Important: You can't create a feature group with a dedicated service account from the Google Cloud console. To create a feature group with a dedicated service account, use the REST API or the Vertex AI SDK for Python.

Use the following instructions to create a feature group using the Google Cloud console:

  1. In the Vertex AI section of the Google Cloud console, go to theFeature Store page.

    Go to the Feature Store page

  2. In theFeature groups section, clickCreate to open theBasic info pane on theCreate Feature Group page.

  3. Specify theFeature group name.

  4. Optional: To add labels, clickAdd label, and specify the label name and value. You can add multiple labels to a feature group.

  5. In theBigQuery path field, clickBrowse to select BigQuery source table or view to associate with the feature group.

  6. In theEntity ID column list, select the entity ID columnsfrom the BigQuery source table or view.

    Note that this is optional if the BigQuery source table or viewhas a column namedentity_id. In that case, if you don't select an entityID column, the feature group uses theentity_id column as the defaultentity ID column.

  7. ClickContinue.

  8. In theRegister pane, click one of the following options to indicate whether you want to add features to the new feature group:

    • Include all columns from the BigQuery table—Create features within the feature group for all the columns in the BigQuery source table or view.

    • Manually enter your features—Create features based on specific columns in the BigQuery source. For each feature, enter aFeature name and click the corresponding BigQuery source column name in the list.

      To add more features, clickAdd another feature.

    • Create an empty feature group—Create the feature group without adding features to it.

  9. ClickCreate.

Python

To learn how to install or update the Vertex AI SDK for Python, seeInstall the Vertex AI SDK for Python. For more information, see thePython API reference documentation.

Note: This sample creates a feature group with the default service accountconfiguration.
fromgoogle.cloudimportaiplatformfromvertexai.resources.previewimportfeature_storefromtypingimportListdefcreate_feature_group_sample(project:str,location:str,feature_group_id:str,bq_table_uri:str,entity_id_columns:List[str],):aiplatform.init(project=project,location=location)fg=feature_store.FeatureGroup.create(name=feature_group_id,source=feature_store.utils.FeatureGroupBigQuerySource(uri=bq_table_uri,entity_id_columns=entity_id_columns),)returnfg
  • project: Your project ID.
  • location: Region where you want to create the feature group, such asus-central1.
  • feature_group_id: The name of the new feature group that you want to create.
  • bq_table_uri: URI of the BigQuery source table or view that you want to register for the feature group.
  • entity_id_columns: The names of the columns containing the entity IDs. You can specify either one column or multiple columns.
    • To specify only one entity ID column, specify the column name in the following format:
      "entity_id_column_name".
    • To specify multiple entity ID columns, specify the column names in the following format:
      ["entity_id_column_1_name", "entity_id_column_2_name", ...].

REST

To create aFeatureGroupresource, send aPOST request by using thefeatureGroups.createmethod.

Before using any of the request data, make the following replacements:

HTTP method and URL:

POST https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups?feature_group_id=FEATUREGROUP_NAME

Request JSON body:

{  "service_agent_type": "SERVICE_AGENT_TYPE",  "big_query": {    "entity_id_columns": "ENTITY_ID_COLUMNS",    "big_query_source": {      "input_uri": "BIGQUERY_SOURCE_URI",    }    "time_series": {      "timestamp_column": ""TIMESTAMP_COLUMN"",    },    "static_data_source":STATIC_DATA_SOURCE,    "dense":DENSE  }}

To send your request, choose one of these options:

curl

Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list.

Save the request body in a file namedrequest.json, and execute the following command:

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups?feature_group_id=FEATUREGROUP_NAME"

PowerShell

Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list.

Save the request body in a file namedrequest.json, and execute the following command:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups?feature_group_id=FEATUREGROUP_NAME" | Select-Object -Expand Content

You should receive a JSON response similar to the following:

{  "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/featureGroups/FEATUREGROUP_NAME/operations/OPERATION_ID",  "metadata": {    "@type": "type.googleapis.com/google.cloud.aiplatform.v1.UpdateFeatureGroupOperationMetadata",    "genericMetadata": {      "createTime": "2023-09-18T03:00:13.060636Z",      "updateTime": "2023-09-18T03:00:13.060636Z"    }  }}

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-18 UTC.