Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 03:12 PM
Thank you kindly for responding. Actually I fixed the runtime version issue before this response. Even then it didn't work because I get data catalog error even though I have a metastore in the AWS S3 location - ELECT CURRENT_METASTORE(); returned a result of aws:us-west-2:432ad77b-3.xxxxxx
AssertionError: Failed to create the catalog "vasudev_killada_oiv6_da". Please see the "Troubleshooting | Cannot Create Catalog" section of the "Version Info" notebook for more information.
File /local_disk0/.ephemeral_nfs/envs/pythonEnv-2910bec1-6d83-487b-85ba-d530893816bd/lib/python3.11/site-packages/dbacademy/dbhelper/dbacademy_helper_class.py:473, in DBAcademyHelper.__create_catalog(self) 472 print(f"Creating & using the catalog \"{self.catalog_name}\"", end="...") --> 473 dbgems.sql(f"CREATE CATALOG IF NOT EXISTS {self.catalog_name}") 474 dbgems.sql(f"USE CATALOG {self.catalog_name}")
then I try to validate by creating a catalog and then I get issue with this error:
then I try to validate by creating a catalog and then I get issue with this error:
from pyspark.sql import SparkSession
Create a Spark session
spark = SparkSession.builder.getOrCreate()
Define a unique catalog name
catalog_name = "vasu_catalog_test" # Ensure this is unique
Try creating and using the catalog
try:
spark.sql(f"CREATE CATALOG IF NOT EXISTS {catalog_name}")
spark.sql(f"USE CATALOG {catalog_name}")
print(f"Successfully created and switched to catalog: {catalog_name}")
except Exception as e:
print(f"Error creating catalog: {str(e)}")
raise AssertionError(f"Failed to create the catalog '{catalog_name}'. Please see the 'Troubleshooting | Cannot Create Catalog' section of the 'Version Info' notebook for more information.")