Flow PHP

functions.php

Functions

telemetry_options()

telemetry_options([bool $trace_loading = false ][, bool $trace_transformations = false ][, bool $trace_cache = false ][, bool $collect_metrics = false ][, FilesystemTelemetryOptions|null $filesystem = null ]) : TelemetryOptions
Parameters
$trace_loading : bool = false
$trace_transformations : bool = false
$trace_cache : bool = false
$collect_metrics : bool = false
$filesystem : FilesystemTelemetryOptions|null = null
Return values
TelemetryOptions

from_array()

from_array(iterable<string|int, array<string|int, mixed>> $array[, null|Schema $schema = null ]) : ArrayExtractor
Parameters
$array : iterable<string|int, array<string|int, mixed>>
$schema : null|Schema = null
  • @deprecated use withSchema() method instead
Return values
ArrayExtractor

from_cache()

from_cache(string $id[, null|Extractor $fallback_extractor = null ][, bool $clear = false ]) : CacheExtractor
Parameters
$id : string
  • cache id from which data will be extracted
$fallback_extractor : null|Extractor = null
  • extractor that will be used when cache is empty - @deprecated use withFallbackExtractor() method instead
$clear : bool = false
  • clear cache after extraction - @deprecated use withClearOnFinish() method instead
Return values
CacheExtractor

filesystem_cache()

filesystem_cache([Path|string|null $cache_dir = null ][, Filesystem $filesystem = new NativeLocalFilesystem() ][, Serializer $serializer = new FloeSerializer() ]) : FilesystemCache
Parameters
$cache_dir : Path|string|null = null
$filesystem : Filesystem = new NativeLocalFilesystem()
$serializer : Serializer = new FloeSerializer()
Return values
FilesystemCache

from_sequence_date_period()

from_sequence_date_period(string $entry_name, DateTimeInterface $start, DateInterval $interval, DateTimeInterface $end[, int $options = 0 ]) : SequenceExtractor
Parameters
$entry_name : string
$start : DateTimeInterface
$interval : DateInterval
$end : DateTimeInterface
$options : int = 0
Return values
SequenceExtractor

from_sequence_date_period_recurrences()

from_sequence_date_period_recurrences(string $entry_name, DateTimeInterface $start, DateInterval $interval, int $recurrences[, int $options = 0 ]) : SequenceExtractor
Parameters
$entry_name : string
$start : DateTimeInterface
$interval : DateInterval
$recurrences : int
$options : int = 0
Return values
SequenceExtractor

from_sequence_number()

from_sequence_number(string $entry_name, string|int|float $start, string|int|float $end[, int|float $step = 1 ]) : SequenceExtractor
Parameters
$entry_name : string
$start : string|int|float
$end : string|int|float
$step : int|float = 1
Return values
SequenceExtractor

to_array()

Convert rows to an array and store them in passed array variable.

to_array(array<string|int, mixed> &$array) : ArrayLoader
Parameters
$array : array<string|int, mixed>
Tags
param-out

array<array> $array

Return values
ArrayLoader

to_stream()

to_stream(string $uri[, int|bool $truncate = 20 ][, Output $output = Output::rows ][, string $mode = 'w' ][, Formatter $formatter = new AsciiTableFormatter() ][, SchemaFormatter $schemaFormatter = new ASCIISchemaFormatter() ]) : StreamLoader
Parameters
$uri : string
$truncate : int|bool = 20
$output : Output = Output::rows
$mode : string = 'w'
$formatter : Formatter = new AsciiTableFormatter()
$schemaFormatter : SchemaFormatter = new ASCIISchemaFormatter()
Return values
StreamLoader

bool_entry()

bool_entry(string $name, bool|null $value[, Metadata|null $metadata = null ]) : Entry)
Parameters
$name : string
$value : bool|null
$metadata : Metadata|null = null
Return values
Entry)

boolean_entry()

boolean_entry(string $name, bool|null $value[, Metadata|null $metadata = null ]) : Entry)
Parameters
$name : string
$value : bool|null
$metadata : Metadata|null = null
Return values
Entry)

datetime_entry()

datetime_entry(string $name, DateTimeInterface|string|null $value[, Metadata|null $metadata = null ]) : DateTimeInterface>)
Parameters
$name : string
$value : DateTimeInterface|string|null
$metadata : Metadata|null = null
Tags
throws
InvalidArgumentException
Return values
DateTimeInterface>)

time_entry()

time_entry(string $name, DateInterval|string|null $value[, Metadata|null $metadata = null ]) : DateInterval>)
Parameters
$name : string
$value : DateInterval|string|null
$metadata : Metadata|null = null
Tags
throws
InvalidArgumentException
Return values
DateInterval>)

