What problem does it solve?
Many external systems lack native Spark connectors, making it hard to read or write data from APIs, databases, or custom protocols in Spark jobs. This skill provides a structured way to implement custom Python DataSources for both batch and streaming workloads.
Core Features & Use Cases
- Unified Architecture: Singleālevel inheritance DataSource, Reader/Writer, Batch and Stream classes ensure easy serialization across driver and executors.
- Authentication Flexibility: Supports Unity Catalog, cloud default credentials, service principals, API keys, and basic auth.
- Partitioning Strategies: Timeābased, tokenārange, and IDārange patterns enable parallel reads and writes.
- Robust Error Handling: Includes exponential backoff, circuit breaker, deadāletter queue, and timeout handling.
- Testing & Validation: Reference templates, unit test scaffolding, typeāconversion utilities, and productionāgrade validation guidelines.
Use case example: Build a connector to read from a paginated REST API and write results to Snowflake, all within a Databricks notebook.
Quick Start
Ask the assistant to create a Spark data source for reading from a MongoDB database with sharding support.