Skip to content

Fix RowConverter when FixedSizeList is not the last #7789

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

findepi
Copy link
Member

@findepi findepi commented Jun 26, 2025

Which issue does this PR close?

none

Rationale for this change

RowConverter decoding fails when there is a FixedSizeList element and it's not the last.

What changes are included in this PR?

Fix RowConverter row decoding when there is a FixedSizeList element and it's not the last.

Are these changes tested?

yes

Fix `RowConverter` row decoding when there is a `FixedSizeList` element
and it's not the last.
@github-actions github-actions bot added the arrow Changes to the arrow crate label Jun 26, 2025
@alamb
Copy link
Contributor

alamb commented Jun 27, 2025

🤖 ./gh_compare_arrow.sh Benchmark Script Running
Linux aal-dev 6.11.0-1015-gcp #15~24.04.1-Ubuntu SMP Thu Apr 24 20:41:05 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing findepi/fix-rowconverter-when-fixedsizelist-is-not-the-last-b962b2 (46027d0) to 01c5efc diff
BENCH_NAME=row_format
BENCH_COMMAND=cargo bench --features=arrow,async,test_common,experimental --bench row_format
BENCH_FILTER=
BENCH_BRANCH_NAME=findepi_fix-rowconverter-when-fixedsizelist-is-not-the-last-b962b2
Results will be posted here when complete

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Looks good to me -- thank you @findepi

I plan to approve this PR pending a performance check

@alamb
Copy link
Contributor

alamb commented Jun 27, 2025

🤖: Benchmark completed

Details

group                                                                                                                         findepi_fix-rowconverter-when-fixedsizelist-is-not-the-last-b962b2    main
-----                                                                                                                         ------------------------------------------------------------------    ----
convert_columns 4096 4096 string_dictionary(20, 0.5), string_dictionary(30, 0), string_dictionary(100, 0), i64(0)             1.01    390.2±2.16µs        ? ?/sec                                   1.00    385.2±2.71µs        ? ?/sec
convert_columns 4096 bool(0, 0.5)                                                                                             1.00      8.3±0.03µs        ? ?/sec                                   1.49     12.3±0.02µs        ? ?/sec
convert_columns 4096 bool(0.3, 0.5)                                                                                           1.02     16.3±0.11µs        ? ?/sec                                   1.00     15.9±0.41µs        ? ?/sec
convert_columns 4096 i64(0)                                                                                                   1.18      9.4±0.01µs        ? ?/sec                                   1.00      8.0±0.05µs        ? ?/sec
convert_columns 4096 i64(0.3)                                                                                                 1.03     15.0±0.05µs        ? ?/sec                                   1.00     14.6±0.11µs        ? ?/sec
convert_columns 4096 string view(10, 0)                                                                                       1.17     53.7±0.06µs        ? ?/sec                                   1.00     45.8±0.10µs        ? ?/sec
convert_columns 4096 string view(100, 0)                                                                                      1.00     78.6±0.27µs        ? ?/sec                                   1.00     78.7±0.27µs        ? ?/sec
convert_columns 4096 string view(100, 0.5)                                                                                    1.00     83.6±0.21µs        ? ?/sec                                   1.00     83.9±0.23µs        ? ?/sec
convert_columns 4096 string view(30, 0)                                                                                       1.05     56.7±0.09µs        ? ?/sec                                   1.00     54.1±0.08µs        ? ?/sec
convert_columns 4096 string(10, 0)                                                                                            1.21     55.2±0.08µs        ? ?/sec                                   1.00     45.6±0.10µs        ? ?/sec
convert_columns 4096 string(100, 0)                                                                                           1.00     74.4±0.28µs        ? ?/sec                                   1.04     77.7±0.26µs        ? ?/sec
convert_columns 4096 string(100, 0.5)                                                                                         1.01     80.9±0.13µs        ? ?/sec                                   1.00     80.4±0.32µs        ? ?/sec
convert_columns 4096 string(20, 0.5), string(30, 0), string(100, 0), i64(0)                                                   1.02    238.7±1.39µs        ? ?/sec                                   1.00    234.4±1.01µs        ? ?/sec
convert_columns 4096 string(30, 0)                                                                                            1.17     57.2±0.09µs        ? ?/sec                                   1.00     48.8±0.15µs        ? ?/sec
convert_columns 4096 string_dictionary(10, 0)                                                                                 1.21     86.2±0.24µs        ? ?/sec                                   1.00     71.1±0.19µs        ? ?/sec
convert_columns 4096 string_dictionary(100, 0)                                                                                1.00    151.9±1.53µs        ? ?/sec                                   1.01    154.1±0.96µs        ? ?/sec
convert_columns 4096 string_dictionary(100, 0.5)                                                                              1.02    120.2±0.33µs        ? ?/sec                                   1.00    117.3±0.32µs        ? ?/sec
convert_columns 4096 string_dictionary(30, 0)                                                                                 1.13     87.4±0.26µs        ? ?/sec                                   1.00     77.1±0.14µs        ? ?/sec
convert_columns 4096 string_dictionary_low_cardinality(10, 0)                                                                 1.17     30.1±0.05µs        ? ?/sec                                   1.00     25.7±0.05µs        ? ?/sec
convert_columns 4096 string_dictionary_low_cardinality(100, 0)                                                                1.00     49.1±0.10µs        ? ?/sec                                   1.00     49.0±0.17µs        ? ?/sec
convert_columns 4096 string_dictionary_low_cardinality(30, 0)                                                                 1.12     31.0±0.21µs        ? ?/sec                                   1.00     27.7±0.04µs        ? ?/sec
convert_columns 4096 u64(0)                                                                                                   1.00      7.8±0.10µs        ? ?/sec                                   1.20      9.4±0.02µs        ? ?/sec
convert_columns 4096 u64(0.3)                                                                                                 1.00     14.4±0.06µs        ? ?/sec                                   1.04     15.0±0.07µs        ? ?/sec
convert_columns_prepared 4096 4096 string_dictionary(20, 0.5), string_dictionary(30, 0), string_dictionary(100, 0), i64(0)    1.02    388.3±1.68µs        ? ?/sec                                   1.00    381.6±1.35µs        ? ?/sec
convert_columns_prepared 4096 bool(0, 0.5)                                                                                    1.00      8.2±0.01µs        ? ?/sec                                   1.49     12.2±0.03µs        ? ?/sec
convert_columns_prepared 4096 bool(0.3, 0.5)                                                                                  1.02     16.1±0.07µs        ? ?/sec                                   1.00     15.8±0.06µs        ? ?/sec
convert_columns_prepared 4096 i64(0)                                                                                          1.22      9.4±0.02µs        ? ?/sec                                   1.00      7.7±0.10µs        ? ?/sec
convert_columns_prepared 4096 i64(0.3)                                                                                        1.03     15.0±0.07µs        ? ?/sec                                   1.00     14.5±0.08µs        ? ?/sec
convert_columns_prepared 4096 string view(10, 0)                                                                              1.17     53.7±0.09µs        ? ?/sec                                   1.00     45.8±0.16µs        ? ?/sec
convert_columns_prepared 4096 string view(100, 0)                                                                             1.01     79.0±1.77µs        ? ?/sec                                   1.00     78.6±0.30µs        ? ?/sec
convert_columns_prepared 4096 string view(100, 0.5)                                                                           1.00     83.7±0.25µs        ? ?/sec                                   1.00     83.8±0.32µs        ? ?/sec
convert_columns_prepared 4096 string view(30, 0)                                                                              1.05     56.5±0.13µs        ? ?/sec                                   1.00     54.0±0.10µs        ? ?/sec
convert_columns_prepared 4096 string(10, 0)                                                                                   1.22     55.1±0.09µs        ? ?/sec                                   1.00     45.3±0.13µs        ? ?/sec
convert_columns_prepared 4096 string(100, 0)                                                                                  1.00     77.5±0.26µs        ? ?/sec                                   1.03     79.9±0.28µs        ? ?/sec
convert_columns_prepared 4096 string(100, 0.5)                                                                                1.01     81.0±0.25µs        ? ?/sec                                   1.00     80.1±0.24µs        ? ?/sec
convert_columns_prepared 4096 string(20, 0.5), string(30, 0), string(100, 0), i64(0)                                          1.02    240.7±0.90µs        ? ?/sec                                   1.00    235.3±1.02µs        ? ?/sec
convert_columns_prepared 4096 string(30, 0)                                                                                   1.17     57.1±0.12µs        ? ?/sec                                   1.00     48.7±0.08µs        ? ?/sec
convert_columns_prepared 4096 string_dictionary(10, 0)                                                                        1.19     84.4±0.12µs        ? ?/sec                                   1.00     71.2±0.17µs        ? ?/sec
convert_columns_prepared 4096 string_dictionary(100, 0)                                                                       1.00    152.5±0.89µs        ? ?/sec                                   1.01    153.7±0.59µs        ? ?/sec
convert_columns_prepared 4096 string_dictionary(100, 0.5)                                                                     1.02    118.1±0.26µs        ? ?/sec                                   1.00    116.0±0.23µs        ? ?/sec
convert_columns_prepared 4096 string_dictionary(30, 0)                                                                        1.15     87.7±0.20µs        ? ?/sec                                   1.00     76.2±0.18µs        ? ?/sec
convert_columns_prepared 4096 string_dictionary_low_cardinality(10, 0)                                                        1.17     29.3±0.03µs        ? ?/sec                                   1.00     25.1±0.06µs        ? ?/sec
convert_columns_prepared 4096 string_dictionary_low_cardinality(100, 0)                                                       1.00     47.7±0.09µs        ? ?/sec                                   1.00     47.8±0.08µs        ? ?/sec
convert_columns_prepared 4096 string_dictionary_low_cardinality(30, 0)                                                        1.09     29.5±0.03µs        ? ?/sec                                   1.00     27.0±0.09µs        ? ?/sec
convert_columns_prepared 4096 u64(0)                                                                                          1.00      7.7±0.08µs        ? ?/sec                                   1.20      9.3±0.01µs        ? ?/sec
convert_columns_prepared 4096 u64(0.3)                                                                                        1.00     14.3±0.08µs        ? ?/sec                                   1.04     14.9±0.06µs        ? ?/sec
convert_rows 4096 4096 string_dictionary(20, 0.5), string_dictionary(30, 0), string_dictionary(100, 0), i64(0)                1.00    286.3±1.85µs        ? ?/sec                                   1.04    298.2±2.31µs        ? ?/sec
convert_rows 4096 bool(0, 0.5)                                                                                                1.21     20.0±0.03µs        ? ?/sec                                   1.00     16.6±0.05µs        ? ?/sec
convert_rows 4096 bool(0.3, 0.5)                                                                                              1.20     20.0±0.04µs        ? ?/sec                                   1.00     16.6±0.03µs        ? ?/sec
convert_rows 4096 i64(0)                                                                                                      1.27     40.3±0.13µs        ? ?/sec                                   1.00     31.7±0.03µs        ? ?/sec
convert_rows 4096 i64(0.3)                                                                                                    1.27     40.2±0.10µs        ? ?/sec                                   1.00     31.7±0.08µs        ? ?/sec
convert_rows 4096 string view(10, 0)                                                                                          1.14     75.8±0.22µs        ? ?/sec                                   1.00     66.6±0.09µs        ? ?/sec
convert_rows 4096 string view(100, 0)                                                                                         1.05    120.7±0.43µs        ? ?/sec                                   1.00    115.4±0.29µs        ? ?/sec
convert_rows 4096 string view(100, 0.5)                                                                                       1.07    114.2±0.17µs        ? ?/sec                                   1.00    107.1±0.29µs        ? ?/sec
convert_rows 4096 string view(30, 0)                                                                                          1.09     83.6±0.24µs        ? ?/sec                                   1.00     76.8±0.29µs        ? ?/sec
convert_rows 4096 string(10, 0)                                                                                               1.00     59.7±0.10µs        ? ?/sec                                   1.02     61.2±0.11µs        ? ?/sec
convert_rows 4096 string(100, 0)                                                                                              1.00    103.8±0.58µs        ? ?/sec                                   1.07    111.4±0.37µs        ? ?/sec
convert_rows 4096 string(100, 0.5)                                                                                            1.00    100.5±0.22µs        ? ?/sec                                   1.05    105.9±0.36µs        ? ?/sec
convert_rows 4096 string(20, 0.5), string(30, 0), string(100, 0), i64(0)                                                      1.00    291.8±2.97µs        ? ?/sec                                   1.02    297.8±1.53µs        ? ?/sec
convert_rows 4096 string(30, 0)                                                                                               1.02     74.7±0.18µs        ? ?/sec                                   1.00     73.4±0.38µs        ? ?/sec
convert_rows 4096 string_dictionary(10, 0)                                                                                    1.00     59.6±0.10µs        ? ?/sec                                   1.03     61.2±0.12µs        ? ?/sec
convert_rows 4096 string_dictionary(100, 0)                                                                                   1.00    103.2±0.27µs        ? ?/sec                                   1.08    111.5±0.55µs        ? ?/sec
convert_rows 4096 string_dictionary(100, 0.5)                                                                                 1.00    100.8±0.21µs        ? ?/sec                                   1.05    106.1±0.22µs        ? ?/sec
convert_rows 4096 string_dictionary(30, 0)                                                                                    1.02     74.8±0.09µs        ? ?/sec                                   1.00     73.3±0.16µs        ? ?/sec
convert_rows 4096 string_dictionary_low_cardinality(10, 0)                                                                    1.00     59.7±0.09µs        ? ?/sec                                   1.02     60.9±0.13µs        ? ?/sec
convert_rows 4096 string_dictionary_low_cardinality(100, 0)                                                                   1.00    103.7±0.50µs        ? ?/sec                                   1.08    112.0±0.41µs        ? ?/sec
convert_rows 4096 string_dictionary_low_cardinality(30, 0)                                                                    1.02     74.8±0.11µs        ? ?/sec                                   1.00     73.4±0.22µs        ? ?/sec
convert_rows 4096 u64(0)                                                                                                      1.24     37.9±0.07µs        ? ?/sec                                   1.00     30.5±0.04µs        ? ?/sec
convert_rows 4096 u64(0.3)                                                                                                    1.25     38.1±0.04µs        ? ?/sec                                   1.00     30.6±0.04µs        ? ?/sec
iterate rows                                                                                                                  1.00      2.5±0.00µs        ? ?/sec                                   1.28      3.3±0.00µs        ? ?/sec

