Skip to content

feat: add classic cluster option for Switch job deployment#2222

Merged
gueniai merged 8 commits intomainfrom
feat/switch-classic-cluster-support
Jan 21, 2026
Merged

feat: add classic cluster option for Switch job deployment#2222
gueniai merged 8 commits intomainfrom
feat/switch-classic-cluster-support

Conversation

@hiroyukinakazato-db
Copy link
Contributor

@hiroyukinakazato-db hiroyukinakazato-db commented Jan 9, 2026

Changes

What does this PR do?

Add support for classic job cluster via environment variable LAKEBRIDGE_CLUSTER_TYPE=CLASSIC for Switch jobs. This provides a workaround for workspaces where serverless is not available.

Relevant implementation details

  • Added switch_use_serverless flag to LakebridgeConfiguration (not persisted, used only during install)
  • Environment variable LAKEBRIDGE_CLUSTER_TYPE=CLASSIC triggers classic cluster mode
  • SwitchDeployment.install() now accepts use_serverless parameter
  • When use_serverless=False, creates a job cluster with:
    • LTS Spark version
    • Single worker node (16GB+ memory)
    • USER_ISOLATION data security mode

Usage

# Default: Serverless (no change needed)
databricks labs lakebridge install-transpile --include-llm-transpiler true

# Classic cluster
LAKEBRIDGE_CLUSTER_TYPE=CLASSIC databricks labs lakebridge install-transpile --include-llm-transpiler true

Caveats/things to watch out for when reviewing:

  • Default behavior remains serverless (backwards compatible)
  • Classic cluster sizing (16GB+ memory, 1 worker) is fixed for now

Linked issues

Resolves #2219

Functionality

  • added relevant user documentation
  • added new CLI command
  • modified existing command: databricks labs lakebridge install-transpile

Tests

  • manually tested
  • added unit tests
  • added integration tests

Add prompt during install-transpile to allow users to choose between
serverless compute (default) and classic job cluster for Switch jobs.
This provides a workaround for workspaces where serverless access
controls via usage policies require explicit policy selection.
@github-actions
Copy link

github-actions bot commented Jan 9, 2026

✅ 129/129 passed, 6 flaky, 5 skipped, 16m47s total

Flaky tests:

  • 🤪 test_installs_and_runs_local_bladebridge (20.245s)
  • 🤪 test_installs_and_runs_pypi_bladebridge (22.814s)
  • 🤪 test_transpiles_informatica_to_sparksql_non_interactive[True] (18.143s)
  • 🤪 test_transpile_teradata_sql (20.382s)
  • 🤪 test_transpiles_informatica_to_sparksql_non_interactive[False] (3.921s)
  • 🤪 test_transpile_teradata_sql_non_interactive[True] (5.615s)

Running from acceptance #3429

@codecov
Copy link

codecov bot commented Jan 9, 2026

Codecov Report

❌ Patch coverage is 94.73684% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 64.07%. Comparing base (254b5d3) to head (f653402).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/databricks/labs/lakebridge/cli.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2222      +/-   ##
==========================================
+ Coverage   64.05%   64.07%   +0.02%     
==========================================
  Files         100      100              
  Lines        8624     8633       +9     
  Branches      893      894       +1     
==========================================
+ Hits         5524     5532       +8     
- Misses       2928     2929       +1     
  Partials      172      172              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hiroyukinakazato-db
Copy link
Contributor Author

Manual Test Evidence

Test 1: Install with serverless compute (default)

$ databricks labs lakebridge install-transpile --include-llm-transpiler true --profile e2-demo-tokyo
Use serverless compute for Switch job? (no = use classic job compute instead) (default: yes): yes
09:51:39     INFO [d.labs.lakebridge] Skipping transpile configuration prompts for LLM transpiler installation.
09:51:40     INFO [d.l.l.transpiler.installers] databricks-bb-plugin v0.1.24 already installed
09:51:40     INFO [d.l.l.transpiler.installers] Databricks databricks-morph-plugin transpiler v0.6.16 already installed
09:51:40     INFO [d.l.lakebridge.install] Configuring lakebridge `transpile`.
09:51:41     INFO [d.l.lakebridge.install] Lakebridge `transpile` is already installed on this workspace.
09:52:19     INFO [d.l.lakebridge.install] Installing Switch transpiler to workspace.
09:52:19     INFO [d.l.l.deployment.switch] Copying resources to workspace: /Users/hiroyuki.nakazato@databricks.com/.lakebridge/switch
09:52:35     INFO [d.l.l.deployment.switch] Switch job created/updated: https://e2-demo-tokyo.cloud.databricks.com/jobs/569534437124164
09:52:35     INFO [d.l.lakebridge.install] Installation completed successfully! Please refer to the documentation for the next steps.

Installation result

image

Test 2: Install with classic job compute

$ databricks labs lakebridge install-transpile --include-llm-transpiler true --profile e2-demo-tokyo
Use serverless compute for Switch job? (no = use classic job compute instead) (default: yes): no
09:54:02     INFO [d.labs.lakebridge] Skipping transpile configuration prompts for LLM transpiler installation.
09:54:02     INFO [d.l.l.transpiler.installers] databricks-bb-plugin v0.1.24 already installed
09:54:03     INFO [d.l.l.transpiler.installers] Databricks databricks-morph-plugin transpiler v0.6.16 already installed
09:54:03     INFO [d.l.lakebridge.install] Configuring lakebridge `transpile`.
09:54:03     INFO [d.l.lakebridge.install] Lakebridge `transpile` is already installed on this workspace.
09:54:39     INFO [d.l.lakebridge.install] Installing Switch transpiler to workspace.
09:54:39     INFO [d.l.l.deployment.switch] Copying resources to workspace: /Users/hiroyuki.nakazato@databricks.com/.lakebridge/switch
09:54:55     INFO [d.l.l.deployment.switch] Switch job created/updated: https://e2-demo-tokyo.cloud.databricks.com/jobs/569534437124164
09:54:55     INFO [d.l.lakebridge.install] Installation completed successfully! Please refer to the documentation for the next steps.

Installation result

image

Test 3: Job execution with classic job compute

$ databricks labs lakebridge llm-transpile \
  --input-source /Users/hiroyuki.nakazato/0/repos/lakebridge-switch/switch/examples/sql/mssql/input \
  --output-ws-folder /Workspace/Users/hiroyuki.nakazato@databricks.com/switch-io/mssql/output \
  --source-dialect mssql \
  --accept-terms true \
  --profile e2-demo-tokyo
Enter catalog name (default: lakebridge): hinak_catalog_aws_apne1
10:52:51     INFO [d.l.l.deployment.configurator] Found existing catalog `hinak_catalog_aws_apne1`
Enter schema name (default: switch):
10:53:01     INFO [d.l.l.deployment.configurator] Found existing schema `switch` in catalog `hinak_catalog_aws_apne1`
Enter volume name (default: switch_volume):
10:53:05     INFO [d.l.l.deployment.configurator] Found existing volume `switch_volume` in catalog `hinak_catalog_aws_apne1` and schema `switch`
Select a Foundation Model serving endpoint:
[0] [Recommended] databricks-claude-sonnet-4-5
...
Enter a number between 0 and 26: 0
10:53:17     INFO [d.l.l.transpiler.switch_runner] Uploading /Users/hiroyuki.nakazato/0/repos/lakebridge-switch/switch/examples/sql/mssql/input to /Volumes/hinak_catalog_aws_apne1/switch/switch_volume/input-20260113015317-klq3...
10:53:18     INFO [d.l.l.transpiler.switch_runner] Upload complete: /Volumes/hinak_catalog_aws_apne1/switch/switch_volume/input-20260113015317-klq3
10:53:18     INFO [d.l.l.transpiler.switch_runner] Triggering Switch job with job_id: 569534437124164
10:53:18     INFO [d.l.l.transpiler.switch_runner] Switch LLM transpilation job started: https://e2-demo-tokyo.cloud.databricks.com/jobs/569534437124164/runs/572505162987961

Execution result
image

@hiroyukinakazato-db hiroyukinakazato-db marked this pull request as ready for review January 13, 2026 02:13
@hiroyukinakazato-db hiroyukinakazato-db requested a review from a team as a code owner January 13, 2026 02:13
@gueniai
Copy link
Collaborator

gueniai commented Jan 14, 2026

@hiroyukinakazato-db Can we change use-serverless to be a non-prompting param, like the include-llm-transpiler? By default it's set to true (unlike include...) and only if required, like in the case when customers have policies in place, they would turn it off?

@sundarshankar89
Copy link
Collaborator

@hiroyukinakazato-db Can we change use-serverless to be a non-prompting param, like the include-llm-transpiler? By default it's set to true (unlike include...) and only if required, like in the case when customers have policies in place, they would turn it off?

I will recommend using environmental variables like LAKEBRIDGE_CLUSTER_TYPE=CLASSIC, we set up classic and this is non non-documented internal flag. One challenge using Classic is cluster sizing and type, that needs to be optimal.

@gueniai
Copy link
Collaborator

gueniai commented Jan 15, 2026

I like the idea of using an env variable. @hiroyukinakazato-db let us know what you think!

@hiroyukinakazato-db
Copy link
Contributor Author

I like the idea of using an env variable. @hiroyukinakazato-db let us know what you think!
@sundarshankar89 @gueniai I also think it is good idea, I will try to update the code using this approach.

Replace interactive prompt with environment variable for Switch job
compute type selection. Set LAKEBRIDGE_CLUSTER_TYPE=CLASSIC to use
classic job cluster instead of serverless (default).

This is an internal, non-documented flag for workspaces where
serverless is not available.
@hiroyukinakazato-db
Copy link
Contributor Author

hiroyukinakazato-db commented Jan 16, 2026

Manual Test Evidence (Updated)

Updated to use environment variable approach and re-tested.

Branch and Commit

$ git branch --show-current && git log -1 --oneline
feat/switch-classic-cluster-support
afc781cf feat: use LAKEBRIDGE_CLUSTER_TYPE env var for classic cluster selection

Test 1: Install with serverless compute (default)

$ hatch run databricks labs lakebridge install-transpile --include-llm-transpiler true --profile e2-demo-tokyo
14:08:16     INFO [d.labs.lakebridge] Skipping transpile configuration prompts for LLM transpiler installation.
14:08:16     INFO [d.l.l.transpiler.installers] databricks-bb-plugin v0.1.24 already installed
14:08:16     INFO [d.l.l.transpiler.installers] Databricks databricks-morph-plugin transpiler v0.6.16 already installed
14:08:16     INFO [d.l.lakebridge.install] Configuring lakebridge `transpile`.
14:08:16     INFO [d.l.lakebridge.install] Lakebridge `transpile` is already installed on this workspace.
14:08:54     INFO [d.l.lakebridge.install] Installing Switch transpiler to workspace.
14:08:54     INFO [d.l.l.deployment.switch] Copying resources to workspace: /Users/hiroyuki.nakazato@databricks.com/.lakebridge/switch
14:09:11     INFO [d.l.l.deployment.switch] Switch job created/updated: https://e2-demo-tokyo.cloud.databricks.com/jobs/1002520435286464
14:09:11     INFO [d.l.lakebridge.install] Installation completed successfully! Please refer to the documentation for the next steps.

Installation result: Job created without job cluster (serverless)

image

Test 2: Install with classic job compute (using env var)

