Skip to content

Conversation

@norberttech
Copy link
Member

Change Log

Added

  • Allow Scalar Functions to defined return Type
  • EntryFactory::createAs method to create entry from value and specific expected type

Fixed

  • Casting non deterministic values like empty array to list/map will create list/map entry

Changed

  • Simplified ArrayExpand and ArrayUnpack interfaces

Removed

Deprecated

Security


Description

@norberttech norberttech force-pushed the 1396-casting-scalar-function branch from 946dba1 to 212d628 Compare January 23, 2025 04:59
@codecov
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 74.26471% with 35 lines in your changes missing coverage. Please review.

Project coverage is 82.51%. Comparing base (5552d97) to head (631d33b).
Report is 6 commits behind head on 1.x.

Additional details and impacted files
@@            Coverage Diff             @@
##              1.x    #1400      +/-   ##
==========================================
- Coverage   82.57%   82.51%   -0.06%     
==========================================
  Files         654      654              
  Lines       17489    17538      +49     
==========================================
+ Hits        14442    14472      +30     
- Misses       3047     3066      +19     
Components Coverage Δ
etl 85.76% <74.26%> (-0.19%) ⬇️
cli 85.17% <ø> (ø)
lib-array-dot 94.53% <ø> (ø)
lib-azure-sdk 62.56% <ø> (ø)
lib-doctrine-dbal-bulk 97.36% <ø> (ø)
lib-filesystem 76.23% <ø> (ø)
lib-parquet 84.57% <ø> (ø)
lib-parquet-viewer 82.02% <ø> (ø)
lib-rdsl 87.09% <ø> (ø)
lib-snappy 91.16% <ø> (+0.46%) ⬆️
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 90.14% <ø> (ø)
adapter-elasticsearch 97.19% <ø> (ø)
adapter-google-sheet 78.04% <ø> (ø)
adapter-http 59.15% <ø> (ø)
adapter-json 92.85% <ø> (ø)
adapter-logger 53.84% <ø> (ø)
adapter-meilisearch 97.75% <ø> (ø)
adapter-parquet 59.88% <ø> (ø)
adapter-text 84.44% <ø> (ø)
adapter-xml 83.15% <ø> (ø)

@github-actions github-actions bot added size: L and removed size: M labels Jan 23, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jan 23, 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.789mb -0.05%  | 560.182ms -3.60% | ±1.20% -32.86% |
| JsonExtractorBench    | bench_extract_10k | 1    | 3   | 4.858mb -0.04%  | 1.061s -2.17%    | ±0.29% -41.90% |
| ParquetExtractorBench | bench_extract_10k | 1    | 3   | 86.505mb -0.00% | 903.563ms -1.02% | ±0.10% -70.11% |
| TextExtractorBench    | bench_extract_10k | 1    | 3   | 4.519mb -0.06%  | 35.691ms +0.22%  | ±0.72% +17.75% |
| XmlExtractorBench     | bench_extract_10k | 1    | 3   | 4.496mb -0.06%  | 603.699ms -1.21% | ±0.39% +4.61%  |
+-----------------------+-------------------+------+-----+-----------------+------------------+----------------+
Transformers
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| benchmark                   | subject                  | revs | its | mem_peak         | mode            | rstdev         |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| RenameEntryTransformerBench | bench_transform_10k_rows | 1    | 3   | 127.318mb -0.00% | 71.142ms +0.75% | ±0.39% -69.86% |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
Loaders
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| benchmark          | subject        | revs | its | mem_peak         | mode             | rstdev          |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| CSVLoaderBench     | bench_load_10k | 1    | 3   | 63.922mb +0.05%  | 104.134ms -1.70% | ±0.69% +88.52%  |
| JsonLoaderBench    | bench_load_10k | 1    | 3   | 84.329mb -0.00%  | 98.211ms -2.39%  | ±0.46% -16.60%  |
| ParquetLoaderBench | bench_load_10k | 1    | 3   | 163.227mb -1.23% | 20.715s -1.22%   | ±0.73% +266.69% |
| TextLoaderBench    | bench_load_10k | 1    | 3   | 17.986mb -0.01%  | 31.094ms +0.83%  | ±0.17% -38.89%  |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
Building Blocks
+-------------------------+----------------------------+------+-----+------------------+------------------+------------------+
| benchmark               | subject                    | revs | its | mem_peak         | mode             | rstdev           |
+-------------------------+----------------------------+------+-----+------------------+------------------+------------------+
| RowsBench               | bench_chunk_10_on_10k      | 2    | 3   | 97.004mb -0.00%  | 3.213ms -0.44%   | ±1.62% -8.90%    |
| RowsBench               | bench_diff_left_1k_on_10k  | 2    | 3   | 114.286mb -0.00% | 191.613ms -0.66% | ±0.69% -61.42%   |
| RowsBench               | bench_diff_right_1k_on_10k | 2    | 3   | 97.006mb -0.00%  | 19.463ms +0.73%  | ±1.04% +30.49%   |
| RowsBench               | bench_drop_1k_on_10k       | 2    | 3   | 97.879mb -0.00%  | 1.502ms -0.87%   | ±2.30% +38.76%   |
| RowsBench               | bench_drop_right_1k_on_10k | 2    | 3   | 97.879mb -0.00%  | 1.425ms -10.36%  | ±1.38% +33.20%   |
| RowsBench               | bench_entries_on_10k       | 2    | 3   | 96.040mb -0.00%  | 4.962ms +24.85%  | ±3.29% +71.24%   |
| RowsBench               | bench_filter_on_10k        | 2    | 3   | 96.569mb -0.00%  | 16.742ms -9.62%  | ±1.13% -59.58%   |
| RowsBench               | bench_find_on_10k          | 2    | 3   | 96.569mb -0.00%  | 16.812ms -10.87% | ±0.99% -28.43%   |
| RowsBench               | bench_find_one_on_10k      | 10   | 3   | 95.260mb -0.00%  | 1.894μs -0.64%   | ±2.53% +3.57%    |
| RowsBench               | bench_first_on_10k         | 10   | 3   | 95.260mb -0.00%  | 0.400μs 0.00%    | ±0.00% 0.00%     |
| RowsBench               | bench_flat_map_on_1k       | 2    | 3   | 104.478mb -0.00% | 14.783ms -0.01%  | ±3.19% +383.57%  |
| RowsBench               | bench_map_on_10k           | 2    | 3   | 134.545mb -0.00% | 74.423ms -0.32%  | ±0.88% -44.66%   |
| RowsBench               | bench_merge_1k_on_10k      | 2    | 3   | 97.088mb -0.00%  | 1.294ms -4.34%   | ±2.15% -21.42%   |
| RowsBench               | bench_partition_by_on_10k  | 2    | 3   | 100.386mb -0.00% | 65.199ms -1.97%  | ±0.67% -61.34%   |
| RowsBench               | bench_remove_on_10k        | 2    | 3   | 98.141mb -0.00%  | 3.820ms -6.63%   | ±3.10% +224.24%  |
| RowsBench               | bench_sort_asc_on_1k       | 2    | 3   | 95.548mb -0.00%  | 41.544ms -4.98%  | ±1.70% +124.92%  |
| RowsBench               | bench_sort_by_on_1k        | 2    | 3   | 95.548mb -0.00%  | 42.573ms -1.52%  | ±1.28% +68.07%   |
| RowsBench               | bench_sort_desc_on_1k      | 2    | 3   | 95.548mb -0.00%  | 42.261ms -2.05%  | ±0.61% -65.24%   |
| RowsBench               | bench_sort_entries_on_1k   | 2    | 3   | 97.700mb -0.00%  | 8.608ms +4.43%   | ±2.77% +1079.68% |
| RowsBench               | bench_sort_on_1k           | 2    | 3   | 95.450mb -0.00%  | 30.283ms -1.11%  | ±2.20% +248.07%  |
| RowsBench               | bench_take_1k_on_10k       | 10   | 3   | 95.260mb -0.00%  | 13.543μs -27.27% | ±2.41% -32.64%   |
| RowsBench               | bench_take_right_1k_on_10k | 10   | 3   | 95.260mb -0.00%  | 15.625μs -25.63% | ±3.12% -9.06%    |
| RowsBench               | bench_unique_on_1k         | 2    | 3   | 114.287mb -0.00% | 197.441ms -0.16% | ±0.29% -60.87%   |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 105.955mb -0.00% | 450.242ms -3.27% | ±1.36% +196.54%  |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 55.145mb -0.00%  | 235.176ms -0.07% | ±1.11% -11.35%   |
| NativeEntryFactoryBench | bench_entry_factory        | 1    | 3   | 14.667mb -0.01%  | 50.526ms -1.17%  | ±0.41% -80.58%   |
| TypeDetectorBench       | bench_type_detector        | 1    | 3   | 43.789mb +0.00%  | 373.035ms +0.98% | ±1.75% +26.34%   |
| TypeDetectorBench       | bench_type_detector        | 1    | 3   | 11.599mb +0.00%  | 72.858ms -0.75%  | ±0.55% +13.26%   |
+-------------------------+----------------------------+------+-----+------------------+------------------+------------------+

@norberttech norberttech merged commit 643e514 into flow-php:1.x Jan 23, 2025
20 of 23 checks passed
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.

1 participant