Title: Materialization fails when field mappings are used to rename entity join keys (SnowflakeSource) · Issue #5942 · feast-dev/feast · GitHub
Open Graph Title: Materialization fails when field mappings are used to rename entity join keys (SnowflakeSource) · Issue #5942 · feast-dev/feast
X Title: Materialization fails when field mappings are used to rename entity join keys (SnowflakeSource) · Issue #5942 · feast-dev/feast
Description: Expected Behavior Features materialized to online store successfully, with features persisted on the online store using field_mapping values for the entity join key as names. Current Behavior Materialization fails before the offline stor...
Open Graph Description: Expected Behavior Features materialized to online store successfully, with features persisted on the online store using field_mapping values for the entity join key as names. Current Behavior Mater...
X Description: Expected Behavior Features materialized to online store successfully, with features persisted on the online store using field_mapping values for the entity join key as names. Current Behavior Mater...
Opengraph URL: https://github.com/feast-dev/feast/issues/5942
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Materialization fails when field mappings are used to rename entity join keys (SnowflakeSource)","articleBody":"## Expected Behavior \nFeatures materialized to online store successfully, with features persisted on the online store using `field_mapping` *values* for the entity join key as names.\n\n## Current Behavior\nMaterialization fails before the offline store is queried: `KeyError: Index(['USERID'], dtype='object')`\nOnly tested on `SnowflakeSource`\n\n## Steps to reproduce\nDefine a feature source as \n```sql\ncreate view schema_name.test as (\n select \n current_timestamp() as EVENT_TIMESTAMP,\n 1 as USERID,\n 0.75 as FEATURE_1,\n 300 as FEATURE_2\n);\n```\n\n```python\nuser = Entity(name=\"user\", join_keys=[\"user_id\"], value_type=ValueType.STRING)\n\nfeature_source = SnowflakeSource(\n table=\"TEST\",\n name=\"test_features\",\n timestamp_field=\"EVENT_TIMESTAMP\",\n database=dbname,\n schema=schema,\n field_mapping={\n \"USERID\": \"user_id\",\n \"FEATURE_1\": \"feature_1\",\n \"FEATURE_2\": \"feature_2\",\n },\n)\n\nfeature_view = FeatureView(\n name=\"test_feature_view\",\n entities=[user],\n schema=[\n Field(name=\"feature_1\", dtype=types.Float32),\n Field(name=\"feature_2\", dtype=types.Int32),\n ],\n online=True,\n source=feature_source,\n)\n```\n\n### Specifications\n\n- Version: 0.58.0\n- Platform: macOS\n- Subsystem: SQLite registry, SnowflakeSource\n\n## Inconsistencies\n\n* `get_historical_features` already works with the above configuration. Materialization not working in the same way causes inconsistent and confusing behavior.\n * Using `user_id` (field_mapping value) as an input to `get_historical_features`) The offline store is queried with \"USERID\" (field_mapping key), and the return value once again contains `user_id`. \n\n## Discussion\n\n`join_keys` arg when defining an `Entity` already provides a way to map offline store column names to feast registry field/key names, for entity keys. If this is considered the de facto way to manage source column names, than this issue can be closed. \n\nHowever I think its worth exploring. Having the renaming done at entity level means all tables in the offline store needs to use the same column name for that entity key. There might be cases where different teams refer to the same entity with different names, just because the business context is different. ","author":{"url":"https://github.com/emreakg","@type":"Person","name":"emreakg"},"datePublished":"2026-02-04T12:34:45.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/5942/feast/issues/5942"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0f23417f-18b3-6c06-8ee0-f9ec90566ce7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AAEC:162B2:6E8BDB3:9BB8AC8:6A500C43 |
| html-safe-nonce | efb321060991fc8bef65691ef3a8a82b7a2ab206b347192d81b8f6cc535b15c0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQUVDOjE2MkIyOjZFOEJEQjM6OUJCOEFDODo2QTUwMEM0MyIsInZpc2l0b3JfaWQiOiI0MTI0MjI4NDkxMDc1OTQzMDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7c3811026b93a04a27662ac6bba340214b52bbae0456f95f8df8b86b34f128fa |
| hovercard-subject-tag | issue:3896329875 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/feast-dev/feast/5942/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f88906a57f84160e3b27c58fc393394f969b1d59de355666e1a6c0c50f2ff15f/feast-dev/feast/issues/5942 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f88906a57f84160e3b27c58fc393394f969b1d59de355666e1a6c0c50f2ff15f/feast-dev/feast/issues/5942 |
| og:image:alt | Expected Behavior Features materialized to online store successfully, with features persisted on the online store using field_mapping values for the entity join key as names. Current Behavior Mater... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | emreakg |
| hostname | github.com |
| expected-hostname | github.com |
| None | 56eec25a3430492dd6ec2a480eb33256a0da5192d5714b0db4f5ab5f33203d94 |
| turbo-cache-control | no-preview |
| go-import | github.com/feast-dev/feast git https://github.com/feast-dev/feast.git |
| octolytics-dimension-user_id | 57027613 |
| octolytics-dimension-user_login | feast-dev |
| octolytics-dimension-repository_id | 161133770 |
| octolytics-dimension-repository_nwo | feast-dev/feast |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 161133770 |
| octolytics-dimension-repository_network_root_nwo | feast-dev/feast |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 93a615b89b7dcbdb6b678f4772931ecc28ada82a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width