STAGE
- connection to object storage, 3 types: User (
@~) or Table (@%<table>), Named internal and external (@<name>)
- External Stage Creation
- metadata columns:
METADATA$FILENAME and METADATA$FILE_ROW_NUMBER
get and put work on internal stages only; remove and list work on internal and external stages
- 3 ways to access S3:
- storage integration
- IAM Role (deprecated):
desc stage to get Snowflake IAM User+ AWS_EXTERNAL_ID and assign to a IAM Role
- IAM User: create an IAM User with programmatic access and supply
aws_key_id and aws_secret_key for credentials option
| feature |
User |
Table |
Int Named |
External |
| auto created |
X |
X |
|
|
| Format |
|
X |
X |
X |
| Transformations |
X |
|
X |
X |
| Same region |
X |
X |
X |
|
Directory Tables
- contains metadata about files in stages
- created implicitly when creating stages
DIRECTORY = (ENABLE = TRUE)
- can be created on internal and external stages
- use
directory table function to obtain metadata
- can create standard streams to track files that are added or dropped
- only directory tables on external stages can be auto refreshed