spark

spark is a cursor rule for coding agents from sfc-gh-cconner/support-rules-mcp. It costs 1,570 tokens per session, scanned A, original, Apache-2.0.

A guide to the Snowflake connector for Apache Spark, a framework for processing large datasets across computers.

In plain words
What is it for?
Use it when investigating connections, authentication, reading, writing, copying, or staging data between Apache Spark and Snowflake.
Why use it?
It provides established patterns for connecting Spark workloads to Snowflake and moving data between them.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/sfc-gh-cconner/support-rules-mcp/spark
Clone the repo
git clone --depth 1 https://github.com/sfc-gh-cconner/support-rules-mcp

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for spark

README.md
[![agentmods](https://agentmods.dev/badge/rules/sfc-gh-cconner/support-rules-mcp/spark.svg)](https://agentmods.dev/rules/sfc-gh-cconner/support-rules-mcp/spark)
Your own site
<a href="https://agentmods.dev/rules/sfc-gh-cconner/support-rules-mcp/spark"><img src="https://agentmods.dev/badge/rules/sfc-gh-cconner/support-rules-mcp/spark.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,570 This file is loaded in full into every session.
When invoked 1,570 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01570 $0.01570
Opus 5 $0.00785 $0.00785
Sonnet 5 $0.00314 $0.00314
Haiku 4.5 $0.00157 $0.00157

Measured 4d ago against content hash 67895840bd9d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

spark scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules/connectors/spark.mdc · 272 lines

How it starts

The opening of the file, as written. The whole thing — 272 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Spark Connector Investigation Guide

PURPOSE: Spark connector patterns for integrating Snowflake with Apache Spark workloads.

Access Method: GitHub MCP API tools
Repository: snowflakedb/spark-snowflake

🔍 Quick Investigation Patterns

Connection Issues

# Search for connection setup
mcp_github_search_code(
    query='SnowflakeConnection OR createConnection repo:snowflakedb/spark-snowflake'
)

# JDBC URL building
mcp_github_search_code(
    query='jdbcUrl OR buildUrl repo:snowflakedb/spark-snowflake'
)

# Connection parameters
mcp_github_search_code(
    query='sfURL OR sfAccount repo:snowflakedb/spark-snowflake'
)

# Authentication
mcp_github_search_code(
    query='authenticator OR sfPassword repo:snowflakedb/spark-snowflake'
)

Data Transfer Operations

# Read operations
mcp_github_search_code(
    query='buildScan OR readFromSnowflake repo:snowflakedb/spark-snowflake'
)

# Write operations
mcp_github_search_code(
    query='saveToSnowflake OR writeToSnowflake repo:snowflakedb/spark-snowflake'
)

# Copy operations
mcp_github_search_code(
    query='COPY INTO OR copyInto repo:snowflakedb/spark-snowflake'
)

# Stage operations
mcp_github_search_code(
    query='stage OR @~ repo:snowflakedb/spark-snowflake'
)

DataFrame Integration

# DataFrame reader
mcp_github_search_code(
    query='DataFrameReader OR spark.read repo:snowflakedb/spark-snowflake'
)

# DataFrame writer
mcp_github_search_code(
    query='DataFrameWriter OR df.write repo:snowflakedb/spark-snowflake'
)

# Schema handling
mcp_github_search_code(
    query='StructType OR schema repo:snowflakedb/spark-snowflake'
)

🎯 Key Components

Core Classes

# Main connector class
mcp_github_search_code(
    query='class DefaultSource repo:snowflakedb/spark-snowflake language:scala'
)

# Relation implementation
mcp_github_search_code(
    query='SnowflakeRelation repo:snowflakedb/spark-snowflake'
)

# RDD implementation
mcp_github_search_code(
    query='SnowflakeRDD repo:snowflakedb/spark-snowflake'
)

# Writer implementation
mcp_github_search_code(
    query='SnowflakeWriter repo:snowflakedb/spark-snowflake'
)

Read the full file on GitHub · 272 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 272 lines · 1,570 tokens per session scan A 67895840bd9d

Subscribe to this mod's changes

spark is a cursor rule published in the GitHub repository sfc-gh-cconner/support-rules-mcp (0 stars, last pushed 10mo ago), licensed Apache-2.0. It adds 1,570 tokens to every session, about $0.0078 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.