trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.18k stars 2.93k forks source link

Add support for native posix file access (for distributed file systems) using file:// schema in addition to object storage #22547

Open nickalexander053 opened 2 months ago

nickalexander053 commented 2 months ago

Many distributed file systems (WEKA, VAST, IBM Spectrum Scale) provide accelerated access to the distributed file system by using RDMA over ethernet or infiniband. These are mounted on the host using either a POSIX client or as an NFS mount. Although almost all of these solutions also provide an S3a interface, the RDMA based solution are substantially faster and use substantially less CPU resources. All of these solutions are available either on premise or in the cloud.

Currently Trino only supports access to object based storage. This is realised through implementations of FileSystem and FileSystemFactory and binding the schema to an implementation of FileSystemFactory in the setup method of io.trino.filesystem.manager.FileSystemModule.

Even though Trino does not officially support non-object storage, it does have an implementation of local file system through LocalFileSystemFactory and LocalFileSystem. By adding the following code to the FileSystemModule (and adding a config variable) setup method, local file system (a.k.a still a distributed file system) can be added:

if(config.isLocalFSEnabled()){
            factories.addBinding("file").to(LocalFileSystemFactory.class);
}
wendigo commented 2 months ago

@electrum do we plan to expose local file system factory?

electrum commented 2 months ago

Yes, we can do this, but we should have a required configuration parameter that specifies the local root for the file system, so that users don’t need to allow access to the entire machine. (assuming no symlinks pointing outside)