Skip to content

Commit 3723588

Browse files
committed
Address David's comments
Use `std::nullopt;` and specify return type.
1 parent 592b57a commit 3723588

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_stream_chunk_buffer.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ FlightStreamChunkBuffer::FlightStreamChunkBuffer(
5959
std::shared_ptr<FlightStreamReader> stream_reader_ptr(std::move(result.ValueOrDie()));
6060

6161
BlockingQueue<std::pair<Result<FlightStreamChunk>,
62-
std::shared_ptr<FlightSqlClient>>>::Supplier supplier = [=] {
62+
std::shared_ptr<FlightSqlClient>>>::Supplier supplier = [=]()
63+
-> std::optional<
64+
std::pair<Result<FlightStreamChunk>, std::shared_ptr<FlightSqlClient>>> {
6365
auto result = stream_reader_ptr->Next();
6466
bool is_not_ok = !result.ok();
6567
bool is_not_empty = result.ok() && (result.ValueOrDie().data != nullptr);
@@ -72,8 +74,7 @@ FlightStreamChunkBuffer::FlightStreamChunkBuffer(
7274
return std::make_optional(
7375
std::make_pair(std::move(result), temp_flight_sql_client));
7476
} else {
75-
return std::optional<std::pair<arrow::Result<FlightStreamChunk>,
76-
std::shared_ptr<FlightSqlClient>>>{};
77+
return std::nullopt;
7778
}
7879
};
7980
queue_.AddProducer(std::move(supplier));

cpp/src/arrow/flight/sql/odbc/odbc_impl/types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ enum RowStatus : uint16_t {
172172
};
173173

174174
struct MetadataSettings {
175-
std::optional<int32_t> string_column_length{std::nullopt};
175+
std::optional<int32_t> string_column_length;
176176
size_t chunk_buffer_capacity;
177177
bool use_wide_char;
178178
};

0 commit comments

Comments
 (0)