Module iceberg::io

source ·
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§

Constants§

Traits§