Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JSONL write support #1442

Merged
merged 2 commits into from
Feb 3, 2025
Merged

Conversation

jmortlock
Copy link
Contributor

@jmortlock jmortlock commented Feb 3, 2025

Change Log

Added

  • Added support for JSONL - https://github.com/jmortlock/flow/pull/new/add-jsonl-support

Fixed

Changed

Removed

Deprecated

Security


Description

Resolves: #1439

Copy link
Contributor

github-actions bot commented Feb 3, 2025

Flow PHP - Benchmarks

Results of the benchmarks from this PR are compared with the results from 1.x branch.

Extractors
+-----------------------+-------------------+------+-----+-----------------+------------------+-----------------+
| benchmark             | subject           | revs | its | mem_peak        | mode             | rstdev          |
+-----------------------+-------------------+------+-----+-----------------+------------------+-----------------+
| CSVExtractorBench     | bench_extract_10k | 1    | 3   | 4.792mb +0.01%  | 554.423ms -0.06% | ±0.31% -22.36%  |
| JsonExtractorBench    | bench_extract_10k | 1    | 3   | 4.865mb +0.01%  | 1.057s -1.44%    | ±0.34% +14.42%  |
| ParquetExtractorBench | bench_extract_10k | 1    | 3   | 86.306mb +0.00% | 898.283ms -1.11% | ±1.12% +102.96% |
| TextExtractorBench    | bench_extract_10k | 1    | 3   | 4.522mb +0.01%  | 35.864ms +0.23%  | ±0.82% +40.14%  |
| XmlExtractorBench     | bench_extract_10k | 1    | 3   | 4.497mb +0.01%  | 611.554ms +1.93% | ±3.08% +169.20% |
+-----------------------+-------------------+------+-----+-----------------+------------------+-----------------+
Transformers
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| benchmark                   | subject                  | revs | its | mem_peak         | mode            | rstdev         |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| RenameEntryTransformerBench | bench_transform_10k_rows | 1    | 3   | 127.319mb +0.00% | 69.897ms -2.31% | ±2.14% +39.49% |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
Loaders
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| benchmark          | subject        | revs | its | mem_peak         | mode             | rstdev          |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| CSVLoaderBench     | bench_load_10k | 1    | 3   | 63.990mb +0.00%  | 103.138ms +0.27% | ±0.37% -64.01%  |
| JsonLoaderBench    | bench_load_10k | 1    | 3   | 84.337mb +0.00%  | 96.575ms -2.10%  | ±0.74% +650.04% |
| ParquetLoaderBench | bench_load_10k | 1    | 3   | 161.177mb +0.00% | 20.663s -1.35%   | ±0.20% -83.14%  |
| TextLoaderBench    | bench_load_10k | 1    | 3   | 17.989mb +0.00%  | 31.225ms -2.15%  | ±0.13% -5.31%   |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
Building Blocks
+-------------------+----------------------------+------+-----+------------------+------------------+------------------+
| benchmark         | subject                    | revs | its | mem_peak         | mode             | rstdev           |
+-------------------+----------------------------+------+-----+------------------+------------------+------------------+
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 105.961mb +0.00% | 459.006ms +1.26% | ±0.20% -79.42%   |
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 55.152mb +0.00%  | 228.775ms -3.31% | ±0.03% -97.27%   |
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 14.674mb +0.00%  | 50.234ms -1.08%  | ±2.49% +124.54%  |
| RowsBench         | bench_chunk_10_on_10k      | 2    | 3   | 97.005mb +0.00%  | 3.230ms -22.12%  | ±1.65% -26.58%   |
| RowsBench         | bench_diff_left_1k_on_10k  | 2    | 3   | 114.287mb +0.00% | 186.476ms -0.12% | ±0.57% -58.00%   |
| RowsBench         | bench_diff_right_1k_on_10k | 2    | 3   | 97.007mb +0.00%  | 18.906ms -1.28%  | ±0.50% -56.22%   |
| RowsBench         | bench_drop_1k_on_10k       | 2    | 3   | 97.880mb +0.00%  | 1.704ms -11.73%  | ±3.01% +26.89%   |
| RowsBench         | bench_drop_right_1k_on_10k | 2    | 3   | 97.880mb +0.00%  | 1.663ms -14.86%  | ±2.56% +196.56%  |
| RowsBench         | bench_entries_on_10k       | 2    | 3   | 96.041mb +0.00%  | 4.595ms -17.11%  | ±1.54% -45.66%   |
| RowsBench         | bench_filter_on_10k        | 2    | 3   | 96.570mb +0.00%  | 16.674ms -3.51%  | ±2.13% +103.17%  |
| RowsBench         | bench_find_on_10k          | 2    | 3   | 96.570mb +0.00%  | 16.919ms -1.08%  | ±1.51% -27.07%   |
| RowsBench         | bench_find_one_on_10k      | 10   | 3   | 95.261mb +0.00%  | 1.894μs -5.30%   | ±2.53% +0.00%    |
| RowsBench         | bench_first_on_10k         | 10   | 3   | 95.261mb +0.00%  | 0.400μs -20.00%  | ±0.00% +0.00%    |
| RowsBench         | bench_flat_map_on_1k       | 2    | 3   | 104.479mb +0.00% | 14.549ms -13.98% | ±0.66% -78.21%   |
| RowsBench         | bench_map_on_10k           | 2    | 3   | 134.546mb +0.00% | 73.230ms -2.39%  | ±1.01% -7.57%    |
| RowsBench         | bench_merge_1k_on_10k      | 2    | 3   | 97.089mb +0.00%  | 1.410ms -27.24%  | ±1.31% -63.25%   |
| RowsBench         | bench_partition_by_on_10k  | 2    | 3   | 100.386mb +0.00% | 63.971ms -2.61%  | ±0.78% +351.44%  |
| RowsBench         | bench_remove_on_10k        | 2    | 3   | 98.142mb +0.00%  | 3.976ms -14.30%  | ±2.33% -31.82%   |
| RowsBench         | bench_sort_asc_on_1k       | 2    | 3   | 95.549mb +0.00%  | 41.982ms -8.48%  | ±0.94% +68.86%   |
| RowsBench         | bench_sort_by_on_1k        | 2    | 3   | 95.549mb +0.00%  | 41.513ms -7.45%  | ±0.03% -96.78%   |
| RowsBench         | bench_sort_desc_on_1k      | 2    | 3   | 95.549mb +0.00%  | 41.848ms -10.41% | ±0.67% -55.00%   |
| RowsBench         | bench_sort_entries_on_1k   | 2    | 3   | 97.701mb +0.00%  | 8.416ms -6.69%   | ±0.76% -75.17%   |
| RowsBench         | bench_sort_on_1k           | 2    | 3   | 95.451mb +0.00%  | 29.988ms -4.83%  | ±1.53% -9.06%    |
| RowsBench         | bench_take_1k_on_10k       | 10   | 3   | 95.261mb +0.00%  | 13.424μs -8.01%  | ±1.39% +330.54%  |
| RowsBench         | bench_take_right_1k_on_10k | 10   | 3   | 95.261mb +0.00%  | 15.540μs -9.21%  | ±1.85% -35.05%   |
| RowsBench         | bench_unique_on_1k         | 2    | 3   | 114.288mb +0.00% | 190.623ms +1.17% | ±2.03% +1089.91% |
| TypeDetectorBench | bench_type_detector        | 1    | 3   | 43.797mb +0.00%  | 360.893ms -1.89% | ±0.81% -16.03%   |
| TypeDetectorBench | bench_type_detector        | 1    | 3   | 11.607mb +0.00%  | 72.899ms -1.00%  | ±0.35% -46.88%   |
+-------------------+----------------------------+------+-----+------------------+------------------+------------------+

Copy link

codecov bot commented Feb 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.00%. Comparing base (c019922) to head (e7ea5d8).
Report is 6 commits behind head on 1.x.

Additional details and impacted files
@@           Coverage Diff           @@
##              1.x    #1442   +/-   ##
=======================================
  Coverage   82.99%   83.00%           
=======================================
  Files         659      659           
  Lines       17721    17727    +6     
=======================================
+ Hits        14708    14714    +6     
  Misses       3013     3013           
Components Coverage Δ
etl 85.75% <ø> (ø)
cli 86.73% <ø> (ø)
lib-array-dot 94.53% <ø> (ø)
lib-azure-sdk 62.56% <ø> (ø)
lib-doctrine-dbal-bulk 97.36% <ø> (ø)
lib-filesystem 76.75% <ø> (ø)
lib-parquet 84.33% <ø> (ø)
lib-parquet-viewer 82.02% <ø> (ø)
lib-rdsl 87.09% <ø> (ø)
lib-snappy 90.69% <ø> (ø)
bridge-filesystem-async-aws 90.38% <ø> (ø)
bridge-filesystem-azure 89.92% <ø> (ø)
bridge-monolog-http 96.38% <ø> (ø)
symfony-http-foundation 77.10% <ø> (ø)
adapter-chartjs 86.45% <ø> (ø)
adapter-csv 89.49% <ø> (ø)
adapter-doctrine 88.54% <ø> (ø)
adapter-elasticsearch 97.19% <ø> (ø)
adapter-google-sheet 78.04% <ø> (ø)
adapter-http 59.15% <ø> (ø)
adapter-json 93.22% <100.00%> (+0.36%) ⬆️
adapter-logger 53.84% <ø> (ø)
adapter-meilisearch 97.75% <ø> (ø)
adapter-parquet 80.85% <ø> (ø)
adapter-text 84.44% <ø> (ø)
adapter-xml 83.15% <ø> (ø)

@norberttech
Copy link
Member

hey @jmortlock this looks good!
Would you mind running locally composer cs:php:fix and pushing whatever cs fixer will fix so I can merge it?

@norberttech norberttech merged commit 141e991 into flow-php:1.x Feb 3, 2025
21 checks passed
@jmortlock jmortlock deleted the add-jsonl-support branch February 3, 2025 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSONL support
2 participants