Class UploadStreamConfig
- java.lang.Object
-
- net.snowflake.client.api.connection.UploadStreamConfig
-
public class UploadStreamConfig extends Object
Optional configuration for uploading data to a Snowflake stage from a stream.This class provides optional configuration for the
SnowflakeConnection.uploadStream(String, String, java.io.InputStream, UploadStreamConfig)method. Required parameters (stageName, destFileName, inputStream) are passed as method arguments, while optional settings are configured here.Example usage:
try (InputStream dataStream = new FileInputStream("data.csv")) { UploadStreamConfig config = UploadStreamConfig.builder() .setDestPrefix("data/2024") .setCompressData(true) .build(); connection.uploadStream("@my_stage", "uploaded_data.csv", dataStream, config); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUploadStreamConfig.BuilderBuilder for creatingUploadStreamConfiginstances.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UploadStreamConfig.Builderbuilder()Creates a new builder instance.StringgetDestPrefix()Gets the destination prefix (directory path within the stage).booleanisCompressData()Whether to compress the data during upload.StringtoString()
-
-
-
Method Detail
-
getDestPrefix
public String getDestPrefix()
Gets the destination prefix (directory path within the stage).- Returns:
- the destination prefix, or null if files should be uploaded to stage root
-
isCompressData
public boolean isCompressData()
Whether to compress the data during upload.- Returns:
- true if data should be compressed, false otherwise
-
builder
public static UploadStreamConfig.Builder builder()
Creates a new builder instance.- Returns:
- a new
UploadStreamConfig.Builder
-
-