spark-python-data-source

Implement custom PySpark DataSource readers and writers for Spark 4.0+.

Updated May 20, 2026
One-click install
npx skills add https://github.com/ice-droid-99/BI-Dashboard-Generation-Agent-in-Databricks- --skill spark-python-data-source-ice-droid-99
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spark-python-data-source
Source: https://github.com/ice-droid-99/BI-Dashboard-Generation-Agent-in-Databricks-/tree/main/.gemini/skills/spark-python-data-source
Command: npx skills add https://github.com/ice-droid-99/BI-Dashboard-Generation-Agent-in-Databricks- --skill spark-python-data-source-ice-droid-99

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It removes the friction of moving data between Spark and external systems by giving you a clear, production-minded blueprint for implementing the PySpark DataSource API for both batch and streaming.

Core Features & Use Cases

  • Batch and Streaming Connectors: Implement readers and writers for external systems using PySpark DataSource API patterns for Spark 4.0+ in both batch and streaming modes.
  • Executor-Safe Implementation: Enforces import placement and flat inheritance design so your connector works reliably across driver/executor boundaries.
  • Production-Ready Concerns: Provides guidance for partitioning, authentication (including Unity Catalog, default credentials, service principals, API keys, and basic auth), type conversion, exactly-once semantics in streaming, robust error handling with retries/circuit breakers, and testing patterns.

Quick Start

Use the spark-python-data-source skill to implement a custom Spark connector that reads from and writes to your external API by defining a PySpark DataSource with the appropriate batch or stream reader/writer classes.

Frequently Asked Questions about spark-python-data-source

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a custom PySpark connector for an external API?

To build a custom PySpark connector, implement the PySpark DataSource API by defining reader and writer classes for batch and streaming modes. This approach handles pagination, partitioning, and type conversion across driver and executor boundaries.

Does PySpark DataSource support both batch and streaming ingestion?

PySpark DataSource supports both batch and streaming ingestion and egress. You implement specific DataSourceReader and DataSourceWriter classes alongside stream variants to handle continuous data flows and exactly-once semantics.

How do I handle authentication in a Spark Python data source connector?

Authentication in a Spark Python data source connector is handled through a multi-method credential fallback. This supports Unity Catalog, default credentials, service principals, API keys, and basic auth across Spark driver and executor nodes.

Why do my PySpark connector imports fail on executor nodes?

PySpark connector imports fail on executors when third-party dependencies are not loaded in the correct executor-scoped placement. Enforcing flat single-level inheritance serialization and proper import design ensures your connector works reliably across distributed boundaries.

What is the best way to ensure exactly-once semantics in a Spark streaming connector?

To ensure exactly-once semantics in a Spark streaming connector, implement a resilient streaming offset design within your stream reader class. This pattern guarantees fault-tolerant data processing and prevents duplicate ingestion during pipeline recoveries.

How do I manage error handling and retries in a custom Spark data source?

Error handling in a custom Spark data source is managed through resilient patterns including retries and circuit breakers. Integrating these robust error-handling and testing patterns within your reader and writer implementations ensures reliable external system integration.