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:219–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

GetAccessorForGetDataMethod · 0.80
GetColumnarDataMethod · 0.80
HasWarningMethod · 0.80

Tested by

no test coverage detected