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.