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

[C++][Parquet] Minor: Using arrow::Buffer "data_as" api to replace the reinterpret_cast #39419

Closed
mapleFU opened this issue Jan 2, 2024 · 0 comments · Fixed by #39420
Closed

Comments

@mapleFU
Copy link
Member

mapleFU commented Jan 2, 2024

Describe the enhancement requested

A lots of reinterpret_cast api is used in Parquet decoder/encoder. Now that we has {mutable}_data_as<T> api, we can using them to replace the reinterpret_cast api.

Component(s)

C++, Parquet

mapleFU added a commit that referenced this issue Jan 5, 2024
…r than reinterpret_cast (#39420)

### Rationale for this change

This patch using `{mutable}_data_as<T>()` api to replace `interpret_cast<{const} T*>`. It's just a style fixing.

### What changes are included in this PR?

Just api replacement for `::arrow::Buffer`

* `reinterpret_cast<T*>` -> `mutable_data_as<T>()`
* `reinterpret_cast<const T*>` -> `data_as<T>()`

Also, for `auto {variable_name} = reinterpret_cast<{mutable} T*>( ... )`, I changed it to:
1. `const auto*` for `data_as<T>()`.
2. `auto*` for `mutable_data_as<T>()`

This didn't change the syntax, but make it more readable.

### Are these changes tested?

No need

### Are there any user-facing changes?

no

* Closes: #39419 
* 

Authored-by: mwish <maplewish117@gmail.com>
Signed-off-by: mwish <maplewish117@gmail.com>
@mapleFU mapleFU added this to the 15.0.0 milestone Jan 5, 2024
clayburn pushed a commit to clayburn/arrow that referenced this issue Jan 23, 2024
… rather than reinterpret_cast (apache#39420)

### Rationale for this change

This patch using `{mutable}_data_as<T>()` api to replace `interpret_cast<{const} T*>`. It's just a style fixing.

### What changes are included in this PR?

Just api replacement for `::arrow::Buffer`

* `reinterpret_cast<T*>` -> `mutable_data_as<T>()`
* `reinterpret_cast<const T*>` -> `data_as<T>()`

Also, for `auto {variable_name} = reinterpret_cast<{mutable} T*>( ... )`, I changed it to:
1. `const auto*` for `data_as<T>()`.
2. `auto*` for `mutable_data_as<T>()`

This didn't change the syntax, but make it more readable.

### Are these changes tested?

No need

### Are there any user-facing changes?

no

* Closes: apache#39419 
* 

Authored-by: mwish <maplewish117@gmail.com>
Signed-off-by: mwish <maplewish117@gmail.com>
dgreiss pushed a commit to dgreiss/arrow that referenced this issue Feb 19, 2024
… rather than reinterpret_cast (apache#39420)

### Rationale for this change

This patch using `{mutable}_data_as<T>()` api to replace `interpret_cast<{const} T*>`. It's just a style fixing.

### What changes are included in this PR?

Just api replacement for `::arrow::Buffer`

* `reinterpret_cast<T*>` -> `mutable_data_as<T>()`
* `reinterpret_cast<const T*>` -> `data_as<T>()`

Also, for `auto {variable_name} = reinterpret_cast<{mutable} T*>( ... )`, I changed it to:
1. `const auto*` for `data_as<T>()`.
2. `auto*` for `mutable_data_as<T>()`

This didn't change the syntax, but make it more readable.

### Are these changes tested?

No need

### Are there any user-facing changes?

no

* Closes: apache#39419 
* 

Authored-by: mwish <maplewish117@gmail.com>
Signed-off-by: mwish <maplewish117@gmail.com>
zanmato1984 pushed a commit to zanmato1984/arrow that referenced this issue Feb 28, 2024
… rather than reinterpret_cast (apache#39420)

### Rationale for this change

This patch using `{mutable}_data_as<T>()` api to replace `interpret_cast<{const} T*>`. It's just a style fixing.

### What changes are included in this PR?

Just api replacement for `::arrow::Buffer`

* `reinterpret_cast<T*>` -> `mutable_data_as<T>()`
* `reinterpret_cast<const T*>` -> `data_as<T>()`

Also, for `auto {variable_name} = reinterpret_cast<{mutable} T*>( ... )`, I changed it to:
1. `const auto*` for `data_as<T>()`.
2. `auto*` for `mutable_data_as<T>()`

This didn't change the syntax, but make it more readable.

### Are these changes tested?

No need

### Are there any user-facing changes?

no

* Closes: apache#39419 
* 

Authored-by: mwish <maplewish117@gmail.com>
Signed-off-by: mwish <maplewish117@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment