GET_RELATIVE_PATH
functionsupportedData loading & unloadingExtracts the path of a staged file relative to its location in the stage using the stage name and absolute file path in cloud storage as inputs.
Syntax
GET_RELATIVE_PATH( @<stage_name> , '<absolute_file_path>' )
Parameters
| Name | Required | Description |
|---|---|---|
stage_name | required | Name of the internal or external stage where the file is stored. Note If the stage name includes spaces or special characters, it must be enclosed in single quotes (e.g. '@"my stage"' for a stage named "my stage"). |
absolute_file_path | required | Stage location, including the path and filename, of the file in cloud storage. |
Returns
Path of the file relative to the stage location.
Usage notes
- This SQL function returns a value for any role that has the following privilege on the stage: External stage: USAGE Internal stage: READ
- If files downloaded from an internal stage are corrupted, verify with the stage creator that ENCRYPTION = (TYPE = 'SNOWFLAKE_SSE') is set for the stage.