Created
July 21, 2025 20:53
-
-
Save jeanmidevacc/e2a229a053388c358e7ab68c78d42c17 to your computer and use it in GitHub Desktop.
Pyspark code to create volumen in databricks schemas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
schemas = [] # Listo of the schemas to create the volume | |
volume_name = "" #name of you volume | |
for schema in schemas: | |
try: | |
spark.sql(f"CREATE VOLUME IF NOT EXISTS {schema}.{volume_name}") | |
print(f"Volume {volume_name} created or already exists.") | |
except Exception as e: | |
print(f"Error creating volume {volume_name}: {e}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment