Title: fix(spark): Replace mapInArrow with foreachPartition for materialization by abhijeet-dhumal · Pull Request #6370 · feast-dev/feast · GitHub
Open Graph Title: fix(spark): Replace mapInArrow with foreachPartition for materialization by abhijeet-dhumal · Pull Request #6370 · feast-dev/feast
X Title: fix(spark): Replace mapInArrow with foreachPartition for materialization by abhijeet-dhumal · Pull Request #6370 · feast-dev/feast
Description: What this PR does / why we need it Fixes materialization failures when using BatchFeatureView + SparkComputeEngine with vector stores and Spark 3.5+. 1. Replace mapInArrow with foreachPartition (main fix) Spark 3.5 inserts WindowGroupLimitExec upstream of MapInArrowExec when UDFs use Window operations, routing the Python worker through the wrong serialiser: AttributeError: 'list' object has no attribute 'dtype' foreachPartition uses pickle — no Arrow UDF bridge — so the mismatch cannot occur. 2. Re-apply session configs on reuse SparkSession.getOrCreate() silently drops new spark.sql.* / spark.hadoop.* overrides when a session already exists, causing S3 access failures. Now explicitly re-applied after getOrCreate(). 3. Fix map_in_pandas dummy yield Changed pd.DataFrame([pd.Series(range(1, 2))]) → pd.DataFrame({"status": [0]}) to match the declared return schema. 4. Remove redundant _apply_bfv_transformations Superseded by SparkFeatureBuilder DAG pipeline (#6357) which handles BFV transformations for both materialization and historical retrieval. 5. Add spark_embed utility Helper for @batch_feature_view UDFs that generate embeddings via SentenceTransformer. Uses localCheckpoint(eager=True) to sever Python lineage before downstream writes. Which issue(s) this PR fixes Fixes BatchFeatureView materialization with vector stores (Milvus/Redis), Spark 3.5+ Window operations, and K8s-mode session config drift. Testing Strategy Unit tests: session config forwarding, map_in_pandas schema, empty partition handling, S3 event log dir Manual: Materialized BatchFeatureView with PySpark + RAPIDS GPU on K8s (4 executors), 26M+ keys to Redis Checks Tests passing Commits signed off PR title follows conventional commits
Open Graph Description: What this PR does / why we need it Fixes materialization failures when using BatchFeatureView + SparkComputeEngine with vector stores and Spark 3.5+. 1. Replace mapInArrow with foreachPartition (ma...
X Description: What this PR does / why we need it Fixes materialization failures when using BatchFeatureView + SparkComputeEngine with vector stores and Spark 3.5+. 1. Replace mapInArrow with foreachPartition (ma...
Opengraph URL: https://github.com/feast-dev/feast/pull/6370
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:85828dbf-6c66-0b20-70de-7d6209773862 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D81A:16195D:2A1E4A3:3A2DA0E:6A4F552A |
| html-safe-nonce | 1a34de87c1fa134a707fa777d44d50a6d153b9b996916cdf52e6ee7d963469b5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODFBOjE2MTk1RDoyQTFFNEEzOjNBMkRBMEU6NkE0RjU1MkEiLCJ2aXNpdG9yX2lkIjoiNzUyODg5OTgyOTk2MDc1ODU3MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6f210607fad8730cf9520ae29561422040765139c0921d21286adaa27ac0b0d2 |
| hovercard-subject-tag | pull_request:3634755682 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/feast-dev/feast/pull/6370/files |
| twitter:image | https://avatars.githubusercontent.com/u/84722973?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/84722973?s=400&v=4 |
| og:image:alt | What this PR does / why we need it Fixes materialization failures when using BatchFeatureView + SparkComputeEngine with vector stores and Spark 3.5+. 1. Replace mapInArrow with foreachPartition (ma... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4b249b445842943ed31549e027f57a8ade9881ed |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width