Skip to content
Search

Map

Back

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.

Found a typo or an outdated section? Edit this page on GitHub


Contributors

Built in the open.

Join us on GitHub
scroll back to top