Skip to content

Commit b905973

Browse files
committed
Removed redundant transformer, enabled batch_by example
1 parent 1dae759 commit b905973

File tree

7 files changed

+26
-107
lines changed

7 files changed

+26
-107
lines changed

examples/topics/data_frame/batch_by/code.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
use function Flow\ETL\DSL\{data_frame, from_array, to_stream};
5+
use function Flow\ETL\DSL\{constraint_sorted_by, data_frame, from_array, ref, to_stream};
66

77
require __DIR__ . '/vendor/autoload.php';
88

@@ -14,6 +14,7 @@
1414
['order_id' => 2, 'item' => 'Gizmo', 'qty' => 3],
1515
['order_id' => 3, 'item' => 'Widget', 'qty' => 1],
1616
]))
17+
->constrain(constraint_sorted_by(ref('order_id')))
1718
->batchBy('order_id')
1819
->write(to_stream(__DIR__ . '/output.txt', truncate: false))
1920
->run();

examples/topics/data_frame/batch_by/composer.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
5.23 KB
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
+----------+--------+-----+
2+
| order_id | item | qty |
3+
+----------+--------+-----+
4+
| 1 | Widget | 2 |
5+
| 1 | Gadget | 1 |
6+
+----------+--------+-----+
7+
2 rows
8+
+----------+--------+-----+
9+
| order_id | item | qty |
10+
+----------+--------+-----+
11+
| 2 | Widget | 5 |
12+
| 2 | Gizmo | 3 |
13+
+----------+--------+-----+
14+
2 rows
15+
+----------+--------+-----+
16+
| order_id | item | qty |
17+
+----------+--------+-----+
18+
| 3 | Widget | 1 |
19+
+----------+--------+-----+
20+
1 rows

examples/topics/data_frame/batch_by/skip.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/core/etl/src/Flow/ETL/Transformer/GroupToArrayTransformer.php

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/core/etl/tests/Flow/ETL/Tests/Unit/Transformer/GroupToArrayTransformerTest.php

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)