dbms: change fields names for sending external tables through http [METR-10071]

This commit is contained in:
Sergey Fedorov 2014-04-09 17:32:00 +04:00
parent 8f39a1177a
commit 23e06540cb
2 changed files with 9 additions and 9 deletions

View File

@ -200,14 +200,14 @@ public:
/// Получаем параметры
name = content.get("name", "_data");
format = params.get("format" + name, "TabSeparated");
format = params.get(name + "_format", "TabSeparated");
if (params.has("structure" + name))
parseStructureFromStructureField(params.get("structure" + name));
else if (params.has("types" + name))
parseStructureFromTypesField(params.get("types" + name));
if (params.has(name + "_structure"))
parseStructureFromStructureField(params.get(name + "_structure"));
else if (params.has(name + "_types"))
parseStructureFromTypesField(params.get(name + "_types"));
else
throw Exception("Neither structure nor types have not been provided for external table " + name + ". Use fields structure" + name + " or types" + name + " to do so.", ErrorCodes::BAD_ARGUMENTS);
throw Exception("Neither structure nor types have not been provided for external table " + name + ". Use fields " + name + "_structure or " + name + "_types to do so.", ErrorCodes::BAD_ARGUMENTS);
ExternalTableData data = getData(context);

View File

@ -99,9 +99,9 @@ void HTTPHandler::processQuery(Poco::Net::HTTPServerRequest & request, Poco::Net
/// Удаляем уже нененужные параметры из хранилища, чтобы впоследствии не перепутать их с натройками контекста и параметрами запроса.
for (const auto & it : handler.names)
{
params.erase("format" + it);
params.erase("types" + it);
params.erase("structure" + it);
params.erase(it + "_format");
params.erase(it + "_types");
params.erase(it + "_structure");
}
}
else