Package dev.frostlake.metastore.model
Class Stage
java.lang.Object
dev.frostlake.metastore.SqlObject
dev.frostlake.metastore.model.Stage
- All Implemented Interfaces:
Taggable
Represents a Snowflake STAGE - a named location for staging data files.
Supports local filesystem staging for data loading and unloading operations.
S3 stages are simulated using local filesystem paths.
-
Field Summary
Fields inherited from class dev.frostlake.metastore.SqlObject
comment, createdTime, name, owner -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanfileExists(String fileName) Check if a file exists in the stageThe declared ENCRYPTION TYPE (e.g.voidGet a file from the stagegetFilePath(String fileName) Get full path to a file in the stageGet the type of this SQL object (e.g., "TABLE", "VIEW", "DATABASE") Subclasses should override to provide their specific typeGet the S3 bucket name (if this is an S3 stage)Get the S3 prefix/path (if this is an S3 stage)getType()getUrl()booleanbooleanbooleanCheck if this stage is using S3 simulationList files in the stageList files in the stage with optional patternvoidPut a file into the stagebooleanremoveFile(String fileName) Remove a file from the stagevoidsetDirectoryEnabled(boolean directoryEnabled) voidsetEncryptionType(String encryptionType) voidsetFileFormat(String fileFormat) ALTER STAGE … SET FILE_FORMAT.voidALTER STAGE … SET URL — repoint the stage and recompute its local directory.toString()Methods inherited from class dev.frostlake.metastore.SqlObject
equals, getComment, getCreatedTime, getName, getOwner, getTagValue, getTagValues, hashCode, rename, setComment, setName, setOwner, setTag, unsetTag, withoutTrailingSemicolon
-
Constructor Details
-
Stage
-
Stage
-
Stage
-
-
Method Details
-
getFileFormatOptions
-
getCopyOptions
-
isDirectoryEnabled
public boolean isDirectoryEnabled() -
setDirectoryEnabled
public void setDirectoryEnabled(boolean directoryEnabled) -
setUrl
ALTER STAGE … SET URL — repoint the stage and recompute its local directory. -
setFileFormat
ALTER STAGE … SET FILE_FORMAT. -
getType
-
getUrl
-
getFileFormat
-
isEncryption
public boolean isEncryption() -
getEncryptionType
The declared ENCRYPTION TYPE (e.g. SNOWFLAKE_SSE), or null for the account default. -
setEncryptionType
-
getCreatedAt
-
getLocalPath
-
getObjectType
Description copied from class:SqlObjectGet the type of this SQL object (e.g., "TABLE", "VIEW", "DATABASE") Subclasses should override to provide their specific type- Specified by:
getObjectTypein classSqlObject- Returns:
- The object type as a string
-
listFiles
List files in the stage- Throws:
IOException
-
listFiles
List files in the stage with optional pattern- Throws:
IOException
-
fileExists
Check if a file exists in the stage -
getFilePath
Get full path to a file in the stage -
putFile
Put a file into the stage- Throws:
IOException
-
getFile
Get a file from the stage- Throws:
IOException
-
removeFile
Remove a file from the stage- Throws:
IOException
-
isS3Simulated
public boolean isS3Simulated()Check if this stage is using S3 simulation -
getS3Bucket
Get the S3 bucket name (if this is an S3 stage) -
getS3Prefix
Get the S3 prefix/path (if this is an S3 stage) -
toString
-