Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 512 Bytes

File metadata and controls

18 lines (13 loc) · 512 Bytes

Map

Quick Row transformations are available through DataFrame::map function

<?php 

data_frame()
    ->read(from_array(...))
    ->map(fn (Row $row) => $row->add(bool_entry('odd', $row->valueOf('id') % 2 === 0)))
    ->write($loader)
    ->run();

It's the easiest but also the least performant way to transform data. Unless there is no better way please try to avoid using map as it can't be automatically optimized by the engine.