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

Method loadKeys

src/Dictionaries/HTTPDictionarySource.cpp:172–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172BlockIO HTTPDictionarySource::loadKeys(const Columns & key_columns, const VectorWithMemoryTracking<size_t> & requested_rows)
173{
174 LOG_TRACE(log, "loadKeys {} size = {}", toString(), requested_rows.size());
175
176 auto block = blockForKeys(dict_struct, key_columns, requested_rows);
177
178 ReadWriteBufferFromHTTP::OutStreamCallback out_stream_callback = [block, this](std::ostream & ostr)
179 {
180 WriteBufferFromOStream out_buffer(ostr);
181 auto output_format = context->getOutputFormatParallelIfPossible(configuration.format, out_buffer, block.cloneEmpty());
182 formatBlock(output_format, block);
183 out_buffer.finalize();
184 };
185
186 Poco::URI uri(configuration.url);
187
188 auto buf = BuilderRWBufferFromHTTP(uri)
189 .withConnectionGroup(HTTPConnectionGroupType::STORAGE)
190 .withMethod(Poco::Net::HTTPRequest::HTTP_POST)
191 .withSettings(context->getReadSettings())
192 .withTimeouts(timeouts)
193 .withHeaders(configuration.header_entries)
194 .withOutCallback(std::move(out_stream_callback))
195 .withDelayInit(false)
196 .create(credentials);
197
198 BlockIO io;
199 io.pipeline = createWrappedBuffer(std::move(buf));
200 return io;
201}
202
203bool HTTPDictionarySource::isModified() const
204{

Callers

nothing calls this directly

Calls 10

blockForKeysFunction · 0.85
formatBlockFunction · 0.85
getReadSettingsMethod · 0.80
toStringFunction · 0.50
sizeMethod · 0.45
cloneEmptyMethod · 0.45
finalizeMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected