Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2025 05:25 AM
How do I migrate this to the new SQL paramaters?
%sql
CREATE OR REPLACE TABLE ${environment_name}.${schema_name}.cmip6_max_rainfall_${run_version} AS
SELECT *
FROM read_files('/Volumes/${environment_name}/${schema_name}/pluvial_flood/scratch/gfes_parquets_${run_version}/')
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2025 08:13 AM
Hello @GC-James!
To migrate from legacy ${variable} parameters to the new SQL parameter style in Databricks, replace ${variable} with :variable and define those parameters in the UI's "Parameters" section.
Your updated code will look like:
CREATE OR REPLACE TABLE IDENTIFIER(
:environment_name || '.' || :schema_name || '.' || 'cmip6_max_rainfall_' || :run_version
) AS
SELECT *
FROM read_files(
'/Volumes/' || :environment_name || '/' || :schema_name || '/pluvial_flood/scratch/gfes_parquets_' || :run_version || '/'
)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2025 08:52 AM
Thanks for the help on how to change. I must say it seemed better how it was before!