MCPcopy Create free account
hub / github.com/ByConity/ByConity / getRemoteCreateTable

Method getRemoteCreateTable

programs/copier/ClusterCopier.cpp:1726–1736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1724}
1725
1726String ClusterCopier::getRemoteCreateTable(const DatabaseAndTableName & table, Connection & connection, const Settings & settings)
1727{
1728 auto remote_context = Context::createCopy(context);
1729 remote_context->setSettings(settings);
1730
1731 String query = "SHOW CREATE TABLE " + getQuotedTable(table);
1732 Block block = getBlockWithAllStreamData(std::make_shared<RemoteBlockInputStream>(
1733 connection, query, InterpreterShowCreateQuery::getSampleBlock(), remote_context));
1734
1735 return typeid_cast<const ColumnString &>(*block.safeGetByPosition(0).column).getDataAt(0).toString();
1736}
1737
1738
1739ASTPtr ClusterCopier::getCreateTableForPullShard(const ConnectionTimeouts & timeouts, TaskShard & task_shard)

Callers

nothing calls this directly

Calls 5

getQuotedTableFunction · 0.85
setSettingsMethod · 0.45
toStringMethod · 0.45
getDataAtMethod · 0.45

Tested by

no test coverage detected