scala-notebook

Write robust Spark ETL code in Databricks Scala notebooks.

1|Updated Jan 26, 2026
One-click install
npx skills add https://github.com/olavocarvalho/data-agents --skill scala-notebook
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scala-notebook
Source: https://github.com/olavocarvalho/data-agents/tree/main/skills/scala-notebook
Command: npx skills add https://github.com/olavocarvalho/data-agents --skill scala-notebook

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides best practices and solutions for common challenges encountered when writing Spark ETL pipelines and performing data manipulation in Databricks Scala notebooks.

Core Features & Use Cases

  • Avoid Self-Join Errors: Learn how to circumvent Databricks' restrictions on self-joins with remote tables by using temporary tables.
  • Optimize Performance: Understand why using temp tables is preferred over .cache() for persistence and lineage breaking.
  • Prevent Ambiguous Columns: Resolve errors caused by duplicate column names after joins, especially when working with grouped DataFrames.
  • Literal Arithmetic: Correctly use lit() for arithmetic operations involving Spark Columns and literals.
  • Cross-Language Config: Share configuration values between Scala and Python cells using spark.conf.

Quick Start

Use the scala-notebook skill to avoid self-join errors on remote tables in Databricks.

Frequently Asked Questions about scala-notebook

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

FAQPage Schema
How do I fix self-join errors on remote tables in Databricks Scala notebooks?

To fix self-join errors on remote tables in Databricks Scala notebooks, use temporary tables instead of referencing the remote table directly. This approach circumvents restrictions and ensures robust Spark ETL pipeline execution.

Why should I use temp tables instead of cache for Spark DataFrames?

Using temp tables instead of `.cache()` for Spark DataFrames is preferred to optimize performance and break lineage. This approach prevents ambiguous column references and ensures robust data manipulation within Databricks Scala notebooks.

How do I resolve ambiguous column references after joining DataFrames in Scala?

To resolve ambiguous column references after joining DataFrames in Scala, use temporary tables to break lineage and isolate schemas. This is especially necessary when working with grouped DataFrames to prevent duplicate column name errors.

What is the correct way to perform arithmetic with Spark Columns and literals in Scala?

The correct way to perform arithmetic with Spark Columns and literals in Scala is by using the `lit()` function. Wrapping literal values with `lit()` ensures proper type coercion and safe arithmetic operations within DataFrame manipulations.

Can I pass configuration values between Scala and Python cells in Databricks?

Yes, you can pass configuration values between Scala and Python cells in Databricks by using `spark.conf`. This cross-language config sharing enables seamless integration and parameter passing within your Spark ETL pipelines.

What are common limitations when writing Spark ETL pipelines in Databricks Scala notebooks?

Limitations when writing Spark ETL pipelines in Databricks Scala notebooks include self-join restrictions on remote tables and ambiguous column references after joins. Mitigate these constraints by using temp tables and `lit()` for robust data manipulation.