3.6. Shared Directories #

Shared directories are storage directories where Parquet files are located when adding and exporting the OLAP data from analytical tables.

The metadata of shared directories is stored in the pga_folder metadata table.

3.6.1. Creating a Shared Directory #

Execute the following query:

  SELECT metastore.add_folder('shared_directory_name', 'storage_name', 'path_to_the_shared_directory');

Where:

  • shared_directory_name: The unique shared directory name.

  • storage_name: The name of the storage where the shared directory will be created.

  • path_to_the_shared_directory: The path to the shared directory relative to the root directory of the storage.

Example 3.29. 

  SELECT metastore.add_folder('example_shared_directory', 'example_storage', '/relative_path');

Once the query is executed, pgpro_metastore performs the following actions:

  1. Verifies user privileges.

  2. Ensures that the specified path leads to an existing shared directory.

  3. Creates a new shared directory in the pga_folder metadata table.

3.6.2. Deleting a Shared Directory #

Execute the following query:

  SELECT metastore.remove_folder('shared_directory_name');

Where shared_directory_name is the name of the shared directory that will be deleted.

Example 3.30. 

  SELECT metastore.remove_folder('example_shared_directory');

Once the query is executed, pgpro_metastore performs the following actions:

  1. Verifies user privileges.

  2. Creates a new snapshot in the pga_snapshot metadata table and specifies for the shared directory the end_snapshot value in the pga_folder metadata table.