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:
Verifies user privileges.
Ensures that the specified path leads to an existing shared directory.
Creates a new shared directory in the
pga_foldermetadata 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:
Verifies user privileges.
Creates a new snapshot in the
pga_snapshotmetadata table and specifies for the shared directory theend_snapshotvalue in thepga_foldermetadata table.