findepi added 3 commits June 27, 2025 15:31
When columns are unequal sizes, then encoding them can panic. This can
be observed by changing
`test_fixed_size_list_with_variable_width_content`, eg adding one more
element to the second list.

What's unclear, the panic can be avoided by calling
`tracker.materialized()` in `compute_lengths_fixed_size_list` (similar
to how list encoding does it). However, we still won't encode the whole
data passed in, so it's better to reject this upfront.
Comment on lines +693 to +701
for colum in columns.iter().skip(1) {
if colum.len() != columns[0].len() {
return Err(ArrowError::InvalidArgumentError(format!(
"RowConverter columns must all have the same length, expected {} got {}",
columns[0].len(),
colum.len()
)));
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Another check added. This guards against passing ill-formed data from the user.
Without this, it's possible to get a panic inside the RowEncoder.

@alamb
Copy link
Contributor

alamb commented Jun 27, 2025

🤖 ./gh_compare_arrow.sh Benchmark Script Running
Linux aal-dev 6.11.0-1015-gcp #15~24.04.1-Ubuntu SMP Thu Apr 24 20:41:05 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing findepi/fix-rowconverter-when-fixedsizelist-is-not-the-last-b962b2 (aa926c3) to 01c5efc diff
BENCH_NAME=view_types
BENCH_COMMAND=cargo bench --features=arrow,async,test_common,experimental --bench view_types
BENCH_FILTER=
BENCH_BRANCH_NAME=findepi_fix-rowconverter-when-fixedsizelist-is-not-the-last-b962b2
Results will be posted here when complete

@alamb
Copy link
Contributor

alamb commented Jun 29, 2025

I am not sure what happened to the benchmark script -- I will rerun shortly

@alamb
Copy link
Contributor

alamb commented Jun 30, 2025

🤖 ./gh_compare_arrow.sh Benchmark Script Running
Linux aal-dev 6.11.0-1016-gcp #16~24.04.1-Ubuntu SMP Wed May 28 02:40:52 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing findepi/fix-rowconverter-when-fixedsizelist-is-not-the-last-b962b2 (aa926c3) to 01c5efc diff
BENCH_NAME=row_format
BENCH_COMMAND=cargo bench --features=arrow,async,test_common,experimental --bench row_format
BENCH_FILTER=
BENCH_BRANCH_NAME=findepi_fix-rowconverter-when-fixedsizelist-is-not-the-last-b962b2
Results will be posted here when complete

@alamb
Copy link
Contributor

alamb commented Jun 30, 2025

🤖: Benchmark completed

Details

group                                                                                                                         findepi_fix-rowconverter-when-fixedsizelist-is-not-the-last-b962b2    main
-----                                                                                                                         ------------------------------------------------------------------    ----
convert_columns 4096 4096 string_dictionary(20, 0.5), string_dictionary(30, 0), string_dictionary(100, 0), i64(0)             1.00    382.6±2.96µs        ? ?/sec                                   1.00    382.6±2.18µs        ? ?/sec
convert_columns 4096 bool(0, 0.5)                                                                                             1.01     12.4±0.02µs        ? ?/sec                                   1.00     12.3±0.02µs        ? ?/sec
convert_columns 4096 bool(0.3, 0.5)                                                                                           1.03     16.4±0.08µs        ? ?/sec                                   1.00     16.0±0.07µs        ? ?/sec
convert_columns 4096 i64(0)                                                                                                   1.00      7.9±0.13µs        ? ?/sec                                   1.00      7.9±0.13µs        ? ?/sec
convert_columns 4096 i64(0.3)                                                                                                 1.02     15.0±0.11µs        ? ?/sec                                   1.00     14.6±0.08µs        ? ?/sec
convert_columns 4096 string view(10, 0)                                                                                       1.00     46.0±0.13µs        ? ?/sec                                   1.00     46.1±0.10µs        ? ?/sec
convert_columns 4096 string view(100, 0)                                                                                      1.00     78.4±0.65µs        ? ?/sec                                   1.00     78.1±0.19µs        ? ?/sec
convert_columns 4096 string view(100, 0.5)                                                                                    1.01     84.3±0.34µs        ? ?/sec                                   1.00     83.7±0.19µs        ? ?/sec
convert_columns 4096 string view(30, 0)                                                                                       1.00     54.1±0.12µs        ? ?/sec                                   1.00     54.0±0.09µs        ? ?/sec
convert_columns 4096 string(10, 0)                                                                                            1.00     45.5±0.05µs        ? ?/sec                                   1.00     45.5±0.08µs        ? ?/sec
convert_columns 4096 string(100, 0)                                                                                           1.00     77.7±0.24µs        ? ?/sec                                   1.00     78.0±0.25µs        ? ?/sec
convert_columns 4096 string(100, 0.5)                                                                                         1.01     82.5±0.29µs        ? ?/sec                                   1.00     82.0±0.26µs        ? ?/sec
convert_columns 4096 string(20, 0.5), string(30, 0), string(100, 0), i64(0)                                                   1.01    236.5±1.21µs        ? ?/sec                                   1.00    233.4±0.88µs        ? ?/sec
convert_columns 4096 string(30, 0)                                                                                            1.00     48.7±0.09µs        ? ?/sec                                   1.00     48.8±0.13µs        ? ?/sec
convert_columns 4096 string_dictionary(10, 0)                                                                                 1.00     74.7±0.10µs        ? ?/sec                                   1.00     74.7±0.12µs        ? ?/sec
convert_columns 4096 string_dictionary(100, 0)                                                                                1.00    153.8±1.41µs        ? ?/sec                                   1.01    155.9±1.30µs        ? ?/sec
convert_columns 4096 string_dictionary(100, 0.5)                                                                              1.00    117.3±0.23µs        ? ?/sec                                   1.00    117.4±0.41µs        ? ?/sec
convert_columns 4096 string_dictionary(30, 0)                                                                                 1.00     77.5±0.27µs        ? ?/sec                                   1.00     77.6±0.18µs        ? ?/sec
convert_columns 4096 string_dictionary_low_cardinality(10, 0)                                                                 1.00     25.8±0.07µs        ? ?/sec                                   1.02     26.4±0.05µs        ? ?/sec
convert_columns 4096 string_dictionary_low_cardinality(100, 0)                                                                1.00     48.8±0.28µs        ? ?/sec                                   1.01     49.4±0.06µs        ? ?/sec
convert_columns 4096 string_dictionary_low_cardinality(30, 0)                                                                 1.00     27.9±0.10µs        ? ?/sec                                   1.02     28.4±0.16µs        ? ?/sec
convert_columns 4096 u64(0)                                                                                                   1.00      9.4±0.01µs        ? ?/sec                                   1.00      9.4±0.02µs        ? ?/sec
convert_columns 4096 u64(0.3)                                                                                                 1.00     14.9±0.06µs        ? ?/sec                                   1.00     15.0±0.09µs        ? ?/sec
convert_columns_prepared 4096 4096 string_dictionary(20, 0.5), string_dictionary(30, 0), string_dictionary(100, 0), i64(0)    1.00    380.0±1.89µs        ? ?/sec                                   1.01    382.1±1.44µs        ? ?/sec
convert_columns_prepared 4096 bool(0, 0.5)                                                                                    1.01     12.3±0.01µs        ? ?/sec                                   1.00     12.2±0.02µs        ? ?/sec
convert_columns_prepared 4096 bool(0.3, 0.5)                                                                                  1.03     16.3±0.08µs        ? ?/sec                                   1.00     15.8±0.08µs        ? ?/sec
convert_columns_prepared 4096 i64(0)                                                                                          1.01      7.9±0.11µs        ? ?/sec                                   1.00      7.8±0.12µs        ? ?/sec
convert_columns_prepared 4096 i64(0.3)                                                                                        1.02     14.8±0.06µs        ? ?/sec                                   1.00     14.5±0.11µs        ? ?/sec
convert_columns_prepared 4096 string view(10, 0)                                                                              1.00     45.7±0.08µs        ? ?/sec                                   1.00     45.8±0.22µs        ? ?/sec
convert_columns_prepared 4096 string view(100, 0)                                                                             1.00     77.8±0.25µs        ? ?/sec                                   1.02     79.1±0.30µs        ? ?/sec
convert_columns_prepared 4096 string view(100, 0.5)                                                                           1.01     84.4±0.21µs        ? ?/sec                                   1.00     83.6±0.23µs        ? ?/sec
convert_columns_prepared 4096 string view(30, 0)                                                                              1.00     53.9±0.13µs        ? ?/sec                                   1.00     53.9±0.25µs        ? ?/sec
convert_columns_prepared 4096 string(10, 0)                                                                                   1.00     45.3±0.06µs        ? ?/sec                                   1.00     45.3±0.07µs        ? ?/sec
convert_columns_prepared 4096 string(100, 0)                                                                                  1.00     77.2±0.23µs        ? ?/sec                                   1.02     78.4±0.27µs        ? ?/sec
convert_columns_prepared 4096 string(100, 0.5)                                                                                1.01     82.5±0.59µs        ? ?/sec                                   1.00     81.8±0.15µs        ? ?/sec
convert_columns_prepared 4096 string(20, 0.5), string(30, 0), string(100, 0), i64(0)                                          1.01    236.9±2.09µs        ? ?/sec                                   1.00    234.9±1.14µs        ? ?/sec
convert_columns_prepared 4096 string(30, 0)                                                                                   1.00     48.6±0.07µs        ? ?/sec                                   1.01     48.8±0.12µs        ? ?/sec
convert_columns_prepared 4096 string_dictionary(10, 0)                                                                        1.00     72.6±0.09µs        ? ?/sec                                   1.00     72.8±0.12µs        ? ?/sec
convert_columns_prepared 4096 string_dictionary(100, 0)                                                                       1.01    155.2±1.16µs        ? ?/sec                                   1.00    153.2±1.26µs        ? ?/sec
convert_columns_prepared 4096 string_dictionary(100, 0.5)                                                                     1.01    118.1±0.34µs        ? ?/sec                                   1.00    116.5±0.29µs        ? ?/sec
convert_columns_prepared 4096 string_dictionary(30, 0)                                                                        1.01     77.8±0.14µs        ? ?/sec                                   1.00     77.2±0.18µs        ? ?/sec
convert_columns_prepared 4096 string_dictionary_low_cardinality(10, 0)                                                        1.00     25.2±0.04µs        ? ?/sec                                   1.01     25.3±0.03µs        ? ?/sec
convert_columns_prepared 4096 string_dictionary_low_cardinality(100, 0)                                                       1.00     47.5±0.12µs        ? ?/sec                                   1.01     48.2±0.14µs        ? ?/sec
convert_columns_prepared 4096 string_dictionary_low_cardinality(30, 0)                                                        1.00     26.6±0.05µs        ? ?/sec                                   1.02     27.1±0.09µs        ? ?/sec
convert_columns_prepared 4096 u64(0)                                                                                          1.00      9.3±0.02µs        ? ?/sec                                   1.00      9.3±0.02µs        ? ?/sec
convert_columns_prepared 4096 u64(0.3)                                                                                        1.00     14.9±0.06µs        ? ?/sec                                   1.00     14.9±0.10µs        ? ?/sec
convert_rows 4096 4096 string_dictionary(20, 0.5), string_dictionary(30, 0), string_dictionary(100, 0), i64(0)                1.00    297.3±0.57µs        ? ?/sec                                   1.03    305.1±3.41µs        ? ?/sec
convert_rows 4096 bool(0, 0.5)                                                                                                1.20     19.9±0.03µs        ? ?/sec                                   1.00     16.6±0.10µs        ? ?/sec
convert_rows 4096 bool(0.3, 0.5)                                                                                              1.20     20.0±0.05µs        ? ?/sec                                   1.00     16.6±0.02µs        ? ?/sec
convert_rows 4096 i64(0)                                                                                                      1.11     35.3±0.07µs        ? ?/sec                                   1.00     31.8±0.05µs        ? ?/sec
convert_rows 4096 i64(0.3)                                                                                                    1.11     35.1±0.05µs        ? ?/sec                                   1.00     31.7±0.04µs        ? ?/sec
convert_rows 4096 string view(10, 0)                                                                                          1.05     69.8±0.12µs        ? ?/sec                                   1.00     66.8±0.19µs        ? ?/sec
convert_rows 4096 string view(100, 0)                                                                                         1.04    120.4±0.53µs        ? ?/sec                                   1.00    115.6±0.64µs        ? ?/sec
convert_rows 4096 string view(100, 0.5)                                                                                       1.05    112.2±0.28µs        ? ?/sec                                   1.00    107.0±0.15µs        ? ?/sec
convert_rows 4096 string view(30, 0)                                                                                          1.04     80.1±0.20µs        ? ?/sec                                   1.00     77.0±0.13µs        ? ?/sec
convert_rows 4096 string(10, 0)                                                                                               1.05     64.1±0.12µs        ? ?/sec                                   1.00     60.9±0.15µs        ? ?/sec
convert_rows 4096 string(100, 0)                                                                                              1.03    115.4±0.34µs        ? ?/sec                                   1.00    111.7±0.34µs        ? ?/sec
convert_rows 4096 string(100, 0.5)                                                                                            1.03    109.0±0.31µs        ? ?/sec                                   1.00    105.5±0.22µs        ? ?/sec
convert_rows 4096 string(20, 0.5), string(30, 0), string(100, 0), i64(0)                                                      1.00    299.9±2.01µs        ? ?/sec                                   1.00    299.2±1.89µs        ? ?/sec
convert_rows 4096 string(30, 0)                                                                                               1.04     76.1±0.27µs        ? ?/sec                                   1.00     73.3±0.22µs        ? ?/sec
convert_rows 4096 string_dictionary(10, 0)                                                                                    1.05     64.3±0.13µs        ? ?/sec                                   1.00     61.0±0.15µs        ? ?/sec
convert_rows 4096 string_dictionary(100, 0)                                                                                   1.03    115.5±0.46µs        ? ?/sec                                   1.00    111.9±0.32µs        ? ?/sec
convert_rows 4096 string_dictionary(100, 0.5)                                                                                 1.03    109.1±0.27µs        ? ?/sec                                   1.00    106.2±0.27µs        ? ?/sec
convert_rows 4096 string_dictionary(30, 0)                                                                                    1.04     76.5±0.22µs        ? ?/sec                                   1.00     73.5±0.19µs        ? ?/sec
convert_rows 4096 string_dictionary_low_cardinality(10, 0)                                                                    1.05     64.3±0.11µs        ? ?/sec                                   1.00     61.3±0.12µs        ? ?/sec
convert_rows 4096 string_dictionary_low_cardinality(100, 0)                                                                   1.03    115.3±0.32µs        ? ?/sec                                   1.00    111.8±0.58µs        ? ?/sec
convert_rows 4096 string_dictionary_low_cardinality(30, 0)                                                                    1.03     76.3±0.29µs        ? ?/sec                                   1.00     73.8±0.12µs        ? ?/sec
convert_rows 4096 u64(0)                                                                                                      1.11     33.8±0.05µs        ? ?/sec                                   1.00     30.5±0.08µs        ? ?/sec
convert_rows 4096 u64(0.3)                                                                                                    1.11     34.0±0.05µs        ? ?/sec                                   1.00     30.6±0.05µs        ? ?/sec
iterate rows                                                                                                                  1.00      2.6±0.00µs        ? ?/sec                                   1.28      3.3±0.01µs        ? ?/sec

@alamb
Copy link
Contributor

alamb commented Jul 1, 2025

I will rerun the benchmarks on this PR again -- some of the results look like noise

@alamb
Copy link
Contributor

alamb commented Jul 1, 2025

🤖 ./gh_compare_arrow.sh Benchmark Script Running
Linux aal-dev 6.11.0-1016-gcp #16~24.04.1-Ubuntu SMP Wed May 28 02:40:52 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing findepi/fix-rowconverter-when-fixedsizelist-is-not-the-last-b962b2 (aa926c3) to 01c5efc diff
BENCH_NAME=row_format
BENCH_COMMAND=cargo bench --features=arrow,async,test_common,experimental --bench row_format
BENCH_FILTER=
BENCH_BRANCH_NAME=findepi_fix-rowconverter-when-fixedsizelist-is-not-the-last-b962b2
Results will be posted here when complete

@alamb
Copy link
Contributor

alamb commented Jul 1, 2025

🤖: Benchmark completed

Details

group                                                                                                                         findepi_fix-rowconverter-when-fixedsizelist-is-not-the-last-b962b2    main
-----                                                                                                                         ------------------------------------------------------------------    ----
convert_columns 4096 4096 string_dictionary(20, 0.5), string_dictionary(30, 0), string_dictionary(100, 0), i64(0)             1.00    381.8±2.21µs        ? ?/sec                                   1.00    380.8±1.88µs        ? ?/sec
convert_columns 4096 bool(0, 0.5)                                                                                             1.01     12.4±0.03µs        ? ?/sec                                   1.00     12.3±0.03µs        ? ?/sec
convert_columns 4096 bool(0.3, 0.5)                                                                                           1.03     16.4±0.09µs        ? ?/sec                                   1.00     16.0±0.06µs        ? ?/sec
convert_columns 4096 i64(0)                                                                                                   1.01      7.9±0.12µs        ? ?/sec                                   1.00      7.8±0.13µs        ? ?/sec
convert_columns 4096 i64(0.3)                                                                                                 1.02     15.0±0.07µs        ? ?/sec                                   1.00     14.7±0.07µs        ? ?/sec
convert_columns 4096 string view(10, 0)                                                                                       1.00     45.8±0.23µs        ? ?/sec                                   1.00     45.9±0.17µs        ? ?/sec
convert_columns 4096 string view(100, 0)                                                                                      1.00     78.5±0.70µs        ? ?/sec                                   1.00     78.3±0.45µs        ? ?/sec
convert_columns 4096 string view(100, 0.5)                                                                                    1.00     84.5±0.36µs        ? ?/sec                                   1.00     84.5±0.30µs        ? ?/sec
convert_columns 4096 string view(30, 0)                                                                                       1.00     54.2±0.26µs        ? ?/sec                                   1.00     54.3±0.18µs        ? ?/sec
convert_columns 4096 string(10, 0)                                                                                            1.00     45.5±0.08µs        ? ?/sec                                   1.00     45.7±0.06µs        ? ?/sec
convert_columns 4096 string(100, 0)                                                                                           1.00     77.5±0.56µs        ? ?/sec                                   1.00     77.8±0.82µs        ? ?/sec
convert_columns 4096 string(100, 0.5)                                                                                         1.04     82.8±0.52µs        ? ?/sec                                   1.00     79.8±0.28µs        ? ?/sec
convert_columns 4096 string(20, 0.5), string(30, 0), string(100, 0), i64(0)                                                   1.00    234.6±1.35µs        ? ?/sec                                   1.00    233.8±0.81µs        ? ?/sec
convert_columns 4096 string(30, 0)                                                                                            1.00     48.7±0.10µs        ? ?/sec                                   1.00     48.9±0.16µs        ? ?/sec
convert_columns 4096 string_dictionary(10, 0)                                                                                 1.00     71.4±0.31µs        ? ?/sec                                   1.04     74.5±0.11µs        ? ?/sec
convert_columns 4096 string_dictionary(100, 0)                                                                                1.00    153.8±0.97µs        ? ?/sec                                   1.00    153.4±2.40µs        ? ?/sec
convert_columns 4096 string_dictionary(100, 0.5)                                                                              1.01    117.9±0.35µs        ? ?/sec                                   1.00    116.9±1.25µs        ? ?/sec
convert_columns 4096 string_dictionary(30, 0)                                                                                 1.05     81.6±0.56µs        ? ?/sec                                   1.00     77.7±1.02µs        ? ?/sec
convert_columns 4096 string_dictionary_low_cardinality(10, 0)                                                                 1.00     25.7±0.04µs        ? ?/sec                                   1.00     25.7±0.05µs        ? ?/sec
convert_columns 4096 string_dictionary_low_cardinality(100, 0)                                                                1.00     48.8±0.12µs        ? ?/sec                                   1.02     49.9±0.13µs        ? ?/sec
convert_columns 4096 string_dictionary_low_cardinality(30, 0)                                                                 1.00     27.7±0.06µs        ? ?/sec                                   1.01     28.1±0.07µs        ? ?/sec
convert_columns 4096 u64(0)                                                                                                   1.00      9.4±0.02µs        ? ?/sec                                   1.00      9.4±0.02µs        ? ?/sec
convert_columns 4096 u64(0.3)                                                                                                 1.01     15.1±0.10µs        ? ?/sec                                   1.00     15.0±0.08µs        ? ?/sec
convert_columns_prepared 4096 4096 string_dictionary(20, 0.5), string_dictionary(30, 0), string_dictionary(100, 0), i64(0)    1.01    380.7±2.24µs        ? ?/sec                                   1.00    377.5±2.60µs        ? ?/sec
convert_columns_prepared 4096 bool(0, 0.5)                                                                                    1.01     12.3±0.05µs        ? ?/sec                                   1.00     12.2±0.02µs        ? ?/sec
convert_columns_prepared 4096 bool(0.3, 0.5)                                                                                  1.03     16.3±0.07µs        ? ?/sec                                   1.00     15.8±0.13µs        ? ?/sec
convert_columns_prepared 4096 i64(0)                                                                                          1.00      7.8±0.12µs        ? ?/sec                                   1.00      7.8±0.13µs        ? ?/sec
convert_columns_prepared 4096 i64(0.3)                                                                                        1.03     14.9±0.16µs        ? ?/sec                                   1.00     14.5±0.07µs        ? ?/sec
convert_columns_prepared 4096 string view(10, 0)                                                                              1.01     46.0±0.26µs        ? ?/sec                                   1.00     45.5±0.09µs        ? ?/sec
convert_columns_prepared 4096 string view(100, 0)                                                                             1.00     78.4±0.69µs        ? ?/sec                                   1.00     78.1±0.26µs        ? ?/sec
convert_columns_prepared 4096 string view(100, 0.5)                                                                           1.00     84.2±0.40µs        ? ?/sec                                   1.01     84.7±0.48µs        ? ?/sec
convert_columns_prepared 4096 string view(30, 0)                                                                              1.00     54.1±0.52µs        ? ?/sec                                   1.00     54.1±0.16µs        ? ?/sec
convert_columns_prepared 4096 string(10, 0)                                                                                   1.00     45.5±0.10µs        ? ?/sec                                   1.00     45.4±0.09µs        ? ?/sec
convert_columns_prepared 4096 string(100, 0)                                                                                  1.00     77.2±0.50µs        ? ?/sec                                   1.02     78.6±3.30µs        ? ?/sec
convert_columns_prepared 4096 string(100, 0.5)                                                                                1.03     82.4±0.49µs        ? ?/sec                                   1.00     79.9±0.35µs        ? ?/sec
convert_columns_prepared 4096 string(20, 0.5), string(30, 0), string(100, 0), i64(0)                                          1.02    237.0±1.35µs        ? ?/sec                                   1.00    233.3±1.10µs        ? ?/sec
convert_columns_prepared 4096 string(30, 0)                                                                                   1.00     48.7±0.33µs        ? ?/sec                                   1.00     48.7±0.09µs        ? ?/sec
convert_columns_prepared 4096 string_dictionary(10, 0)                                                                        1.00     70.6±0.36µs        ? ?/sec                                   1.03     72.5±0.74µs        ? ?/sec
convert_columns_prepared 4096 string_dictionary(100, 0)                                                                       1.00    152.9±0.69µs        ? ?/sec                                   1.00    153.6±2.13µs        ? ?/sec
convert_columns_prepared 4096 string_dictionary(100, 0.5)                                                                     1.01    116.8±0.38µs        ? ?/sec                                   1.00    115.9±1.29µs        ? ?/sec
convert_columns_prepared 4096 string_dictionary(30, 0)                                                                        1.03     78.5±0.38µs        ? ?/sec                                   1.00     76.2±0.83µs        ? ?/sec
convert_columns_prepared 4096 string_dictionary_low_cardinality(10, 0)                                                        1.00     25.1±0.06µs        ? ?/sec                                   1.00     25.1±0.04µs        ? ?/sec
convert_columns_prepared 4096 string_dictionary_low_cardinality(100, 0)                                                       1.00     47.4±0.12µs        ? ?/sec                                   1.01     48.0±0.10µs        ? ?/sec
convert_columns_prepared 4096 string_dictionary_low_cardinality(30, 0)                                                        1.00     27.3±0.06µs        ? ?/sec                                   1.00     27.2±0.04µs        ? ?/sec
convert_columns_prepared 4096 u64(0)                                                                                          1.00      9.3±0.02µs        ? ?/sec                                   1.00      9.4±0.01µs        ? ?/sec
convert_columns_prepared 4096 u64(0.3)                                                                                        1.00     14.9±0.11µs        ? ?/sec                                   1.00     14.9±0.11µs        ? ?/sec
convert_rows 4096 4096 string_dictionary(20, 0.5), string_dictionary(30, 0), string_dictionary(100, 0), i64(0)                1.02    304.3±1.77µs        ? ?/sec                                   1.00    297.7±1.94µs        ? ?/sec
convert_rows 4096 bool(0, 0.5)                                                                                                1.20     20.0±0.03µs        ? ?/sec                                   1.00     16.6±0.03µs        ? ?/sec
convert_rows 4096 bool(0.3, 0.5)                                                                                              1.20     20.0±0.07µs        ? ?/sec                                   1.00     16.6±0.03µs        ? ?/sec
convert_rows 4096 i64(0)                                                                                                      1.11     35.1±0.08µs        ? ?/sec                                   1.00     31.8±0.07µs        ? ?/sec
convert_rows 4096 i64(0.3)                                                                                                    1.11     35.2±0.08µs        ? ?/sec                                   1.00     31.8±0.11µs        ? ?/sec
convert_rows 4096 string view(10, 0)                                                                                          1.05     70.0±0.44µs        ? ?/sec                                   1.00     66.7±0.13µs        ? ?/sec
convert_rows 4096 string view(100, 0)                                                                                         1.03    118.7±0.63µs        ? ?/sec                                   1.00    115.6±0.41µs        ? ?/sec
convert_rows 4096 string view(100, 0.5)                                                                                       1.03    110.8±0.61µs        ? ?/sec                                   1.00    108.0±0.58µs        ? ?/sec
convert_rows 4096 string view(30, 0)                                                                                          1.04     80.0±0.64µs        ? ?/sec                                   1.00     76.8±0.17µs        ? ?/sec
convert_rows 4096 string(10, 0)                                                                                               1.06     64.3±0.20µs        ? ?/sec                                   1.00     61.0±0.14µs        ? ?/sec
convert_rows 4096 string(100, 0)                                                                                              1.03    114.7±0.89µs        ? ?/sec                                   1.00    111.6±0.42µs        ? ?/sec
convert_rows 4096 string(100, 0.5)                                                                                            1.03    109.4±0.63µs        ? ?/sec                                   1.00    105.8±0.38µs        ? ?/sec
convert_rows 4096 string(20, 0.5), string(30, 0), string(100, 0), i64(0)                                                      1.03    303.9±2.38µs        ? ?/sec                                   1.00    295.1±1.80µs        ? ?/sec
convert_rows 4096 string(30, 0)                                                                                               1.04     76.3±0.31µs        ? ?/sec                                   1.00     73.1±0.37µs        ? ?/sec
convert_rows 4096 string_dictionary(10, 0)                                                                                    1.06     64.4±0.39µs        ? ?/sec                                   1.00     61.0±0.62µs        ? ?/sec
convert_rows 4096 string_dictionary(100, 0)                                                                                   1.02    115.0±0.49µs        ? ?/sec                                   1.00    112.5±1.39µs        ? ?/sec
convert_rows 4096 string_dictionary(100, 0.5)                                                                                 1.03    109.1±0.32µs        ? ?/sec                                   1.00    106.2±1.05µs        ? ?/sec
convert_rows 4096 string_dictionary(30, 0)                                                                                    1.05     76.8±0.23µs        ? ?/sec                                   1.00     73.2±0.82µs        ? ?/sec
convert_rows 4096 string_dictionary_low_cardinality(10, 0)                                                                    1.06     64.5±0.12µs        ? ?/sec                                   1.00     60.9±0.13µs        ? ?/sec
convert_rows 4096 string_dictionary_low_cardinality(100, 0)                                                                   1.02    114.8±0.43µs        ? ?/sec                                   1.00    112.0±0.56µs        ? ?/sec
convert_rows 4096 string_dictionary_low_cardinality(30, 0)                                                                    1.05     76.9±0.58µs        ? ?/sec                                   1.00     73.0±0.21µs        ? ?/sec
convert_rows 4096 u64(0)                                                                                                      1.11     33.9±0.07µs        ? ?/sec                                   1.00     30.5±0.06µs        ? ?/sec
convert_rows 4096 u64(0.3)                                                                                                    1.11     34.0±0.06µs        ? ?/sec                                   1.00     30.6±0.08µs        ? ?/sec
iterate rows                                                                                                                  1.00      2.6±0.00µs        ? ?/sec                                   1.28      3.3±0.01µs        ? ?/sec

@findepi
Copy link
Member Author

findepi commented Jul 2, 2025

It looks like convert_rows 4096 bool(0, 0.5) is consistently regressing 20%. Am i reading this correctly?
Can this be direct caused by per-batch checks added here?

@alamb
Copy link
Contributor

alamb commented Jul 2, 2025

It looks like convert_rows 4096 bool(0, 0.5) is consistently regressing 20%. Am i reading this correctly? Can this be direct caused by per-batch checks added here?

Possibly -- it could also be noise in the benchmark

the next step woudl be to see if we can reproduce the slowdown locally (run cargo bench locally) -- if not we coudl assign blame to the noise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants