Skip to content
Lucas Lessa
Voltar para as notícias
DatabricksGAImpacto: Médio

Databricks clean rooms now support JAR workloads in GA

Databricks Clean Rooms now supports compiled Java and Scala code in JARs, running either as standalone approved analyses or as temporary UDFs inside clean room notebooks.

O que mudou

Databricks Clean Rooms now supports running compiled Java and Scala code packaged in JAR files. The feature is generally available (GA) and allows collaborators to process shared datasets without exposing source code or raw data to each other.

Use cases

Imagine two organizations need to match customer records inside a clean room, but the proprietary hashing or data cleaning logic was built in Java. Instead of rewriting that logic in Python or SQL, you can bring the compiled binary directly into the environment.

You can:

  • Run standalone JAR analyses with a specified main class, reviewed and approved by participants just like notebooks.
  • Register session-scoped Java or Scala temporary UDFs inside clean room notebooks to use custom functions in SQL queries.

How to use

First, upload the JAR file to a Unity Catalog volume and add that volume as a shared data asset to the clean room. The entire volume is shared with collaborators.

To register a temporary UDF from a JAR inside a clean room notebook, run the following SQL:

CREATE TEMPORARY FUNCTION normalize_email(email STRING)
RETURNS STRING
LANGUAGE JAVA
ENVIRONMENT (
  DEPENDENCIES = '["/Volumes/catalog_alias/my_schema/my_volume/libs/utilities.jar"]',
  ENVIRONMENT_VERSION = 4
)
HANDLER "com.mycompany.utils.EmailNormalizer.normalize";

SELECT 
  customer_email,
  normalize_email(customer_email) AS cleaned_email
FROM shared_dataset;

What happens in this code:

  1. The temporary function normalize_email is defined pointing to the Java method reference via HANDLER.
  2. The DEPENDENCIES path references the clean room's catalog alias and sets ENVIRONMENT_VERSION = 4.
  3. The UDF is invoked directly within clean room SQL queries.

For standalone JAR analyses, configuration is handled in the workspace UI: navigate to Catalog > Clean Rooms, open the clean room, select Add Analysis > JAR Analysis, specify the entry point main class and volume path, gather collaborator approvals, and run.

Limitations and requirements

  • JARs must be compiled using Java 17 or higher, or Scala 2.13 or higher.
  • Serverless compute is required (4-scala-preview environment for standalone JAR analyses, and environment version 4 for UDFs).
  • On Enterprise accounts (and Azure Premium accounts), JAR support is disabled by default and must be enabled under account console Previews.
  • All collaborators must have the exact same JAR feature settings enabled in their respective accounts, otherwise clean room creation fails.
  • Standalone JAR analysis runs do not emit events into the clean_room_events system table.
Ver nota oficial do Databricks

JAR workloads in clean rooms are now generally available

Resumo e explicação gerados por IA a partir da release note oficial. Em caso de dúvida, a documentação oficial da plataforma prevalece.

Relacionadas