2017-05-25 19:21:57 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
2021-01-26 20:49:52 +00:00
|
|
|
|
2021-10-02 07:13:14 +00:00
|
|
|
#include <base/types.h>
|
2020-04-03 21:32:06 +00:00
|
|
|
#include <Poco/Util/AbstractConfiguration.h>
|
2021-08-04 17:58:18 +00:00
|
|
|
#include <Processors/ISimpleTransform.h>
|
2021-01-26 20:49:52 +00:00
|
|
|
#include <Columns/IColumn.h>
|
|
|
|
#include <Core/Block.h>
|
2021-04-10 23:33:54 +00:00
|
|
|
#include <Interpreters/Context_fwd.h>
|
2021-01-26 20:49:52 +00:00
|
|
|
|
2021-05-28 18:17:16 +00:00
|
|
|
|
2017-05-25 19:21:57 +00:00
|
|
|
namespace DB
|
|
|
|
{
|
2021-02-28 21:04:05 +00:00
|
|
|
|
2017-05-25 19:21:57 +00:00
|
|
|
struct DictionaryStructure;
|
2021-08-12 15:16:55 +00:00
|
|
|
class SettingsChanges;
|
2020-04-03 21:32:06 +00:00
|
|
|
|
2017-05-25 19:21:57 +00:00
|
|
|
/// For simple key
|
2021-01-26 20:49:52 +00:00
|
|
|
|
2021-01-27 13:23:02 +00:00
|
|
|
Block blockForIds(
|
|
|
|
const DictionaryStructure & dict_struct,
|
|
|
|
const std::vector<UInt64> & ids);
|
2017-05-25 19:21:57 +00:00
|
|
|
|
|
|
|
/// For composite key
|
2021-01-26 20:49:52 +00:00
|
|
|
|
|
|
|
Block blockForKeys(
|
2018-12-10 15:25:45 +00:00
|
|
|
const DictionaryStructure & dict_struct,
|
|
|
|
const Columns & key_columns,
|
|
|
|
const std::vector<size_t> & requested_rows);
|
2017-05-25 19:21:57 +00:00
|
|
|
|
2020-04-03 21:32:06 +00:00
|
|
|
/// Used for applying settings to copied context in some register[...]Source functions
|
2021-08-12 15:16:55 +00:00
|
|
|
SettingsChanges readSettingsFromDictionaryConfig(const Poco::Util::AbstractConfiguration & config, const std::string & config_prefix);
|
|
|
|
ContextMutablePtr copyContextAndApplySettingsFromDictionaryConfig(const ContextPtr & context, const Poco::Util::AbstractConfiguration & config, const std::string & config_prefix);
|
2021-01-26 20:49:52 +00:00
|
|
|
|
2021-02-28 21:04:05 +00:00
|
|
|
/** A stream, adds additional columns to each block that it will read from inner stream.
|
|
|
|
*
|
|
|
|
* block_to_add rows size must be equal to final sum rows size of all inner stream blocks.
|
|
|
|
*/
|
2021-08-04 17:58:18 +00:00
|
|
|
class TransformWithAdditionalColumns final : public ISimpleTransform
|
2021-02-28 21:04:05 +00:00
|
|
|
{
|
|
|
|
public:
|
2021-08-04 17:58:18 +00:00
|
|
|
TransformWithAdditionalColumns(Block block_to_add_, const Block & header);
|
2021-02-28 21:04:05 +00:00
|
|
|
|
2021-08-04 17:58:18 +00:00
|
|
|
void transform(Chunk & chunk) override;
|
2021-02-28 21:04:05 +00:00
|
|
|
|
|
|
|
String getName() const override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Block block_to_add;
|
|
|
|
size_t current_range_index = 0;
|
|
|
|
};
|
|
|
|
|
2021-08-06 08:41:45 +00:00
|
|
|
}
|