Skip to content

Conversation

@CTTY
Copy link
Collaborator

@CTTY CTTY commented Jan 28, 2026

Which issue does this PR close?

What changes are included in this PR?

Wired OpenDal with Storage trait. FileIO still uses hardcoded OpenDal as of now so no customer facing behavior changes

  • Implement Storage for OpenDal
  • Added OpenDalFactory and implement StorageFactory (unused for now)
  • Updated Input/OutputFile to delegate operations to storage
  • Updated FileIO to delegate operations to inner storage

Are these changes tested?

No new tests added, rely on existing tests

@CTTY CTTY marked this pull request as ready for review January 29, 2026 01:27
Ok(opendal::Reader::read(self, range).await?.to_bytes())
}
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this to storage.rs, and will move this to iceberg-storage/opendal/ in the future, because this is opendal specific

let _ = opendal::Writer::close(self).await?;
Ok(())
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, moved this to storage.rs, and will move this to iceberg-storage/opendal/ in the future, because this is opendal specific

async fn close(&mut self) -> crate::Result<()> {
self.as_mut().close().await
}
}
Copy link
Collaborator Author

@CTTY CTTY Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted this because we pass Box<dyn FileWrite> around and use boxed items directly.

I updated AsyncFileWriter accordingly

let mut writer = self.writer().await?;
writer.write(bs).await?;
writer.close().await
self.storage.write(&self.path, bs).await
Copy link
Collaborator Author

@CTTY CTTY Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a minor behavior difference here. The new implementation calls Operator::write directly while the old one uses Writer::write and then explicitly closes it.

According to OpenDal's doc, the difference seems trivial

format!("{relative_path}/")
};
Ok(op.remove_all(&path).await?)
pub async fn delete_prefix(&self, path: impl AsRef<str>) -> Result<()> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change, the method is renamed to delete_prefix

@CTTY CTTY changed the title feat(io): Implement Storage for OpenDal feat!(io): Implement Storage for OpenDal Jan 29, 2026
@CTTY CTTY added the breaking label Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Storage for OpenDal

1 participant