functions.php
Functions
protocol()
protocol(string $protocol) : Protocol
Parameters
- $protocol : string
Return values
Protocolpartition()
partition(string $name, string $value) : Partition
Parameters
- $name : string
- $value : string
Return values
Partitionpartitions()
partitions(Partition ...$partition) : Partitions
Parameters
- $partition : Partition
Return values
Partitionspath()
Path supports glob patterns.
path(string $path[, array<string, mixed> $options = [] ]) : Path
Examples:
- path('*.csv') - any csv file in current directory
- path('/** / *.csv') - any csv file in any subdirectory (remove empty spaces)
- path('/dir/partition=* /*.parquet') - any parquet file in given partition directory.
Glob pattern is also supported by remote filesystems like Azure
- path('azure-blob://directory/*.csv') - any csv file in given directory
Parameters
- $path : string
- $options : array<string, mixed> = []
Return values
Pathpath_stdout()
Create a path to php stdout stream.
path_stdout([null|array{'stream': "output"|"stderr"|"stdout"} $options = null ]) : Path
Parameters
- $options : null|array{'stream': "output"|"stderr"|"stdout"} = null
Return values
Pathpath_memory()
Create a path to php memory stream.
path_memory([string $path = '' ][, null|array{'stream': "memory"|"temp"} $options = null ]) : Path
Parameters
- $path : string = ''
-
- default = '' - path is used as an identifier in memory filesystem, so we can write multiple files to memory at once, each path is a new handle
- $options : null|array{'stream': "memory"|"temp"} = null
-
- when nothing is provided, 'temp' stream is used by default
Return values
Pathpath_real()
Resolve real path from given path.
path_real(string $path[, array<string, mixed> $options = [] ]) : Path
Parameters
- $path : string
- $options : array<string, mixed> = []
Return values
Pathnative_local_filesystem()
native_local_filesystem() : NativeLocalFilesystem
Return values
NativeLocalFilesystemstdout_filesystem()
Write-only filesystem useful when we just want to write the output to stdout.
stdout_filesystem() : StdOutFilesystem
The main use case is for streaming datasets over http.
Return values
StdOutFilesystemmemory_filesystem()
Create a new memory filesystem and writes data to it in memory.
memory_filesystem() : MemoryFilesystem
Return values
MemoryFilesystemfstab()
Create a new filesystem table with given filesystems.
fstab(Filesystem ...$filesystems) : FilesystemTable
Filesystems can be also mounted later. If no filesystems are provided, local filesystem is mounted.
Parameters
- $filesystems : Filesystem