mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
wip
This commit is contained in:
parent
d56fc2fd39
commit
099edebc28
@ -44,6 +44,7 @@ private:
|
||||
const std::string host;
|
||||
int port;
|
||||
const std::string path;
|
||||
const std::string method;
|
||||
|
||||
const std::string format;
|
||||
Block sample_block;
|
||||
|
@ -19,10 +19,10 @@ namespace DB
|
||||
class ReadBufferFromHTTP : public ReadBuffer
|
||||
{
|
||||
private:
|
||||
String method;
|
||||
String host;
|
||||
int port;
|
||||
String path;
|
||||
String method;
|
||||
|
||||
Poco::Net::HTTPClientSession session;
|
||||
std::istream * istr; /// owned by session
|
||||
|
@ -3,8 +3,7 @@
|
||||
#include <DB/Interpreters/Context.h>
|
||||
#include <DB/Dictionaries/OwningBufferBlockInputStream.h>
|
||||
#include <DB/IO/ReadBufferFromHTTP.h>
|
||||
#include <DB/IO/RemoteReadBuffer.h>
|
||||
#include <Poco/Net/HTTPRequest.h>
|
||||
//#include <Poco/Net/HTTPRequest.h> // HTTP_GET
|
||||
|
||||
namespace DB
|
||||
{
|
||||
@ -16,6 +15,7 @@ HTTPDictionarySource::HTTPDictionarySource(const Poco::Util::AbstractConfigurati
|
||||
host{config.getString(config_prefix + ".host")},
|
||||
port{std::stoi(config.getString(config_prefix + ".port"))},
|
||||
path{config.getString(config_prefix + ".path")},
|
||||
method{config.getString(config_prefix + ".method")},
|
||||
format{config.getString(config_prefix + ".format")},
|
||||
sample_block{sample_block},
|
||||
context(context)
|
||||
@ -36,7 +36,7 @@ HTTPDictionarySource::HTTPDictionarySource(const HTTPDictionarySource & other) :
|
||||
|
||||
BlockInputStreamPtr HTTPDictionarySource::loadAll()
|
||||
{
|
||||
auto in_ptr = std::make_unique<ReadBufferFromHTTP>(host, port, path, params, Poco::Net::HTTPRequest::HTTP_GET);
|
||||
auto in_ptr = std::make_unique<ReadBufferFromHTTP>(host, port, path, ReadBufferFromHTTP::Params(), method);
|
||||
auto stream = context.getInputFormat( format, *in_ptr, sample_block, max_block_size);
|
||||
return std::make_shared<OwningBufferBlockInputStream>(stream, std::move(in_ptr));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user