$ LAKEBRIDGE_CLUSTER_TYPE=CLASSIC hatch run databricks labs lakebridge install-transpile --include-llm-transpiler true --profile e2-demo-tokyo
14:09:36     INFO [d.labs.lakebridge] Skipping transpile configuration prompts for LLM transpiler installation.
14:09:36     INFO [d.l.l.transpiler.installers] databricks-bb-plugin v0.1.24 already installed
14:09:36     INFO [d.l.l.transpiler.installers] Databricks databricks-morph-plugin transpiler v0.6.16 already installed
14:09:36     INFO [d.l.lakebridge.install] Configuring lakebridge `transpile`.
14:09:36     INFO [d.l.lakebridge.install] Lakebridge `transpile` is already installed on this workspace.
14:10:14     INFO [d.l.lakebridge.install] Installing Switch transpiler to workspace.
14:10:14     INFO [d.l.l.deployment.switch] Copying resources to workspace: /Users/hiroyuki.nakazato@databricks.com/.lakebridge/switch
14:10:31     INFO [d.l.l.deployment.switch] Switch job created/updated: https://e2-demo-tokyo.cloud.databricks.com/jobs/1002520435286464
14:10:31     INFO [d.l.lakebridge.install] Installation completed successfully! Please refer to the documentation for the next steps.

Installation result: Job created with classic job cluster (LTS Spark, 16GB+ memory, USER_ISOLATION)

image

Test 3: Job execution with classic job compute

$ hatch run databricks labs lakebridge llm-transpile \
  --input-source /Users/hiroyuki.nakazato/0/repos/lakebridge-switch/switch/examples/sql/mssql/input \
  --output-ws-folder /Workspace/Users/hiroyuki.nakazato@databricks.com/switch-io/mssql/output \
  --source-dialect mssql \
  --accept-terms true \
  --profile e2-demo-tokyo
Enter catalog name (default: lakebridge): hinak_catalog_aws_apne1
14:11:32     INFO [d.l.l.deployment.configurator] Found existing catalog `hinak_catalog_aws_apne1`
Enter schema name (default: switch): switch
14:11:36     INFO [d.l.l.deployment.configurator] Found existing schema `switch` in catalog `hinak_catalog_aws_apne1`
Enter volume name (default: switch_volume): switch_volume
14:11:39     INFO [d.l.l.deployment.configurator] Found existing volume `switch_volume` in catalog `hinak_catalog_aws_apne1` and schema `switch`
Select a Foundation Model serving endpoint:
[0] [Recommended] databricks-claude-sonnet-4-5
...
Enter a number between 0 and 26: 0
14:11:45     INFO [d.l.l.transpiler.switch_runner] Uploading /Users/hiroyuki.nakazato/0/repos/lakebridge-switch/switch/examples/sql/mssql/input to /Volumes/hinak_catalog_aws_apne1/switch/switch_volume/input-20260116051145-o3rb...
14:11:45     INFO [d.l.l.transpiler.switch_runner] Upload complete: /Volumes/hinak_catalog_aws_apne1/switch/switch_volume/input-20260116051145-o3rb
14:11:45     INFO [d.l.l.transpiler.switch_runner] Triggering Switch job with job_id: 1002520435286464
14:11:46     INFO [d.l.l.transpiler.switch_runner] Switch LLM transpilation job started: https://e2-demo-tokyo.cloud.databricks.com/jobs/1002520435286464/runs/155420908996613

Execution result: Job completed successfully on classic cluster

image

@hiroyukinakazato-db
Copy link
Contributor Author

@sundarshankar89 @gueniai Updated PR #2222 to use LAKEBRIDGE_CLUSTER_TYPE=CLASSIC environment variable instead of interactive prompt. Ready for review.

Copy link
Collaborator

@sundarshankar89 sundarshankar89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nit: this looks good.

Copy link
Collaborator

@gueniai gueniai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gueniai gueniai added this pull request to the merge queue Jan 21, 2026
Merged via the queue into main with commit 7e93fc0 Jan 21, 2026
6 checks passed
@gueniai gueniai deleted the feat/switch-classic-cluster-support branch January 21, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: On workspaces with "Serverless Access Controls via Usage Policies", Lakebridge breaks as you can't specify Serverless Policy

3 participants