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

Function TestGetColumnsV3

cpp/src/arrow/flight/sql/odbc/odbc_impl/main.cc:171–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171void TestGetColumnsV3(const std::shared_ptr<Connection>& connection) {
172 const std::shared_ptr<Statement>& statement = connection->CreateStatement();
173 std::string table_name = "test_numeric";
174 std::string column_name = "%";
175 const std::shared_ptr<ResultSet>& result_set =
176 statement->GetColumns_V3(nullptr, nullptr, &table_name, &column_name);
177
178 const std::shared_ptr<ResultSetMetadata>& metadata = result_set->GetMetadata();
179 size_t column_count = metadata->GetColumnCount();
180
181 int buffer_length = 1024;
182 std::vector<char> result(buffer_length);
183 ssize_t result_length;
184
185 while (result_set->Move(1, 0, 0, nullptr) == 1) {
186 for (size_t i = 0; i < column_count; ++i) {
187 result_set->GetData(1 + i, arrow::flight::sql::odbc::CDataType_CHAR, 0, 0,
188 result.data(), buffer_length, &result_length);
189 std::cout << (result_length != -1 ? result.data() : "NULL") << '\t';
190 }
191
192 std::cout << std::endl;
193 }
194
195 std::cout << column_count << std::endl;
196}
197
198int main() {
199 FlightSqlDriver driver;

Callers

nothing calls this directly

Calls 7

GetColumns_V3Method · 0.80
GetMetadataMethod · 0.80
CreateStatementMethod · 0.45
GetColumnCountMethod · 0.45
MoveMethod · 0.45
GetDataMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected