Skip to content

Cherry pick return reference from DictionaryArray::values() (#313)#1

Closed
alamb wants to merge 1 commit intoactive_releasefrom
cherry_pick_71c21595a
Closed

Cherry pick return reference from DictionaryArray::values() (#313)#1
alamb wants to merge 1 commit intoactive_releasefrom
cherry_pick_71c21595a

Conversation

@alamb
Copy link
Owner

@alamb alamb commented May 22, 2021

Automatic cherry-pick of 71c2159

)

Signed-off-by: Raphael Taylor-Davies <r.taylordavies@googlemail.com>
alamb pushed a commit that referenced this pull request May 22, 2021
* Add ported Rust release verification script

* Minor simplifications. (#1)

Co-authored-by: Jorge Leitao <jorgecarleitao@gmail.com>
@alamb alamb closed this Jun 12, 2021
@alamb alamb deleted the cherry_pick_71c21595a branch June 12, 2021 13:11
alamb pushed a commit that referenced this pull request Jun 10, 2022
* add parquet-fromcsv (#1)

add command line tool for convert csv to parquet.

* add `text` for non-rust documentation text

* Update parquet/src/bin/parquet-fromcsv.rs

Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com>

* Update parquet/src/bin/parquet-fromcsv.rs

Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com>

* Update parquet/src/bin/parquet-fromcsv.rs

Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com>

* Update parquet/src/bin/parquet-fromcsv.rs

Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com>

* automate update help text

* remove anyhow

* add rat_exclude_files

* update test_command_help

* fix clippy warnings

* add writer-version, max-row-group-size arg

* fix cargo fmt lint

Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com>
alamb pushed a commit that referenced this pull request Aug 6, 2024
Add test for metadata equivalence
alamb pushed a commit that referenced this pull request Aug 15, 2024
Allow streaming ingest for FlightClient::execute_ingest
alamb pushed a commit that referenced this pull request Jan 26, 2026
Unit tests for Bitmask skip page
alamb pushed a commit that referenced this pull request Feb 2, 2026
# Which issue does this PR close?

small optimization

# Rationale for this change
key insight is the byte clone is cheap just a ref count compare to vec
clone is a alloc + memcopy.

before
```
let mut result = Vec::new();          // alloc #1
result.extend_from_slice(prefix);
result.extend_from_slice(suffix);

let data = Bytes::from(result.clone()); // alloc #2 + memcpy
item.set_from_bytes(data);
self.previous_value = result;          // keep Vec
```

after
```
let mut result = Vec::with_capacity(prefix_len + suffix.len()); // alloc #1
result.extend_from_slice(&self.previous_value[..prefix_len]);
result.extend_from_slice(suffix);

let data = Bytes::from(result);       // no alloc, takes Vec buffer
item.set_from_bytes(data.clone());    // cheap refcount bump
self.previous_value = data;           // move, no alloc
```

# What changes are included in this PR?
previous_value type changed to Bytes
preallocate result vec capacity.

# Are these changes tested?

the existing test should pass

# Are there any user-facing changes?

no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants