Storage
The delta filesystem handler for the pyarrow engine writer.
deltalake.fs.DeltaStorageHandler
DeltaStorageHandler(table_uri: str, options: Optional[Dict[str, str]] = None, known_sizes: Optional[Dict[str, int]] = None)
Bases: FileSystemHandler
DeltaStorageHandler is a concrete implementations of a PyArrow FileSystemHandler.
copy_file
Copy a file.
If the destination exists and is a directory, an error is returned. Otherwise, it is replaced.
create_dir
Create a directory and subdirectories.
This function succeeds if the directory already exists.
delete_dir_contents
delete_dir_contents(path: str, *, accept_root_dir: bool = False, missing_dir_ok: bool = False) -> None
Delete a directory's contents, recursively.
Like delete_dir, but doesn't delete the directory itself.
delete_root_dir_contents
Delete the root directory contents, recursively.
get_file_info
Get info for the given files.
A non-existing or unreachable file returns a FileStat object and has a FileType of value NotFound. An exception indicates a truly exceptional condition (low-level I/O error, etc.).
get_file_info_selector
Get info for the files defined by FileSelector.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
selector |
FileSelector
|
FileSelector object |
required |
Returns:
Type | Description |
---|---|
List[FileInfo]
|
list of file info objects |
move
Move / rename a file or directory.
If the destination exists: - if it is a non-empty directory, an error is returned - otherwise, if it has the same type as the source, it is replaced - otherwise, behavior is unspecified (implementation-dependent).
open_input_file
Open an input file for random access reading.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
str
|
The source to open for reading. |
required |
Returns:
Type | Description |
---|---|
PythonFile
|
NativeFile |
open_input_stream
Open an input stream for sequential reading.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
str
|
The source to open for reading. |
required |
Returns:
Type | Description |
---|---|
PythonFile
|
NativeFile |
open_output_stream
Open an output stream for sequential writing.
If the target already exists, existing data is truncated.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
str
|
The source to open for writing. |
required |
metadata |
Optional[Dict[str, str]]
|
If not None, a mapping of string keys to string values. |
None
|
Returns:
Type | Description |
---|---|
PythonFile
|
NativeFile |