-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-48084: [C++][FlightRPC] Replace boost::optional with std::optional #48323
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
Conversation
|
|
| return std::optional<std::pair<arrow::Result<FlightStreamChunk>, | ||
| std::shared_ptr<FlightSqlClient>>>{}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: does nullopt not work here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes nullopt works, fixed
|
|
||
| struct MetadataSettings { | ||
| boost::optional<int32_t> string_column_length{boost::none}; | ||
| std::optional<int32_t> string_column_length{std::nullopt}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default initialization is nullopt so there's no need to write it out explicitly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, good catch, fixed
Use `std::nullopt;` and specify return type.
alinaliBQ
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lidavidm Thanks, addressed all comments
| return std::optional<std::pair<arrow::Result<FlightStreamChunk>, | ||
| std::shared_ptr<FlightSqlClient>>>{}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes nullopt works, fixed
|
|
||
| struct MetadataSettings { | ||
| boost::optional<int32_t> string_column_length{boost::none}; | ||
| std::optional<int32_t> string_column_length{std::nullopt}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, good catch, fixed
|
After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit 90261d6. There was 1 benchmark result indicating a performance regression:
The full Conbench report has more details. |
Rationale for this change
Replace boost::optional with std::optional to resolve build failures on MSVC Windows CI. This PR is extracted from #48313.
What changes are included in this PR?
Replace boost::optional with std::optional in ODBC.
Are these changes tested?
Yes, locally on MSVC
Are there any user-facing changes?
N/A