Skip to content

Conversation

@norberttech
Copy link
Member

@norberttech norberttech commented Feb 13, 2025

Change Log

Added

  • Early detection of XML type in dbal bulk

Fixed

  • Incosistency between XMLEntry::toString and Casting XML's to strings

Changed

Removed

Deprecated

Security


Description

Resolves: #1472

@norberttech
Copy link
Member Author

ping @jmortlock

Types::STRING => $entry->saveXML($entry->documentElement),
default => $entry,
},
\DOMElement::class => match (Type::getTypeRegistry()->lookupName($table->dbalColumn($column)->getType())) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmortlock I followed your suggestion, this requires a bigger refactoring, it's not perfect but it works, and it works well so I'm keeping it for now. Ideally I would like to extract that logic to a different place but that requires some planning and I'm a bit short on time currently

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me

@github-actions
Copy link
Contributor

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.800mb +0.02%  | 550.559ms -0.26% | ±0.63% -32.66%  |
| JsonExtractorBench    | bench_extract_10k | 1    | 3   | 4.873mb +0.02%  | 1.068s -0.32%    | ±2.32% +177.20% |
| ParquetExtractorBench | bench_extract_10k | 1    | 3   | 86.318mb +0.00% | 896.668ms +0.02% | ±0.66% +292.68% |
| TextExtractorBench    | bench_extract_10k | 1    | 3   | 4.530mb +0.02%  | 35.719ms +0.12%  | ±0.26% -81.51%  |
| XmlExtractorBench     | bench_extract_10k | 1    | 3   | 4.504mb +0.02%  | 614.103ms +1.65% | ±0.30% -76.90%  |
+-----------------------+-------------------+------+-----+-----------------+------------------+-----------------+
Transformers
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| benchmark                   | subject                  | revs | its | mem_peak         | mode            | rstdev         |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| RenameEntryTransformerBench | bench_transform_10k_rows | 1    | 3   | 127.326mb +0.00% | 70.880ms +0.05% | ±2.82% +38.00% |
+-----------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
Loaders
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| benchmark          | subject        | revs | its | mem_peak         | mode             | rstdev          |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| CSVLoaderBench     | bench_load_10k | 1    | 3   | 63.999mb +0.00%  | 103.848ms -0.97% | ±0.71% -25.47%  |
| JsonLoaderBench    | bench_load_10k | 1    | 3   | 84.346mb +0.00%  | 97.518ms -1.23%  | ±0.93% +77.11%  |
| ParquetLoaderBench | bench_load_10k | 1    | 3   | 161.188mb +0.00% | 21.059s +2.21%   | ±1.00% +205.84% |
| TextLoaderBench    | bench_load_10k | 1    | 3   | 17.996mb +0.00%  | 31.526ms -0.37%  | ±0.95% +87.72%  |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
Building Blocks
+-------------------+----------------------------+------+-----+------------------+------------------+-----------------+
| benchmark         | subject                    | revs | its | mem_peak         | mode             | rstdev          |
+-------------------+----------------------------+------+-----+------------------+------------------+-----------------+
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 105.969mb +0.00% | 468.668ms +2.97% | ±0.42% -63.48%  |
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 55.160mb +0.00%  | 236.488ms +3.08% | ±1.10% +54.68%  |
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 14.682mb +0.01%  | 53.912ms +5.26%  | ±2.33% -31.12%  |
| TypeDetectorBench | bench_type_detector        | 1    | 3   | 43.804mb +0.00%  | 364.033ms -1.62% | ±0.79% -22.08%  |
| TypeDetectorBench | bench_type_detector        | 1    | 3   | 11.614mb +0.00%  | 73.812ms -0.08%  | ±0.26% -64.36%  |
| RowsBench         | bench_chunk_10_on_10k      | 2    | 3   | 97.013mb +0.00%  | 3.892ms +14.16%  | ±1.45% -49.64%  |
| RowsBench         | bench_diff_left_1k_on_10k  | 2    | 3   | 114.298mb +0.00% | 186.456ms +0.73% | ±0.65% +5.11%   |
| RowsBench         | bench_diff_right_1k_on_10k | 2    | 3   | 97.018mb +0.00%  | 19.406ms +2.56%  | ±1.13% +72.82%  |
| RowsBench         | bench_drop_1k_on_10k       | 2    | 3   | 97.887mb +0.00%  | 2.042ms +14.57%  | ±0.70% +41.32%  |
| RowsBench         | bench_drop_right_1k_on_10k | 2    | 3   | 97.887mb +0.00%  | 2.035ms +5.44%   | ±1.50% -25.51%  |
| RowsBench         | bench_entries_on_10k       | 2    | 3   | 96.048mb +0.00%  | 5.587ms +5.90%   | ±2.81% +2.86%   |
| RowsBench         | bench_filter_on_10k        | 2    | 3   | 96.577mb +0.00%  | 17.302ms +3.97%  | ±0.95% +25.54%  |
| RowsBench         | bench_find_on_10k          | 2    | 3   | 96.577mb +0.00%  | 17.619ms +5.64%  | ±0.30% +11.59%  |
| RowsBench         | bench_find_one_on_10k      | 10   | 3   | 95.268mb +0.00%  | 1.906μs 0.00%    | ±2.44% 0.00%    |
| RowsBench         | bench_first_on_10k         | 10   | 3   | 95.268mb +0.00%  | 0.400μs -20.00%  | ±0.00% +0.00%   |
| RowsBench         | bench_flat_map_on_1k       | 2    | 3   | 104.486mb +0.00% | 17.088ms +14.55% | ±1.23% -17.78%  |
| RowsBench         | bench_map_on_10k           | 2    | 3   | 134.554mb +0.00% | 75.183ms +0.66%  | ±0.51% -66.83%  |
| RowsBench         | bench_merge_1k_on_10k      | 2    | 3   | 97.097mb +0.00%  | 2.023ms +38.39%  | ±0.80% -1.48%   |
| RowsBench         | bench_partition_by_on_10k  | 2    | 3   | 100.397mb +0.00% | 65.507ms -0.69%  | ±0.77% -25.57%  |
| RowsBench         | bench_remove_on_10k        | 2    | 3   | 98.150mb +0.00%  | 4.530ms +13.19%  | ±3.67% +88.76%  |
| RowsBench         | bench_sort_asc_on_1k       | 2    | 3   | 95.559mb +0.00%  | 44.414ms +7.21%  | ±0.75% -31.66%  |
| RowsBench         | bench_sort_by_on_1k        | 2    | 3   | 95.560mb +0.00%  | 45.617ms +8.39%  | ±0.61% -15.15%  |
| RowsBench         | bench_sort_desc_on_1k      | 2    | 3   | 95.559mb +0.00%  | 43.546ms +4.26%  | ±1.40% +95.80%  |
| RowsBench         | bench_sort_entries_on_1k   | 2    | 3   | 97.709mb +0.00%  | 8.693ms +5.35%   | ±3.22% +301.61% |
| RowsBench         | bench_sort_on_1k           | 2    | 3   | 95.459mb +0.00%  | 30.681ms +4.13%  | ±1.46% -20.36%  |
| RowsBench         | bench_take_1k_on_10k       | 10   | 3   | 95.268mb +0.00%  | 14.366μs -6.84%  | ±2.96% -19.67%  |
| RowsBench         | bench_take_right_1k_on_10k | 10   | 3   | 95.268mb +0.00%  | 16.736μs +4.60%  | ±1.67% +63.98%  |
| RowsBench         | bench_unique_on_1k         | 2    | 3   | 114.298mb +0.00% | 190.445ms -0.39% | ±0.44% -44.71%  |
+-------------------+----------------------------+------+-----+------------------+------------------+-----------------+

@codecov
Copy link

codecov bot commented Feb 13, 2025

Codecov Report

Attention: Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 83.06%. Comparing base (74c2a81) to head (dffde5b).
Report is 5 commits behind head on 1.x.

Additional details and impacted files
@@            Coverage Diff             @@
##              1.x    #1475      +/-   ##
==========================================
+ Coverage   83.04%   83.06%   +0.02%     
==========================================
  Files         664      665       +1     
  Lines       17858    17884      +26     
==========================================
+ Hits        14830    14856      +26     
  Misses       3028     3028              
Components Coverage Δ
etl 85.79% <100.00%> (+0.01%) ⬆️
cli 86.73% <ø> (ø)
lib-array-dot 94.53% <ø> (ø)
lib-azure-sdk 62.56% <ø> (ø)
lib-doctrine-dbal-bulk 97.43% <90.90%> (+0.07%) ⬆️
lib-filesystem 76.75% <ø> (ø)
lib-parquet 84.33% <ø> (ø)
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.57% <ø> (ø)
adapter-doctrine 88.68% <ø> (ø)
adapter-elasticsearch 97.19% <ø> (ø)
adapter-google-sheet 78.04% <ø> (ø)
adapter-http 59.15% <ø> (ø)
adapter-json 90.62% <ø> (ø)
adapter-logger 53.84% <ø> (ø)
adapter-meilisearch 97.75% <ø> (ø)
adapter-parquet 80.85% <ø> (ø)
adapter-text 84.44% <ø> (ø)
adapter-xml 83.15% <ø> (ø)

Copy link
Contributor

@jmortlock jmortlock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for getting this resolved.

@norberttech norberttech merged commit 53d7c61 into flow-php:1.x Feb 13, 2025
25 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.

Doctrine Insert with XmlEntry

2 participants