Skip to content

Add Spark 4.1 connector module (azure-cosmos-spark_4-1_2-13) - #48688

Closed
mattslack-db wants to merge 2 commits into
Azure:mainfrom
mattslack-db:spark-4.1-connector
Closed

Add Spark 4.1 connector module (azure-cosmos-spark_4-1_2-13)#48688
mattslack-db wants to merge 2 commits into
Azure:mainfrom
mattslack-db:spark-4.1-connector

Conversation

@mattslack-db

Copy link
Copy Markdown

Summary

  • Adds a new azure-cosmos-spark_4-1_2-13 module for Apache Spark 4.1 support
  • Addresses SPARK-52787 package reorganization where HDFSMetadataLog and MetadataVersionUtil moved from o.a.s.sql.execution.streaming to o.a.s.sql.execution.streaming.checkpointing
  • Based on the existing azure-cosmos-spark_4-0_2-13 module with updated imports for relocated classes

Changes

  • ChangeFeedInitialOffsetWriter.scala — updated imports for HDFSMetadataLog and MetadataVersionUtil
  • CosmosCatalogBase.scala — updated import for HDFSMetadataLog
  • CosmosCatalogITestBase.scala (test) — updated import for HDFSMetadataLog
  • pom.xml — Spark 4.1.0 dependency, source-copy approach with excludes for overridden files

Test plan

  • Verify compilation against Spark 4.1.0
  • Run existing integration tests with Spark 4.1 runtime
  • Validate change feed streaming with Cosmos DB emulator

This pull request was AI-assisted by Isaac.

Add support for Apache Spark 4.1 which reorganized internal streaming
packages (SPARK-52787). The following classes moved from
`o.a.s.sql.execution.streaming` to `o.a.s.sql.execution.streaming.checkpointing`:
- HDFSMetadataLog
- MetadataVersionUtil

This module overrides ChangeFeedInitialOffsetWriter, CosmosCatalogBase,
and CosmosCatalogITestBase with updated imports, and uses a source-copy
approach with excludes to avoid duplicate class definitions from the
shared azure-cosmos-spark_3 source.

Co-authored-by: Isaac
@github-actions github-actions Bot added Community Contribution Community members are working on the issue Cosmos customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Apr 3, 2026
@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution mattslack-db! We will review the pull request and get back to you soon.

@mattslack-db

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree [company="Databricks"]

@mattslack-db

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Databricks"

@FabianMeiswinkel

Copy link
Copy Markdown
Member

mattslack-db - thanks for looking into this. To enable Spark 4.1 there are also several live-tests in the CI pipeline that would need to be enabled - and for security reasons starting those is only possible for devs (MSFT FTEs) with certain permisisons - which makes it really hard for someone external to contribute those. I think the best approach is for us to pick-up the changes, add the necessary live tests and then release Spark 4.1. Usually we try to do so a few weeks after Databricks releases a LTS version for the Spark runtime. Is there a specific need/urgency why you need Spark 4.1 support sooner? If so, please feel to reach out (also privately at fabianm at microsoft.com if needed) and we can work out a timeline?

@mattslack-db

Copy link
Copy Markdown
Author

Sure no worries. I have a customer who wanted to use it with DBR18, and there is a breaking change in the API (see above - MetadataVersionUtil). That's the main reason for the PR.

@laurencewells

Copy link
Copy Markdown

Ran into the issue that this resolves today. thanks mattslack-db for the PR

@FabianMeiswinkel

Copy link
Copy Markdown
Member

Fixed in #48861

@mattslack-db

Copy link
Copy Markdown
Author

Great stuff, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Community Contribution Community members are working on the issue Cosmos customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants