MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / getTableStructureAndFormatFromDataImpl

Method getTableStructureAndFormatFromDataImpl

src/Storages/StorageURL.cpp:1048–1070  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1046}
1047
1048std::pair<ColumnsDescription, String> IStorageURLBase::getTableStructureAndFormatFromDataImpl(
1049 std::optional<String> format,
1050 const String & uri,
1051 CompressionMethod compression_method,
1052 const HTTPHeaderEntries & headers,
1053 const std::optional<FormatSettings> & format_settings,
1054 const ContextPtr & context)
1055{
1056 context->getRemoteHostFilter().checkURL(Poco::URI(uri));
1057
1058 Poco::Net::HTTPBasicCredentials credentials;
1059
1060 std::vector<String> urls_to_check;
1061 if (urlWithGlobs(uri))
1062 urls_to_check = parseRemoteDescription(uri, 0, uri.size(), ',', context->getSettingsRef()[Setting::glob_expansion_max_elements], "url");
1063 else
1064 urls_to_check = {uri};
1065
1066 ReadBufferIterator read_buffer_iterator(urls_to_check, format, compression_method, headers, format_settings, context);
1067 if (format)
1068 return {readSchemaFromFormat(*format, format_settings, read_buffer_iterator, context), *format};
1069 return detectFormatAndReadSchema(format_settings, read_buffer_iterator, context);
1070}
1071
1072ColumnsDescription IStorageURLBase::getTableStructureFromData(
1073 const String & format,

Callers

nothing calls this directly

Calls 7

urlWithGlobsFunction · 0.85
parseRemoteDescriptionFunction · 0.85
readSchemaFromFormatFunction · 0.85
checkURLMethod · 0.80
URIClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected