Expand description
File io implementation.
§How to build FileIO
We provided a FileIOBuilder
to build FileIO
from scratch. For example:
use iceberg::io::{FileIOBuilder, S3_REGION};
use iceberg::Result;
// Build a memory file io.
let file_io = FileIOBuilder::new("memory").build()?;
// Build an fs file io.
let file_io = FileIOBuilder::new("fs").build()?;
// Build an s3 file io.
let file_io = FileIOBuilder::new("s3")
.with_prop(S3_REGION, "us-east-1")
.build()?;
Or you can pass a path to ask FileIO
to infer schema for you:
use iceberg::io::{FileIO, S3_REGION};
use iceberg::Result;
// Build a memory file io.
let file_io = FileIO::from_path("memory:///")?.build()?;
// Build an fs file io.
let file_io = FileIO::from_path("fs:///tmp")?.build()?;
// Build an s3 file io.
let file_io = FileIO::from_path("s3://bucket/a")?
.with_prop(S3_REGION, "us-east-1")
.build()?;
§How to use FileIO
Currently FileIO
provides simple methods for file operations:
delete
: Delete file.exists
: Check if file exists.new_input
: Create input file for reading.new_output
: Create output file for writing.
Structs§
- FileIO implementation, used to manipulate files in underlying storage.
- Builder for
FileIO
. - The struct the represents the metadata of a file.
- Input file is used for reading from files.
- Output file is used for writing to files..
Constants§
- Region to use for the S3 client.
- Google Cloud Storage credentials JSON string, base64 encoded.
- Allow unauthenticated requests
- Google Cloud Project ID
- Google Cloud Storage endpoint
- Google Cloud Storage token
- Google Cloud user project
- S3 access key id.
- If set, all AWS clients will assume a role of the given ARN, instead of using the default credential chain.
- Optional external ID used to assume an IAM role.
- Optional session name used to assume an IAM role.
- Following are arguments for s3 file io. S3 endpoint.
- S3 Path Style Access.
- S3 region.
- S3 secret access key.
- S3 session token. This is required when using temporary credentials.
- S3 Server Side Encryption Key. If S3 encryption type is kms, input is a KMS Key ID. In case this property is not set, default key “aws/s3” is used. If encryption type is custom, input is a custom base-64 AES256 symmetric key.
- S3 Server Side Encryption MD5.
- S3 Server Side Encryption Type.
Traits§
- Trait for reading file.
- Trait for writing file.