StorageSet::StorageSet( const String & path_, const String & name_, const ColumnsDescription & columns_) : StorageSetOrJoinBase{path_, name_, columns_}, set(std::make_shared<Set>(SizeLimits(), false)) { Block header = getSampleBlock(); header = header.sortColumns(); set->setHeader(header); restore(); }
void StorageSet::truncate(const ASTPtr &) { Poco::File(path).remove(true); Poco::File(path).createDirectories(); Poco::File(path + "tmp/").createDirectories(); Block header = getSampleBlock(); header = header.sortColumns(); increment = 0; set = std::make_shared<Set>(SizeLimits(), false); set->setHeader(header); }
CreatingSetsBlockInputStream::CreatingSetsBlockInputStream( const BlockInputStreamPtr & input, const SubqueriesForSets & subqueries_for_sets_, const Context & context_) : subqueries_for_sets(subqueries_for_sets_) , context(context_) { const Settings & settings = context.getSettingsRef(); network_transfer_limits = SizeLimits( settings.max_rows_to_transfer, settings.max_bytes_to_transfer, settings.transfer_overflow_mode); for (auto & elem : subqueries_for_sets) { if (elem.second.source) { children.push_back(elem.second.source); if (elem.second.set) elem.second.set->setHeader(elem.second.source->getHeader()); } } children.push_back(input); }
void StorageJoin::truncate(const ASTPtr &) { Poco::File(path).remove(true); Poco::File(path).createDirectories(); Poco::File(path + "tmp/").createDirectories(); increment = 0; join = std::make_shared<Join>(key_names, key_names, NameSet(), false /* use_nulls */, SizeLimits(), kind, strictness); join->setSampleBlock(getSampleBlock().sortColumns()); }
StorageJoin::StorageJoin( const String & path_, const String & name_, const Names & key_names_, ASTTableJoin::Kind kind_, ASTTableJoin::Strictness strictness_, const ColumnsDescription & columns_) : StorageSetOrJoinBase{path_, name_, columns_}, key_names(key_names_), kind(kind_), strictness(strictness_) { for (const auto & key : key_names) if (!getColumns().hasPhysical(key)) throw Exception{"Key column (" + key + ") does not exist in table declaration.", ErrorCodes::NO_SUCH_COLUMN_IN_TABLE}; /// NOTE StorageJoin doesn't use join_use_nulls setting. join = std::make_shared<Join>(key_names, key_names, NameSet(), false /* use_nulls */, SizeLimits(), kind, strictness); join->setSampleBlock(getSampleBlock().sortColumns()); restore(); }