|
@@ -268,7 +268,6 @@ public:
|
|
|
headers = HTTPFORBIDDENJSON;
|
|
|
}
|
|
|
TProtoToJson::ProtoToJson(json, *DescribeResult, JsonSettings);
|
|
|
- DecodeExternalTableContent(json);
|
|
|
} else {
|
|
|
json << "null";
|
|
|
}
|
|
@@ -277,41 +276,6 @@ public:
|
|
|
PassAway();
|
|
|
}
|
|
|
|
|
|
- void DecodeExternalTableContent(TStringStream& json) const {
|
|
|
- if (!DescribeResult) {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (!DescribeResult->GetPathDescription().HasExternalTableDescription()) {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- const auto& content = DescribeResult->GetPathDescription().GetExternalTableDescription().GetContent();
|
|
|
- if (!content) {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- NJson::TJsonValue root;
|
|
|
- const auto& sourceType = DescribeResult->GetPathDescription().GetExternalTableDescription().GetSourceType();
|
|
|
- try {
|
|
|
- NJson::ReadJsonTree(json.Str(), &root);
|
|
|
- root["PathDescription"]["ExternalTableDescription"].EraseValue("Content");
|
|
|
- auto source = AppData()->ExternalSourceFactory->GetOrCreate(sourceType);
|
|
|
- auto parameters = source->GetParameters(content);
|
|
|
- for (const auto& [key, items]: parameters) {
|
|
|
- NJson::TJsonValue array{NJson::EJsonValueType::JSON_ARRAY};
|
|
|
- for (const auto& item: items) {
|
|
|
- array.AppendValue(item);
|
|
|
- }
|
|
|
- root["PathDescription"]["ExternalTableDescription"]["Content"][key] = array;
|
|
|
- }
|
|
|
- } catch (...) {
|
|
|
- BLOG_CRIT("Сan't unpack content for external table: " << sourceType << ", error: " << CurrentExceptionMessage());
|
|
|
- }
|
|
|
- json.Clear();
|
|
|
- json << root;
|
|
|
- }
|
|
|
-
|
|
|
void HandleTimeout() {
|
|
|
Send(Event->Sender, new NMon::TEvHttpInfoRes(Viewer->GetHTTPGATEWAYTIMEOUT(Event->Get()), 0, NMon::IEvHttpInfoRes::EContentType::Custom));
|
|
|
PassAway();
|