MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / HandleClientShowSchema

Function HandleClientShowSchema

src/cmd/fedb.cc:4478–4504  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4476}
4477
4478void HandleClientShowSchema(const std::vector<std::string>& parts,
4479 ::fedb::client::TabletClient* client) {
4480 if (parts.size() < 3) {
4481 std::cout << "Bad show schema format" << std::endl;
4482 return;
4483 }
4484 ::fedb::api::TableMeta table_meta;
4485 try {
4486 bool ok = client->GetTableSchema(
4487 boost::lexical_cast<uint32_t>(parts[1]),
4488 boost::lexical_cast<uint32_t>(parts[2]), table_meta);
4489 if (!ok) {
4490 std::cout << "ShowSchema failed" << std::endl;
4491 return;
4492 }
4493 } catch (std::exception const& e) {
4494 std::cout << "Invalid args" << std::endl;
4495 return;
4496 }
4497 if (table_meta.column_desc_size() > 0) {
4498 ::fedb::cmd::PrintSchema(table_meta.column_desc(), table_meta.added_column_desc());
4499 printf("\n#ColumnKey\n");
4500 ::fedb::cmd::PrintColumnKey(table_meta.column_key());
4501 } else {
4502 std::cout << "No schema for table" << std::endl;
4503 }
4504}
4505
4506void HandleClientSGet(const std::vector<std::string>& parts,
4507 ::fedb::client::TabletClient* client) {

Callers 1

StartClientFunction · 0.85

Calls 4

PrintSchemaFunction · 0.85
PrintColumnKeyFunction · 0.85
sizeMethod · 0.45
GetTableSchemaMethod · 0.45

Tested by

no test coverage detected