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

Implement StringBuilder::append_option #263

Closed
alamb opened this issue May 5, 2021 · 2 comments · Fixed by #601
Closed

Implement StringBuilder::append_option #263

alamb opened this issue May 5, 2021 · 2 comments · Fixed by #601
Assignees
Labels
arrow Changes to the arrow crate good first issue Good for newcomers

Comments

@alamb
Copy link
Contributor

alamb commented May 5, 2021

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
I am frustrated when trying to build StringArrays using the StringBuilder.

Specifically, yhere are some places I have to / find it more convenience to use a builder (rather than the From impl) to build StringArrays, such as https://github.com/influxdata/influxdb_iox/blob/main/server/src/db/system_tables.rs#L125 where we are building system tables in IOX

With PrimitiveArrayBuilder based builders such as UInt64Builder, I can use the append_option function in the following way:

int_builder.append_option(size)?;

Which is 👍

However, since there is no corresponding append_option on GenericStringBuilder I have have to do something this which takes more time and is 👎

                if let Some(v) = column.stats.min_as_str() {
                    min_values.append_value(v)?;
                } else {
                    min_values.append(false)?;
                }

Describe the solution you'd like
Add a function StringBuilder::append_option that takes Option<AsRef<str>>

pub fn append_option(&mut self, v: Option<AsRef<str>) -> Result<()> {
...
}

Describe alternatives you've considered
Continued frustration :)

Additional context
Add any other context or screenshots about the feature request here.

@alamb alamb added good first issue Good for newcomers arrow Changes to the arrow crate labels May 5, 2021
@tzzed
Copy link

tzzed commented May 6, 2021

Can I take this one ?

@alamb
Copy link
Contributor Author

alamb commented May 6, 2021

@tzzed that would be great!

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 good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants