functions.php
Functions
df()
Alias for data_frame() : Flow.
df([Config|ConfigBuilder|null $config = null ]) : Flow
Parameters
- $config : Config|ConfigBuilder|null = null
Return values
Flowdata_frame()
data_frame([Config|ConfigBuilder|null $config = null ]) : Flow
Parameters
- $config : Config|ConfigBuilder|null = null
Return values
Flowfrom_rows()
from_rows(Rows ...$rows) : RowsExtractor
Parameters
- $rows : Rows
Return values
RowsExtractorfrom_path_partitions()
from_path_partitions(Path|string $path) : PathPartitionsExtractor
Parameters
- $path : Path|string
Return values
PathPartitionsExtractorfrom_array()
from_array(iterable<string|int, mixed> $array[, null|Schema $schema = null ]) : ArrayExtractor
Parameters
- $array : iterable<string|int, mixed>
- $schema : null|Schema = null
-
- @deprecated use withSchema() method instead
Return values
ArrayExtractorfrom_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
CacheExtractorfrom_all()
from_all(Extractor ...$extractors) : ChainExtractor
Parameters
- $extractors : Extractor
Return values
ChainExtractorfrom_memory()
from_memory(Memory $memory) : MemoryExtractor
Parameters
- $memory : Memory
Return values
MemoryExtractorfiles()
files(string|Path $directory) : FilesExtractor
Parameters
- $directory : string|Path
Return values
FilesExtractorfilesystem_cache()
filesystem_cache([Path|string|null $cache_dir = null ][, Filesystem $filesystem = new NativeLocalFilesystem() ][, Serializer $serializer = new NativePHPSerializer() ]) : FilesystemCache
Parameters
- $cache_dir : Path|string|null = null
- $filesystem : Filesystem = new NativeLocalFilesystem()
- $serializer : Serializer = new NativePHPSerializer()
Return values
FilesystemCachechunks_from()
chunks_from(Extractor $extractor, int<1, max> $chunk_size) : ChunkExtractor
Parameters
- $extractor : Extractor
- $chunk_size : int<1, max>
Return values
ChunkExtractorfrom_pipeline()
from_pipeline(Pipeline $pipeline) : PipelineExtractor
Parameters
- $pipeline : Pipeline
Return values
PipelineExtractorfrom_data_frame()
from_data_frame(DataFrame $data_frame) : DataFrameExtractor
Parameters
- $data_frame : DataFrame
Return values
DataFrameExtractorfrom_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
SequenceExtractorfrom_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
SequenceExtractorfrom_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
SequenceExtractorto_callable()
to_callable(callable $callable) : CallbackLoader
Parameters
- $callable : callable
Return values
CallbackLoaderto_memory()
to_memory(Memory $memory) : MemoryLoader
Parameters
- $memory : Memory
Return values
MemoryLoaderto_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
Return values
ArrayLoaderto_output()
to_output([int|bool $truncate = 20 ][, Output $output = Output::rows ][, Formatter $formatter = new FormatterAsciiTableFormatter() ][, SchemaFormatter $schemaFormatter = new ASCIISchemaFormatter() ]) : StreamLoader
Parameters
- $truncate : int|bool = 20
- $output : Output = Output::rows
- $formatter : Formatter = new FormatterAsciiTableFormatter()
- $schemaFormatter : SchemaFormatter = new ASCIISchemaFormatter()
Return values
StreamLoaderto_stderr()
to_stderr([int|bool $truncate = 20 ][, Output $output = Output::rows ][, Formatter $formatter = new FormatterAsciiTableFormatter() ][, SchemaFormatter $schemaFormatter = new ASCIISchemaFormatter() ]) : StreamLoader
Parameters
- $truncate : int|bool = 20
- $output : Output = Output::rows
- $formatter : Formatter = new FormatterAsciiTableFormatter()
- $schemaFormatter : SchemaFormatter = new ASCIISchemaFormatter()
Return values
StreamLoaderto_stdout()
to_stdout([int|bool $truncate = 20 ][, Output $output = Output::rows ][, Formatter $formatter = new FormatterAsciiTableFormatter() ][, SchemaFormatter $schemaFormatter = new ASCIISchemaFormatter() ]) : StreamLoader
Parameters
- $truncate : int|bool = 20
- $output : Output = Output::rows
- $formatter : Formatter = new FormatterAsciiTableFormatter()
- $schemaFormatter : SchemaFormatter = new ASCIISchemaFormatter()
Return values
StreamLoaderto_stream()
to_stream(string $uri[, int|bool $truncate = 20 ][, Output $output = Output::rows ][, string $mode = 'w' ][, Formatter $formatter = new FormatterAsciiTableFormatter() ][, SchemaFormatter $schemaFormatter = new ASCIISchemaFormatter() ]) : StreamLoader
Parameters
- $uri : string
- $truncate : int|bool = 20
- $output : Output = Output::rows
- $mode : string = 'w'
- $formatter : Formatter = new FormatterAsciiTableFormatter()
- $schemaFormatter : SchemaFormatter = new ASCIISchemaFormatter()
Return values
StreamLoaderto_transformation()
to_transformation(Transformer|Transformation $transformer, Loader $loader) : TransformerLoader
Parameters
- $transformer : Transformer|Transformation
- $loader : Loader
Return values
TransformerLoaderto_branch()
to_branch(ScalarFunction $condition, Loader $loader) : BranchingLoader
Parameters
- $condition : ScalarFunction
- $loader : Loader
Return values
BranchingLoaderbool_entry()
bool_entry(string $name, bool|null $value[, Metadata|null $metadata = null ]) : BooleanEntry
Parameters
- $name : string
- $value : bool|null
- $metadata : Metadata|null = null
Return values
BooleanEntryboolean_entry()
boolean_entry(string $name, bool|null $value[, Metadata|null $metadata = null ]) : BooleanEntry
Parameters
- $name : string
- $value : bool|null
- $metadata : Metadata|null = null
Return values
BooleanEntrydatetime_entry()
datetime_entry(string $name, DateTimeInterface|string|null $value[, Metadata|null $metadata = null ]) : DateTimeEntry
Parameters
- $name : string
- $value : DateTimeInterface|string|null
- $metadata : Metadata|null = null
Return values
DateTimeEntrytime_entry()
time_entry(string $name, DateInterval|string|null $value[, Metadata|null $metadata = null ]) : TimeEntry
Parameters
- $name : string
- $value : DateInterval|string|null
- $metadata : Metadata|null = null
Return values
TimeEntrydate_entry()
date_entry(string $name, DateTimeInterface|string|null $value[, Metadata|null $metadata = null ]) : DateEntry
Parameters
- $name : string
- $value : DateTimeInterface|string|null
- $metadata : Metadata|null = null
Return values
DateEntryint_entry()
int_entry(string $name, int|null $value[, Metadata|null $metadata = null ]) : IntegerEntry
Parameters
- $name : string
- $value : int|null
- $metadata : Metadata|null = null
Return values
IntegerEntryinteger_entry()
integer_entry(string $name, int|null $value[, Metadata|null $metadata = null ]) : IntegerEntry
Parameters
- $name : string
- $value : int|null
- $metadata : Metadata|null = null
Return values
IntegerEntryenum_entry()
enum_entry(string $name, UnitEnum|null $enum[, Metadata|null $metadata = null ]) : EnumEntry
Parameters
- $name : string
- $enum : UnitEnum|null
- $metadata : Metadata|null = null
Return values
EnumEntryfloat_entry()
float_entry(string $name, float|int|string|null $value[, Metadata|null $metadata = null ]) : FloatEntry
Parameters
- $name : string
- $value : float|int|string|null
- $metadata : Metadata|null = null
Return values
FloatEntryjson_entry()
json_entry(string $name, array<string|int, mixed>|string|null $data[, Metadata|null $metadata = null ]) : JsonEntry
Parameters
- $name : string
- $data : array<string|int, mixed>|string|null
- $metadata : Metadata|null = null
Return values
JsonEntryjson_object_entry()
json_object_entry(string $name, array<string|int, mixed>|string|null $data[, Metadata|null $metadata = null ]) : JsonEntry
Parameters
- $name : string
- $data : array<string|int, mixed>|string|null
- $metadata : Metadata|null = null
Tags
Return values
JsonEntrystr_entry()
str_entry(string $name, string|null $value[, Metadata|null $metadata = null ]) : StringEntry
Parameters
- $name : string
- $value : string|null
- $metadata : Metadata|null = null
Return values
StringEntrynull_entry()
This functions is an alias for creating string entry from null.
null_entry(string $name[, Metadata|null $metadata = null ]) : StringEntry
The main difference between using this function an simply str_entry with second argument null is that this function will also keep a note in the metadata that type might not be final. For example when we need to guess column type from rows because schema was not provided, and given column in the first row is null, it might still change once we get to the second row. That metadata is used to determine if string_entry was created from null or not.
By design flow assumes when guessing column type that null would be a string (the most flexible type).
Parameters
- $name : string
- $metadata : Metadata|null = null
Return values
StringEntrystring_entry()
string_entry(string $name, string|null $value[, Metadata|null $metadata = null ]) : StringEntry
Parameters
- $name : string
- $value : string|null
- $metadata : Metadata|null = null
Return values
StringEntryuuid_entry()
uuid_entry(string $name, Uuid|string|null $value[, Metadata|null $metadata = null ]) : UuidEntry
Parameters
Return values
UuidEntryxml_entry()
xml_entry(string $name, DOMDocument|string|null $value[, Metadata|null $metadata = null ]) : XMLEntry
Parameters
- $name : string
- $value : DOMDocument|string|null
- $metadata : Metadata|null = null
Return values
XMLEntryxml_element_entry()
xml_element_entry(string $name, DOMElement|string|null $value[, Metadata|null $metadata = null ]) : XMLElementEntry
Parameters
- $name : string
- $value : DOMElement|string|null
- $metadata : Metadata|null = null
Return values
XMLElementEntryentries()
entries(Entry<mixed, mixed> ...$entries) : Entries
Parameters
- $entries : Entry<mixed, mixed>
Return values
Entriesstruct_entry()
struct_entry(string $name, array<string|int, mixed>|null $value, StructureType $type[, Metadata|null $metadata = null ]) : StructureEntry
Parameters
- $name : string
- $value : array<string|int, mixed>|null
- $type : StructureType
- $metadata : Metadata|null = null
Return values
StructureEntrystructure_entry()
structure_entry(string $name, array<string|int, mixed>|null $value, StructureType $type[, Metadata|null $metadata = null ]) : StructureEntry
Parameters
- $name : string
- $value : array<string|int, mixed>|null
- $type : StructureType
- $metadata : Metadata|null = null
Return values
StructureEntrytype_structure()
type_structure(array<string, Type<string|int, mixed>> $elements[, bool $nullable = false ]) : StructureType
Parameters
- $elements : array<string, Type<string|int, mixed>>
- $nullable : bool = false
Return values
StructureTypelist_entry()
list_entry(string $name, array<int, mixed> $value, ListType $type) : ListEntry
Parameters
- $name : string
- $value : array<int, mixed>
- $type : ListType
Return values
ListEntrytype_list()
type_list(Type<string|int, mixed> $element[, bool $nullable = false ]) : ListType
Parameters
- $element : Type<string|int, mixed>
- $nullable : bool = false
Return values
ListTypetype_map()
type_map(StringType|IntegerType $key_type, Type<string|int, mixed> $value_type[, bool $nullable = false ]) : MapType
Parameters
- $key_type : StringType|IntegerType
- $value_type : Type<string|int, mixed>
- $nullable : bool = false
Return values
MapTypemap_entry()
map_entry(string $name, array<string|int, mixed>|null $value, MapType $mapType[, Metadata|null $metadata = null ]) : MapEntry
Parameters
- $name : string
- $value : array<string|int, mixed>|null
- $mapType : MapType
- $metadata : Metadata|null = null
Return values
MapEntrytype_json()
type_json([bool $nullable = false ]) : JsonType
Parameters
- $nullable : bool = false
Return values
JsonTypetype_datetime()
type_datetime([bool $nullable = false ]) : DateTimeType
Parameters
- $nullable : bool = false
Return values
DateTimeTypetype_date()
type_date([bool $nullable = false ]) : DateType
Parameters
- $nullable : bool = false
Return values
DateTypetype_time()
type_time([bool $nullable = false ]) : TimeType
Parameters
- $nullable : bool = false
Return values
TimeTypetype_xml()
type_xml([bool $nullable = false ]) : XMLType
Parameters
- $nullable : bool = false
Return values
XMLTypetype_xml_element()
type_xml_element([bool $nullable = false ]) : XMLElementType
Parameters
- $nullable : bool = false
Return values
XMLElementTypetype_uuid()
type_uuid([bool $nullable = false ]) : UuidType
Parameters
- $nullable : bool = false
Return values
UuidTypetype_int()
type_int([bool $nullable = false ]) : IntegerType
Parameters
- $nullable : bool = false
Return values
IntegerTypetype_integer()
type_integer([bool $nullable = false ]) : IntegerType
Parameters
- $nullable : bool = false
Return values
IntegerTypetype_string()
type_string([bool $nullable = false ]) : StringType
Parameters
- $nullable : bool = false
Return values
StringTypetype_float()
type_float([bool $nullable = false ][, int $precision = 6 ]) : FloatType
Parameters
- $nullable : bool = false
- $precision : int = 6
Return values
FloatTypetype_boolean()
type_boolean([bool $nullable = false ]) : BooleanType
Parameters
- $nullable : bool = false
Return values
BooleanTypetype_object()
type_object(class-string $class[, bool $nullable = false ]) : ObjectType
Parameters
- $class : class-string
- $nullable : bool = false
Return values
ObjectTypetype_resource()
type_resource([bool $nullable = false ]) : ResourceType
Parameters
- $nullable : bool = false
Return values
ResourceTypetype_array()
type_array([bool $empty = false ][, bool $nullable = false ]) : ArrayType
Parameters
- $empty : bool = false
- $nullable : bool = false
Return values
ArrayTypetype_callable()
type_callable([bool $nullable = false ]) : CallableType
Parameters
- $nullable : bool = false
Return values
CallableTypetype_null()
type_null() : NullType
Return values
NullTypetype_enum()
type_enum(UnitEnum> $class[, bool $nullable = false ]) : EnumType
Parameters
- $class : UnitEnum>
- $nullable : bool = false
Return values
EnumTyperow()
row(Entry<mixed, mixed> ...$entry) : Row
Parameters
- $entry : Entry<mixed, mixed>
Return values
Rowrows()
rows(Row ...$row) : Rows
Parameters
- $row : Row
Return values
Rowsrows_partitioned()
rows_partitioned(array<string|int, mixed> $rows, array<string|int, mixed>|Partitions $partitions) : Rows
Parameters
- $rows : array<string|int, mixed>
- $partitions : array<string|int, mixed>|Partitions
Return values
Rowscol()
An alias for `ref`.
col(string $entry) : EntryReference
Parameters
- $entry : string
Return values
EntryReferenceentry()
An alias for `ref`.
entry(string $entry) : EntryReference
Parameters
- $entry : string
Return values
EntryReferenceref()
ref(string $entry) : EntryReference
Parameters
- $entry : string
Return values
EntryReferencestructure_ref()
structure_ref(string $entry) : StructureFunctions
Parameters
- $entry : string
Return values
StructureFunctionslist_ref()
list_ref(string $entry) : ListFunctions
Parameters
- $entry : string
Return values
ListFunctionsrefs()
refs(string|Reference ...$entries) : References
Parameters
- $entries : string|Reference
Return values
Referencesoptional()
optional(ScalarFunction $function) : Optional
Parameters
- $function : ScalarFunction
Return values
Optionallit()
lit(mixed $value) : Literal
Parameters
- $value : mixed
Return values
Literalexists()
exists(ScalarFunction $ref) : Exists
Parameters
- $ref : ScalarFunction
Return values
Existswhen()
when(mixed $condition, mixed $then[, mixed $else = null ]) : When
Parameters
- $condition : mixed
- $then : mixed
- $else : mixed = null
Return values
Whenarray_get()
array_get(ScalarFunction $ref, ScalarFunction|string $path) : ArrayGet
Parameters
- $ref : ScalarFunction
- $path : ScalarFunction|string
Return values
ArrayGetarray_get_collection()
array_get_collection(ScalarFunction $ref, ScalarFunction|array<string|int, mixed> $keys) : ArrayGetCollection
Parameters
- $ref : ScalarFunction
- $keys : ScalarFunction|array<string|int, mixed>
Return values
ArrayGetCollectionarray_get_collection_first()
array_get_collection_first(ScalarFunction $ref, string ...$keys) : ArrayGetCollection
Parameters
- $ref : ScalarFunction
- $keys : string
Return values
ArrayGetCollectionarray_exists()
array_exists(ScalarFunction|array<string|int, mixed> $ref, ScalarFunction|string $path) : ArrayPathExists
Parameters
- $ref : ScalarFunction|array<string|int, mixed>
- $path : ScalarFunction|string
Return values
ArrayPathExistsarray_merge()
array_merge(ScalarFunction|array<string|int, mixed> $left, ScalarFunction|array<string|int, mixed> $right) : ArrayMerge
Parameters
- $left : ScalarFunction|array<string|int, mixed>
- $right : ScalarFunction|array<string|int, mixed>
Return values
ArrayMergearray_merge_collection()
array_merge_collection(ScalarFunction|array<string|int, mixed> $array) : ArrayMergeCollection
Parameters
- $array : ScalarFunction|array<string|int, mixed>
Return values
ArrayMergeCollectionarray_key_rename()
array_key_rename(ScalarFunction $ref, ScalarFunction|string $path, ScalarFunction|string $newName) : ArrayKeyRename
Parameters
- $ref : ScalarFunction
- $path : ScalarFunction|string
- $newName : ScalarFunction|string
Return values
ArrayKeyRenamearray_keys_style_convert()
array_keys_style_convert(ScalarFunction $ref[, StringStyles|string $style = StringStyles::SNAKE ]) : ArrayKeysStyleConvert
Parameters
- $ref : ScalarFunction
- $style : StringStyles|string = StringStyles::SNAKE
Return values
ArrayKeysStyleConvertarray_sort()
array_sort(ScalarFunction $function[, ScalarFunction|Sort|null $sort_function = null ][, ScalarFunction|int|null $flags = null ][, ScalarFunction|bool $recursive = true ]) : ArraySort
Parameters
- $function : ScalarFunction
- $sort_function : ScalarFunction|Sort|null = null
- $flags : ScalarFunction|int|null = null
- $recursive : ScalarFunction|bool = true
Return values
ArraySortarray_reverse()
array_reverse(ScalarFunction|array<string|int, mixed> $function[, ScalarFunction|bool $preserveKeys = false ]) : ArrayReverse
Parameters
- $function : ScalarFunction|array<string|int, mixed>
- $preserveKeys : ScalarFunction|bool = false
Return values
ArrayReversenow()
now([DateTimeZone|ScalarFunction $time_zone = new DateTimeZone('UTC') ]) : Now
Parameters
- $time_zone : DateTimeZone|ScalarFunction = new DateTimeZone('UTC')
Return values
Nowbetween()
between(mixed $value, mixed $lower_bound, mixed $upper_bound[, ScalarFunction|Boundary $boundary = Boundary::LEFT_INCLUSIVE ]) : Between
Parameters
- $value : mixed
- $lower_bound : mixed
- $upper_bound : mixed
- $boundary : ScalarFunction|Boundary = Boundary::LEFT_INCLUSIVE
Return values
Betweento_date_time()
to_date_time(mixed $ref[, ScalarFunction|string $format = 'Y-m-d H:i:s' ][, ScalarFunction|DateTimeZone $timeZone = new DateTimeZone('UTC') ]) : ToDateTime
Parameters
- $ref : mixed
- $format : ScalarFunction|string = 'Y-m-d H:i:s'
- $timeZone : ScalarFunction|DateTimeZone = new DateTimeZone('UTC')
Return values
ToDateTimeto_date()
to_date(mixed $ref[, ScalarFunction|string $format = 'Y-m-d' ][, ScalarFunction|DateTimeZone $timeZone = new DateTimeZone('UTC') ]) : ToDate
Parameters
- $ref : mixed
- $format : ScalarFunction|string = 'Y-m-d'
- $timeZone : ScalarFunction|DateTimeZone = new DateTimeZone('UTC')
Return values
ToDatedate_time_format()
date_time_format(ScalarFunction $ref, string $format) : DateTimeFormat
Parameters
- $ref : ScalarFunction
- $format : string
Return values
DateTimeFormatsplit()
split(ScalarFunction|string $value, ScalarFunction|string $separator[, ScalarFunction|int $limit = PHP_INT_MAX ]) : Split
Parameters
- $value : ScalarFunction|string
- $separator : ScalarFunction|string
- $limit : ScalarFunction|int = PHP_INT_MAX
Return values
Splitcombine()
combine(ScalarFunction|array<string|int, mixed> $keys, ScalarFunction|array<string|int, mixed> $values) : Combine
Parameters
- $keys : ScalarFunction|array<string|int, mixed>
- $values : ScalarFunction|array<string|int, mixed>
Return values
Combineconcat()
Concat all values. If you want to concatenate values with separator use concat_ws function.
concat(ScalarFunction|string ...$functions) : Concat
Parameters
- $functions : ScalarFunction|string
Return values
Concatconcat_ws()
Concat all values with separator.
concat_ws(ScalarFunction|string $separator, ScalarFunction|string ...$functions) : ConcatWithSeparator
Parameters
- $separator : ScalarFunction|string
- $functions : ScalarFunction|string
Return values
ConcatWithSeparatorhash()
hash(mixed $value[, Algorithm $algorithm = new NativePHPHash() ]) : Hash
Parameters
- $value : mixed
- $algorithm : Algorithm = new NativePHPHash()
Return values
Hashcast()
cast(mixed $value, string|Type<string|int, mixed> $type[, Options|null $options = null ]) : Cast
Parameters
Return values
Castcoalesce()
coalesce(ScalarFunction ...$values) : Coalesce
Parameters
- $values : ScalarFunction
Return values
Coalescecount()
count([EntryReference|null $function = null ]) : Count
Parameters
- $function : EntryReference|null = null
Return values
Countarray_unpack()
Unpacks each element of an array into a new entry, using the array key as the entry name.
array_unpack(ScalarFunction|array<string|int, mixed> $array[, ScalarFunction|array<string|int, mixed> $skip_keys = [] ][, ScalarFunction|string|null $entry_prefix = null ]) : ArrayUnpack
Before: +--+-------------------+ |id| array| +--+-------------------+ | 1|{"a":1,"b":2,"c":3}| | 2|{"d":4,"e":5,"f":6}| +--+-------------------+
After: +--+-----+-----+-----+-----+-----+ |id|arr.b|arr.c|arr.d|arr.e|arr.f| +--+-----+-----+-----+-----+-----+ | 1| 2| 3| | | | | 2| | | 4| 5| 6| +--+-----+-----+-----+-----+-----+
Parameters
- $array : ScalarFunction|array<string|int, mixed>
- $skip_keys : ScalarFunction|array<string|int, mixed> = []
- $entry_prefix : ScalarFunction|string|null = null
Return values
ArrayUnpackarray_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
ArrayExpandsize()
size(mixed $value) : Size
Parameters
- $value : mixed
Return values
Sizeuuid_v4()
uuid_v4() : Uuid
Return values
Uuiduuid_v7()
uuid_v7([ScalarFunction|DateTimeInterface|null $value = null ]) : Uuid
Parameters
- $value : ScalarFunction|DateTimeInterface|null = null
Return values
Uuidulid()
ulid([ScalarFunction|string|null $value = null ]) : Ulid
Parameters
- $value : ScalarFunction|string|null = null
Return values
Ulidlower()
lower(ScalarFunction|string $value) : ToLower
Parameters
- $value : ScalarFunction|string
Return values
ToLowercapitalize()
capitalize(ScalarFunction|string $value) : Capitalize
Parameters
- $value : ScalarFunction|string
Return values
Capitalizeupper()
upper(ScalarFunction|string $value) : ToUpper
Parameters
- $value : ScalarFunction|string
Return values
ToUpperall()
all(ScalarFunction ...$functions) : All
Parameters
- $functions : ScalarFunction
Return values
Allany()
any(ScalarFunction ...$values) : Any
Parameters
- $values : ScalarFunction
Return values
Anynot()
not(ScalarFunction $value) : Not
Parameters
- $value : ScalarFunction
Return values
Notto_timezone()
to_timezone(ScalarFunction|DateTimeInterface $value, ScalarFunction|DateTimeZone|string $timeZone) : ToTimeZone
Parameters
- $value : ScalarFunction|DateTimeInterface
- $timeZone : ScalarFunction|DateTimeZone|string
Return values
ToTimeZoneignore_error_handler()
ignore_error_handler() : IgnoreError
Return values
IgnoreErrorskip_rows_handler()
skip_rows_handler() : SkipRows
Return values
SkipRowsthrow_error_handler()
throw_error_handler() : ThrowError
Return values
ThrowErrorregex_replace()
regex_replace(ScalarFunction|string $pattern, ScalarFunction|string $replacement, ScalarFunction|string $subject[, ScalarFunction|int|null $limit = null ]) : RegexReplace
Parameters
- $pattern : ScalarFunction|string
- $replacement : ScalarFunction|string
- $subject : ScalarFunction|string
- $limit : ScalarFunction|int|null = null
Return values
RegexReplaceregex_match_all()
regex_match_all(ScalarFunction|string $pattern, ScalarFunction|string $subject[, ScalarFunction|int $flags = 0 ][, ScalarFunction|int $offset = 0 ]) : RegexMatchAll
Parameters
- $pattern : ScalarFunction|string
- $subject : ScalarFunction|string
- $flags : ScalarFunction|int = 0
- $offset : ScalarFunction|int = 0
Return values
RegexMatchAllregex_match()
regex_match(ScalarFunction|string $pattern, ScalarFunction|string $subject[, ScalarFunction|int $flags = 0 ][, ScalarFunction|int $offset = 0 ]) : RegexMatch
Parameters
- $pattern : ScalarFunction|string
- $subject : ScalarFunction|string
- $flags : ScalarFunction|int = 0
- $offset : ScalarFunction|int = 0
Return values
RegexMatchregex()
regex(ScalarFunction|string $pattern, ScalarFunction|string $subject[, ScalarFunction|int $flags = 0 ][, ScalarFunction|int $offset = 0 ]) : Regex
Parameters
- $pattern : ScalarFunction|string
- $subject : ScalarFunction|string
- $flags : ScalarFunction|int = 0
- $offset : ScalarFunction|int = 0
Return values
Regexregex_all()
regex_all(ScalarFunction|string $pattern, ScalarFunction|string $subject[, ScalarFunction|int $flags = 0 ][, ScalarFunction|int $offset = 0 ]) : RegexAll
Parameters
- $pattern : ScalarFunction|string
- $subject : ScalarFunction|string
- $flags : ScalarFunction|int = 0
- $offset : ScalarFunction|int = 0
Return values
RegexAllsprintf()
sprintf(ScalarFunction|string $format, ScalarFunction|float|int|string|null ...$args) : Sprintf
Parameters
- $format : ScalarFunction|string
- $args : ScalarFunction|float|int|string|null
Return values
Sprintfsanitize()
sanitize(ScalarFunction|string $value[, ScalarFunction|string $placeholder = '*' ][, ScalarFunction|int|null $skipCharacters = null ]) : Sanitize
Parameters
- $value : ScalarFunction|string
- $placeholder : ScalarFunction|string = '*'
- $skipCharacters : ScalarFunction|int|null = null
Return values
Sanitizeround()
round(ScalarFunction|int|float $value[, ScalarFunction|int $precision = 2 ][, ScalarFunction|int $mode = PHP_ROUND_HALF_UP ]) : Round
Parameters
- $value : ScalarFunction|int|float
- $precision : ScalarFunction|int = 2
- $mode : ScalarFunction|int = PHP_ROUND_HALF_UP
Return values
Roundnumber_format()
number_format(ScalarFunction|int|float $value[, ScalarFunction|int $decimals = 2 ][, ScalarFunction|string $decimal_separator = '.' ][, ScalarFunction|string $thousands_separator = ',' ]) : NumberFormat
Parameters
- $value : ScalarFunction|int|float
- $decimals : ScalarFunction|int = 2
- $decimal_separator : ScalarFunction|string = '.'
- $thousands_separator : ScalarFunction|string = ','
Return values
NumberFormatto_entry()
to_entry(string $name, array<string|int, mixed> $data[, EntryFactory $entryFactory = new EntryFactory() ]) : Entry<mixed, mixed>
Parameters
- $name : string
- $data : array<string|int, mixed>
- $entryFactory : EntryFactory = new EntryFactory()
Return values
Entry<mixed, mixed>array_to_row()
array_to_row(array<string|int, array<string|int, mixed>>|array<string|int, mixed|string> $data[, EntryFactory $entryFactory = new EntryFactory() ][, array<string|int, Partition>|Partitions $partitions = [] ][, Schema|null $schema = null ]) : Row
Parameters
- $data : array<string|int, array<string|int, mixed>>|array<string|int, mixed|string>
- $entryFactory : EntryFactory = new EntryFactory()
- $partitions : array<string|int, Partition>|Partitions = []
- $schema : Schema|null = null
Return values
Rowarray_to_rows()
array_to_rows(array<string|int, array<string|int, mixed>>|array<string|int, mixed|string> $data[, EntryFactory $entryFactory = new EntryFactory() ][, array<string|int, Partition>|Partitions $partitions = [] ][, Schema|null $schema = null ]) : Rows
Parameters
- $data : array<string|int, array<string|int, mixed>>|array<string|int, mixed|string>
- $entryFactory : EntryFactory = new EntryFactory()
- $partitions : array<string|int, Partition>|Partitions = []
- $schema : Schema|null = null
Return values
Rowsrank()
rank() : Rank
Return values
Rankdens_rank()
dens_rank() : DenseRank
Return values
DenseRankdense_rank()
dense_rank() : DenseRank
Return values
DenseRankaverage()
average(EntryReference|string $ref[, int $scale = 2 ][, Rounding $rounding = Rounding::HALF_UP ]) : Average
Parameters
- $ref : EntryReference|string
- $scale : int = 2
- $rounding : Rounding = Rounding::HALF_UP
Return values
Averagegreatest()
greatest(mixed ...$values) : Greatest
Parameters
- $values : mixed
Return values
Greatestleast()
least(mixed ...$values) : Least
Parameters
- $values : mixed
Return values
Leastcollect()
collect(EntryReference|string $ref) : Collect
Parameters
- $ref : EntryReference|string
Return values
Collectstring_agg()
string_agg(EntryReference|string $ref[, string $separator = ', ' ][, SortOrder|null $sort = null ]) : StringAggregate
Parameters
- $ref : EntryReference|string
- $separator : string = ', '
- $sort : SortOrder|null = null
Return values
StringAggregatecollect_unique()
collect_unique(EntryReference|string $ref) : CollectUnique
Parameters
- $ref : EntryReference|string
Return values
CollectUniquewindow()
window() : Window
Return values
Windowsum()
sum(EntryReference|string $ref) : Sum
Parameters
- $ref : EntryReference|string
Return values
Sumfirst()
first(EntryReference|string $ref) : First
Parameters
- $ref : EntryReference|string
Return values
Firstlast()
last(EntryReference|string $ref) : Last
Parameters
- $ref : EntryReference|string
Return values
Lastmax()
max(EntryReference|string $ref) : Max
Parameters
- $ref : EntryReference|string
Return values
Maxmin()
min(EntryReference|string $ref) : Min
Parameters
- $ref : EntryReference|string
Return values
Minrow_number()
row_number() : RowNumber
Return values
RowNumberschema()
schema(Definition ...$definitions) : Schema
Parameters
- $definitions : Definition
Return values
Schemaschema_to_json()
schema_to_json(Schema $schema[, bool $pretty = false ]) : string
Parameters
- $schema : Schema
- $pretty : bool = false
Return values
stringschema_from_json()
schema_from_json(string $schema) : Schema
Parameters
- $schema : string
Return values
Schemaschema_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
Metadataint_schema()
Alias for `int_schema`.
int_schema(string $name[, bool $nullable = false ][, Metadata|null $metadata = null ]) : Definition
Parameters
- $name : string
- $nullable : bool = false
- $metadata : Metadata|null = null
Return values
Definitioninteger_schema()
integer_schema(string $name[, bool $nullable = false ][, Metadata|null $metadata = null ]) : Definition
Parameters
- $name : string
- $nullable : bool = false
- $metadata : Metadata|null = null
Return values
Definitionstr_schema()
Alias for `string_schema`.
str_schema(string $name[, bool $nullable = false ][, Metadata|null $metadata = null ]) : Definition
Parameters
- $name : string
- $nullable : bool = false
- $metadata : Metadata|null = null
Return values
Definitionstring_schema()
string_schema(string $name[, bool $nullable = false ][, Metadata|null $metadata = null ]) : Definition
Parameters
- $name : string
- $nullable : bool = false
- $metadata : Metadata|null = null
Return values
Definitionbool_schema()
bool_schema(string $name[, bool $nullable = false ][, Metadata|null $metadata = null ]) : Definition
Parameters
- $name : string
- $nullable : bool = false
- $metadata : Metadata|null = null
Return values
Definitionfloat_schema()
float_schema(string $name[, bool $nullable = false ][, int $precision = 6 ][, Metadata|null $metadata = null ]) : Definition
Parameters
- $name : string
- $nullable : bool = false
- $precision : int = 6
- $metadata : Metadata|null = null
Return values
Definitionmap_schema()
map_schema(string $name, MapType $type[, Metadata|null $metadata = null ]) : Definition
Parameters
Return values
Definitionlist_schema()
list_schema(string $name, ListType $type[, Metadata|null $metadata = null ]) : Definition
Parameters
Return values
Definitionenum_schema()
enum_schema(string $name, UnitEnum> $type[, bool $nullable = false ][, Metadata|null $metadata = null ]) : Definition
Parameters
- $name : string
- $type : UnitEnum>
- $nullable : bool = false
- $metadata : Metadata|null = null
Return values
Definitionnull_schema()
null_schema(string $name[, Metadata|null $metadata = null ]) : Definition
Parameters
- $name : string
- $metadata : Metadata|null = null
Return values
Definitiondatetime_schema()
datetime_schema(string $name[, bool $nullable = false ][, Metadata|null $metadata = null ]) : Definition
Parameters
- $name : string
- $nullable : bool = false
- $metadata : Metadata|null = null
Return values
Definitiontime_schema()
time_schema(string $name[, bool $nullable = false ][, Metadata|null $metadata = null ]) : Definition
Parameters
- $name : string
- $nullable : bool = false
- $metadata : Metadata|null = null
Return values
Definitiondate_schema()
date_schema(string $name[, bool $nullable = false ][, Metadata|null $metadata = null ]) : Definition
Parameters
- $name : string
- $nullable : bool = false
- $metadata : Metadata|null = null
Return values
Definitionjson_schema()
json_schema(string $name[, bool $nullable = false ][, Metadata|null $metadata = null ]) : Definition
Parameters
- $name : string
- $nullable : bool = false
- $metadata : Metadata|null = null
Return values
Definitionxml_schema()
xml_schema(string $name[, bool $nullable = false ][, Metadata|null $metadata = null ]) : Definition
Parameters
- $name : string
- $nullable : bool = false
- $metadata : Metadata|null = null
Return values
Definitionxml_element_schema()
xml_element_schema(string $name[, bool $nullable = false ][, Metadata|null $metadata = null ]) : Definition
Parameters
- $name : string
- $nullable : bool = false
- $metadata : Metadata|null = null
Return values
Definitionstruct_schema()
struct_schema(string $name, StructureType $type[, Metadata|null $metadata = null ]) : Definition
Parameters
- $name : string
- $type : StructureType
- $metadata : Metadata|null = null
Return values
Definitionstructure_schema()
structure_schema(string $name, StructureType $type[, Metadata|null $metadata = null ]) : Definition
Parameters
- $name : string
- $type : StructureType
- $metadata : Metadata|null = null
Return values
Definitionuuid_schema()
uuid_schema(string $name[, bool $nullable = false ][, Metadata|null $metadata = null ]) : Definition
Parameters
- $name : string
- $nullable : bool = false
- $metadata : Metadata|null = null
Return values
Definitionexecution_context()
execution_context([Config|null $config = null ]) : FlowContext
Parameters
- $config : Config|null = null
Return values
FlowContextflow_context()
flow_context([Config|null $config = null ]) : FlowContext
Parameters
- $config : Config|null = null
Return values
FlowContextconfig()
config() : Config
Return values
Configconfig_builder()
config_builder() : ConfigBuilder
Return values
ConfigBuilderoverwrite()
overwrite() : SaveMode
Return values
SaveModeignore()
ignore() : SaveMode
Return values
SaveModeexception_if_exists()
exception_if_exists() : SaveMode
Return values
SaveModeappend()
append() : SaveMode
Return values
SaveModeget_type()
get_type(mixed $value) : Type<string|int, mixed>
Parameters
- $value : mixed
Return values
Type<string|int, mixed>print_schema()
print_schema(Schema $schema[, SchemaFormatter|null $formatter = null ]) : string
Parameters
- $schema : Schema
- $formatter : SchemaFormatter|null = null
Return values
stringprint_rows()
print_rows(Rows $rows[, int|bool $truncate = false ][, Formatter|null $formatter = null ]) : string
Parameters
Return values
stringidentical()
identical(Reference|string $left, Reference|string $right) : Identical
Parameters
Return values
Identicalequal()
equal(Reference|string $left, Reference|string $right) : Equal
Parameters
Return values
Equalcompare_all()
compare_all(Comparison ...$comparisons) : All
Parameters
- $comparisons : Comparison
Return values
Allcompare_any()
compare_any(Comparison ...$comparisons) : Any
Parameters
- $comparisons : Comparison
Return values
Anyjoin_on()
join_on(array<string|int, mixed>|Comparison $comparisons[, string $join_prefix = '' ]) : Expression
Parameters
- $comparisons : array<string|int, mixed>|Comparison
- $join_prefix : string = ''
Return values
Expressioncompare_entries_by_name()
compare_entries_by_name([Order $order = TransformerOrderEntriesOrder::ASC ]) : Comparator
Parameters
- $order : Order = TransformerOrderEntriesOrder::ASC
Return values
Comparatorcompare_entries_by_name_desc()
compare_entries_by_name_desc() : Comparator
Return values
Comparatorcompare_entries_by_type()
compare_entries_by_type([array<string|int, mixed> $priorities = TransformerOrderEntriesTypePriorities::PRIORITIES ][, Order $order = TransformerOrderEntriesOrder::ASC ]) : Comparator
Parameters
- $priorities : array<string|int, mixed> = TransformerOrderEntriesTypePriorities::PRIORITIES
- $order : Order = TransformerOrderEntriesOrder::ASC
Return values
Comparatorcompare_entries_by_type_desc()
compare_entries_by_type_desc([array<string|int, mixed> $priorities = TransformerOrderEntriesTypePriorities::PRIORITIES ]) : Comparator
Parameters
- $priorities : array<string|int, mixed> = TransformerOrderEntriesTypePriorities::PRIORITIES
Return values
Comparatorcompare_entries_by_type_and_name()
compare_entries_by_type_and_name([array<string|int, mixed> $priorities = TransformerOrderEntriesTypePriorities::PRIORITIES ][, Order $order = TransformerOrderEntriesOrder::ASC ]) : Comparator
Parameters
- $priorities : array<string|int, mixed> = TransformerOrderEntriesTypePriorities::PRIORITIES
- $order : Order = TransformerOrderEntriesOrder::ASC
Return values
Comparatoris_type()
is_type(array<string|int, string|Type<string|int, mixed>>|Type<string|int, mixed> $type, mixed $value) : bool
Parameters
Return values
boolgenerate_random_string()
generate_random_string([int $length = 32 ][, NativePHPRandomValueGenerator $generator = new NativePHPRandomValueGenerator() ]) : string
Parameters
- $length : int = 32
- $generator : NativePHPRandomValueGenerator = new NativePHPRandomValueGenerator()
Return values
stringgenerate_random_int()
generate_random_int([int $start = PHP_INT_MIN ][, int $end = PHP_INT_MAX ][, NativePHPRandomValueGenerator $generator = new NativePHPRandomValueGenerator() ]) : int
Parameters
- $start : int = PHP_INT_MIN
- $end : int = PHP_INT_MAX
- $generator : NativePHPRandomValueGenerator = new NativePHPRandomValueGenerator()
Return values
intrandom_string()
random_string(int|ScalarFunction $length[, RandomValueGenerator $generator = new NativePHPRandomValueGenerator() ]) : RandomString
Parameters
- $length : int|ScalarFunction
- $generator : RandomValueGenerator = new NativePHPRandomValueGenerator()
Return values
RandomStringdom_element_to_string()
dom_element_to_string(DOMElement $element[, bool $format_output = false ][, bool $preserver_white_space = false ]) : string|false
Parameters
- $element : DOMElement
- $format_output : bool = false
- $preserver_white_space : bool = false
Return values
string|falsedate_interval_to_milliseconds()
date_interval_to_milliseconds(DateInterval $interval) : int
Parameters
- $interval : DateInterval
Return values
intdate_interval_to_seconds()
date_interval_to_seconds(DateInterval $interval) : int
Parameters
- $interval : DateInterval
Return values
intdate_interval_to_microseconds()
date_interval_to_microseconds(DateInterval $interval) : int
Parameters
- $interval : DateInterval
Return values
intcaster_options()
caster_options() : Options
Return values
Optionscaster()
Advanced type casting mechanism.
caster([Options|null $options = null ]) : Caster
Usage:
caster()->to(type_float(precision: 2))->value("1.1234") // 1.12
Options can be also passed to "to" function to override default options.
caster()->to(type_float(precision: 2), caster_options())->value("1.1234") // 1.12
Parameters
- $options : Options|null = null
Return values
Casterwith_entry()
with_entry(string $name, ScalarFunction $function) : WithEntry
Parameters
- $name : string
- $function : ScalarFunction
Return values
WithEntryconstraint_unique()
constraint_unique(string $reference, string ...$references) : UniqueConstraint
Parameters
- $reference : string
- $references : string
Return values
UniqueConstraintanalyze()
analyze() : Analyze