MCPcopy Create free account
hub / github.com/apache/arrow / GetData

Method GetData

cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_result_set.cc:217–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215}
216
217SQLRETURN FlightSqlResultSet::GetData(int column_n, int16_t target_type, int precision,
218 int scale, void* buffer, size_t buffer_length,
219 ssize_t* str_len_buffer) {
220 reset_get_data_ = true;
221 // Check if the offset is already at the end.
222 int64_t& value_offset = get_data_offsets_[column_n - 1];
223 if (value_offset == -1) {
224 return SQL_NO_DATA;
225 }
226
227 ColumnBinding binding(util::ConvertCDataTypeFromV2ToV3(target_type), precision, scale,
228 buffer, buffer_length, str_len_buffer);
229
230 auto& column = columns_[column_n - 1];
231 Accessor* accessor = column.GetAccessorForGetData(binding.target_type);
232
233 // Note: current_row_ is always positioned at the index _after_ the one we are
234 // on after calling Move(). So if we want to get data from the _last_ row
235 // fetched, we need to subtract one from the current row.
236 accessor->GetColumnarData(&binding, current_row_ - 1, 1, value_offset, true,
237 diagnostics_, nullptr);
238
239 // If there was truncation, the converter would have reported it to the diagnostics.
240 if (diagnostics_.HasWarning()) {
241 return SQL_SUCCESS_WITH_INFO;
242 } else {
243 return SQL_SUCCESS;
244 }
245}
246
247std::shared_ptr<ResultSetMetadata> FlightSqlResultSet::GetMetadata() { return metadata_; }
248

Callers

nothing calls this directly

Calls 4

GetAccessorForGetDataMethod · 0.80
GetColumnarDataMethod · 0.80
HasWarningMethod · 0.80

Tested by

no test coverage detected