date_entry()

date_entry(string $name, DateTimeInterface|string|null $value[, Metadata|null $metadata = null ]) : DateTimeInterface>)
Parameters
$name : string
$value : DateTimeInterface|string|null
$metadata : Metadata|null = null
Tags
throws
InvalidArgumentException
Return values
DateTimeInterface>)

int_entry()

int_entry(string $name, int|null $value[, Metadata|null $metadata = null ]) : Entry)
Parameters
$name : string
$value : int|null
$metadata : Metadata|null = null
Return values
Entry)

integer_entry()

integer_entry(string $name, int|null $value[, Metadata|null $metadata = null ]) : Entry)
Parameters
$name : string
$value : int|null
$metadata : Metadata|null = null
Return values
Entry)

enum_entry()

enum_entry(string $name, UnitEnum|null $enum[, Metadata|null $metadata = null ]) : UnitEnum>)
Parameters
$name : string
$enum : UnitEnum|null
$metadata : Metadata|null = null
Return values
UnitEnum>)

float_entry()

float_entry(string $name, float|int|string|null $value[, Metadata|null $metadata = null ]) : Entry)
Parameters
$name : string
$value : float|int|string|null
$metadata : Metadata|null = null
Return values
Entry)

json_entry()

json_entry(string $name, null|array<string|int, mixed>|Json|string $data[, Metadata|null $metadata = null ]) : Json>)
Parameters
$name : string
$data : null|array<string|int, mixed>|Json|string
$metadata : Metadata|null = null
Tags
throws
InvalidArgumentException
Return values
Json>)

json_object_entry()

json_object_entry(string $name, null|array<string|int, mixed>|Json|string $data[, Metadata|null $metadata = null ]) : Json>)
Parameters
$name : string
$data : null|array<string|int, mixed>|Json|string
$metadata : Metadata|null = null
Tags
throws
InvalidArgumentException
Return values
Json>)

str_entry()

str_entry(string $name, string|null $value[, Metadata|null $metadata = null ]) : Entry)
Parameters
$name : string
$value : string|null
$metadata : Metadata|null = null
Return values
Entry)

null_entry()

Creates an entry of the null type. Used when a column value is null and its final type is not yet known.

null_entry(string $name[, Metadata|null $metadata = null ]) : Entry<string|int, null>

When guessing a schema from rows, a null column stays a NullDefinition until a later row reveals a real type, at which point the schema merge turns it into that type made nullable.

Parameters
$name : string
$metadata : Metadata|null = null
Return values
Entry<string|int, null>

string_entry()

string_entry(string $name, string|null $value[, Metadata|null $metadata = null ]) : Entry)
Parameters
$name : string
$value : string|null
$metadata : Metadata|null = null
Return values
Entry)

uuid_entry()

uuid_entry(string $name, Uuid|string|null $value[, Metadata|null $metadata = null ]) : Uuid>)
Parameters
$name : string
$value : Uuid|string|null
$metadata : Metadata|null = null
Return values
Uuid>)

xml_entry()

xml_entry(string $name, DOMDocument|XMLDocument|string|null $value[, Metadata|null $metadata = null ]) : XMLDocument>)
Parameters
$name : string
$value : DOMDocument|XMLDocument|string|null
$metadata : Metadata|null = null
Tags
throws
InvalidArgumentException
Return values
XMLDocument>)

xml_element_entry()

xml_element_entry(string $name, DOMElement|Element|string|null $value[, Metadata|null $metadata = null ]) : Element>)
Parameters
$name : string
$value : DOMElement|Element|string|null
$metadata : Metadata|null = null
Tags
throws
InvalidArgumentException
Return values
Element>)

html_entry()

html_entry(string $name, HTMLDocument|string|null $value[, Metadata|null $metadata = null ]) : HTMLDocument>)
Parameters
$name : string
$value : HTMLDocument|string|null
$metadata : Metadata|null = null
Return values
HTMLDocument>)

html_element_entry()

html_element_entry(string $name, HTMLElement|string|null $value[, Metadata|null $metadata = null ]) : HTMLElement>)
Parameters
$name : string
$value : HTMLElement|string|null
$metadata : Metadata|null = null
Return values
HTMLElement>)

struct_entry()

struct_entry(string $name, TShape|null $value, StructureType<string|int, mixed>|Type<string|int, TShape$type[, Metadata|null $metadata = null ]) : TShape>)
Parameters
$name : string
$value : TShape|null
$type : StructureType<string|int, mixed>|Type<string|int, TShape>
$metadata : Metadata|null = null
Tags
template
Return values
TShape>)

structure_entry()

structure_entry(string $name, TShape|null $value, StructureType<string|int, mixed>|Type<string|int, TShape$type[, Metadata|null $metadata = null ]) : TShape>)
Parameters
$name : string
$value : TShape|null
$type : StructureType<string|int, mixed>|Type<string|int, TShape>
$metadata : Metadata|null = null
Tags
template
Return values
TShape>)

list_entry()

list_entry(string $name, null|array<int, mixed> $value, Type<string|int, mixed> $type[, Metadata|null $metadata = null ]) : Entry)
Parameters
$name : string
$value : null|array<int, mixed>
$type : Type<string|int, mixed>
$metadata : Metadata|null = null
Return values
Entry)

map_entry()

map_entry(string $name, array<string|int, mixed>|null $value, Type<string|int, mixed> $mapType[, Metadata|null $metadata = null ]) : Entry>)
Parameters
$name : string
$value : array<string|int, mixed>|null
$mapType : Type<string|int, mixed>
$metadata : Metadata|null = null
Return values
Entry>)

rows_partitioned()

rows_partitioned(array<string|int, Row$rows, array<string|int, Partition|string>|Partitions $partitions) : Rows
Parameters
$rows : array<string|int, Row>
$partitions : array<string|int, Partition|string>|Partitions
Return values
Rows

mask_columns()

mask_columns([array<int, string> $columns = [] ][, string $mask = '******' ]) : MaskColumns
Parameters
$columns : array<int, string> = []
$mask : string = '******'
Return values
MaskColumns

when()

when(mixed $condition, mixed $then[, mixed $else = null ]) : When
Parameters
$condition : mixed
$then : mixed
$else : mixed = null
Return values
When

cast()

cast(mixed $value, Type<string|int, mixed>|string $type) : Cast
Parameters
$value : mixed
$type : Type<string|int, mixed>|string
Return values
Cast

call()

Calls a user-defined function with the given parameters.

call(callable|ScalarFunction $callable[, array<string|int, mixed> $parameters = [] ][, null|Type<string|int, mixed> $return_type = null ]) : CallUserFunc
Parameters
$callable : callable|ScalarFunction
$parameters : array<string|int, mixed> = []
$return_type : null|Type<string|int, mixed> = null
Return values
CallUserFunc

array_expand()

Expands each value into entry, if there are more than one value, multiple rows will be created.

array_expand(ScalarFunction $function[, ArrayExpand $expand = ArrayExpand::VALUES ]) : ArrayExpand

Array keys are ignored, only values are used to create new rows.

Before: +--+-------------------+ |id| array| +--+-------------------+ | 1|{"a":1,"b":2,"c":3}| +--+-------------------+

After: +--+--------+ |id|expanded| +--+--------+ | 1| 1| | 1| 2| | 1| 3| +--+--------+

Parameters
$function : ScalarFunction
$expand : ArrayExpand = ArrayExpand::VALUES
Return values
ArrayExpand

array_to_row()

array_to_row(array<string|int, array<string|int, mixed>>|array<string|int, mixed|string> $data[, Hydrator $hydrator = new AdaptiveRowHydrator() ][, array<string|int, Partition>|Partitions $partitions = [] ][, null|Schema $schema = null ]) : Row
Parameters
$data : array<string|int, array<string|int, mixed>>|array<string|int, mixed|string>
$hydrator : Hydrator = new AdaptiveRowHydrator()
$partitions : array<string|int, Partition>|Partitions = []
$schema : null|Schema = null
Return values
Row

array_to_rows()

array_to_rows(array<string|int, array<string|int, mixed>>|array<string|int, mixed|string> $data[, Hydrator $hydrator = new AdaptiveRowHydrator() ][, array<string|int, Partition>|Partitions $partitions = [] ][, null|Schema $schema = null ]) : Rows
Parameters
$data : array<string|int, array<string|int, mixed>>|array<string|int, mixed|string>
$hydrator : Hydrator = new AdaptiveRowHydrator()
$partitions : array<string|int, Partition>|Partitions = []
$schema : null|Schema = null
Return values
Rows

schema_to_json()

schema_to_json(Schema $schema[, bool $pretty = false ]) : string
Parameters
$schema : Schema
$pretty : bool = false
Return values
string

schema_from_json()

schema_from_json(string $schema) : Schema
Parameters
$schema : string
Return values
Schema

schema_metadata()

schema_metadata([array<string, array<string|int, bool|float|int|string>|bool|float|int|string> $metadata = [] ]) : Metadata
Parameters
$metadata : array<string, array<string|int, bool|float|int|string>|bool|float|int|string> = []
Return values
Metadata

map_schema()

map_schema(string $name, MapType|Type $type[, bool $nullable = false ][, Metadata|null $metadata = null ]) : MapDefinition<TKey, TValue>
Parameters
$name : string
$type : MapType|Type
$nullable : bool = false
$metadata : Metadata|null = null
Tags
template
Return values
MapDefinition<TKey, TValue>

list_schema()

list_schema(string $name, ListType<string|int, T>|Type<string|int, array<int, T>> $type[, bool $nullable = false ][, Metadata|null $metadata = null ]) : ListDefinition<string|int, T>
Parameters
$name : string
$type : ListType<string|int, T>|Type<string|int, array<int, T>>
$nullable : bool = false
$metadata : Metadata|null = null
Tags
template
Return values
ListDefinition<string|int, T>

enum_schema()

enum_schema(string $name, T> $type[, bool $nullable = false ][, Metadata|null $metadata = null ]) : EnumDefinition<string|int, T>
Parameters
$name : string
$type : T>
$nullable : bool = false
$metadata : Metadata|null = null
Tags
template
Return values
EnumDefinition<string|int, T>

structure_schema()

structure_schema(string $name, StructureType<string|int, T>|Type<string|int, array<string, T>> $type[, bool $nullable = false ][, Metadata|null $metadata = null ]) : StructureDefinition<string|int, T>
Parameters
$name : string
$type : StructureType<string|int, T>|Type<string|int, array<string, T>>
$nullable : bool = false
$metadata : Metadata|null = null
Tags
template
Return values
StructureDefinition<string|int, T>

union_schema()

union_schema(string $name, Type<string|int, mixed>|UnionType<mixed, mixed> $type[, bool $nullable = false ][, Metadata|null $metadata = null ]) : UnionDefinition
Parameters
$name : string
$type : Type<string|int, mixed>|UnionType<mixed, mixed>
$nullable : bool = false
$metadata : Metadata|null = null
Return values
UnionDefinition

definition_from_array()

Create a Definition from an array representation.

definition_from_array(array<string|int, mixed> $definition) : Definition<string|int, mixed>
Parameters
$definition : array<string|int, mixed>
Return values
Definition<string|int, mixed>

definition_from_type()

Create a Definition from a Type.

definition_from_type(string|Reference $ref, Type<string|int, mixed> $type[, bool $nullable = false ][, Metadata|null $metadata = null ]) : Definition<string|int, mixed>
Parameters
$ref : string|Reference
$type : Type<string|int, mixed>
$nullable : bool = false
$metadata : Metadata|null = null
Return values
Definition<string|int, mixed>

execution_strict()

In this mode, functions throws exceptions if the given entry is not found or passed parameters are invalid.

execution_strict() : ExecutionMode
Return values
ExecutionMode

print_rows()

print_rows(Rows $rows[, int|bool $truncate = false ][, Formatter|null $formatter = null ]) : string
Parameters
$rows : Rows
$truncate : int|bool = false
$formatter : Formatter|null = null
Return values
string

is_type()

is_type(array<string|int, string|Type<string|int, mixed>>|Type<string|int, mixed> $type, mixed $value) : bool
Parameters
$type : array<string|int, string|Type<string|int, mixed>>|Type<string|int, mixed>
$value : mixed
Return values
bool

date_interval_to_milliseconds()

date_interval_to_milliseconds(DateInterval $interval) : int
Parameters
$interval : DateInterval
Return values
int

date_interval_to_seconds()

date_interval_to_seconds(DateInterval $interval) : int
Parameters
$interval : DateInterval
Return values
int

date_interval_to_microseconds()

date_interval_to_microseconds(DateInterval $interval) : int
Parameters
$interval : DateInterval
Return values
int

retry_on_exception_types()

retry_on_exception_types(array<string|int, Throwable>$exception_types, int $limit) : OnExceptionTypes
Parameters
$exception_types : array<string|int, Throwable>>
$limit : int
Return values
OnExceptionTypes

delay_jitter()

delay_jitter(DelayFactory $delay, float $jitter_factor) : Jitter
Parameters
$delay : DelayFactory
$jitter_factor : float

a value between 0 and 1 representing the maximum percentage of jitter to apply

Return values
Jitter

duration_milliseconds()

duration_milliseconds(int $milliseconds) : Duration
Parameters
$milliseconds : int
Return values
Duration

duration_microseconds()

duration_microseconds(int $microseconds) : Duration
Parameters
$microseconds : int
Return values
Duration

clock()

clock([string $time_zone = 'UTC' ]) : ClockInterface
Parameters
$time_zone : string = 'UTC'
Return values
ClockInterface
On this page

Search results