提交 86b204d1 编写于 作者: V Vitaly Baranov

IDictionary::getBlockInputStream() function, "max_block_size" parameter:...

IDictionary::getBlockInputStream() function, "max_block_size" parameter: change type UInt64 -> size_t.
上级 833aa918
......@@ -575,7 +575,7 @@ PaddedPODArray<CacheDictionary::Key> CacheDictionary::getCachedIds() const
return array;
}
BlockInputStreamPtr CacheDictionary::getBlockInputStream(const Names & column_names, UInt64 max_block_size) const
BlockInputStreamPtr CacheDictionary::getBlockInputStream(const Names & column_names, size_t max_block_size) const
{
using BlockInputStreamType = DictionaryBlockInputStream<CacheDictionary, Key>;
return std::make_shared<BlockInputStreamType>(shared_from_this(), max_block_size, getCachedIds(), column_names);
......
......@@ -149,7 +149,7 @@ public:
void has(const PaddedPODArray<Key> & ids, PaddedPODArray<UInt8> & out) const override;
BlockInputStreamPtr getBlockInputStream(const Names & column_names, UInt64 max_block_size) const override;
BlockInputStreamPtr getBlockInputStream(const Names & column_names, size_t max_block_size) const override;
private:
template <typename Value>
......
......@@ -383,7 +383,7 @@ bool ComplexKeyCacheDictionary::isEmptyCell(const UInt64 idx) const
&& (idx != zero_cell_idx || cells[idx].data == ext::safe_bit_cast<CellMetadata::time_point_urep_t>(CellMetadata::time_point_t())));
}
BlockInputStreamPtr ComplexKeyCacheDictionary::getBlockInputStream(const Names & column_names, UInt64 max_block_size) const
BlockInputStreamPtr ComplexKeyCacheDictionary::getBlockInputStream(const Names & column_names, size_t max_block_size) const
{
std::vector<StringRef> keys;
{
......
......@@ -180,7 +180,7 @@ public:
void has(const Columns & key_columns, const DataTypes & key_types, PaddedPODArray<UInt8> & out) const;
BlockInputStreamPtr getBlockInputStream(const Names & column_names, UInt64 max_block_size) const override;
BlockInputStreamPtr getBlockInputStream(const Names & column_names, size_t max_block_size) const override;
private:
template <typename Value>
......
......@@ -784,7 +784,7 @@ std::vector<StringRef> ComplexKeyHashedDictionary::getKeys(const Attribute & att
return keys;
}
BlockInputStreamPtr ComplexKeyHashedDictionary::getBlockInputStream(const Names & column_names, UInt64 max_block_size) const
BlockInputStreamPtr ComplexKeyHashedDictionary::getBlockInputStream(const Names & column_names, size_t max_block_size) const
{
using BlockInputStreamType = DictionaryBlockInputStream<ComplexKeyHashedDictionary, UInt64>;
return std::make_shared<BlockInputStreamType>(shared_from_this(), max_block_size, getKeys(), column_names);
......
......@@ -153,7 +153,7 @@ public:
void has(const Columns & key_columns, const DataTypes & key_types, PaddedPODArray<UInt8> & out) const;
BlockInputStreamPtr getBlockInputStream(const Names & column_names, UInt64 max_block_size) const override;
BlockInputStreamPtr getBlockInputStream(const Names & column_names, size_t max_block_size) const override;
private:
template <typename Value>
......
......@@ -2,7 +2,7 @@
namespace DB
{
DictionaryBlockInputStreamBase::DictionaryBlockInputStreamBase(size_t rows_count, UInt64 max_block_size)
DictionaryBlockInputStreamBase::DictionaryBlockInputStreamBase(size_t rows_count, size_t max_block_size)
: rows_count(rows_count), max_block_size(max_block_size)
{
}
......@@ -12,7 +12,7 @@ Block DictionaryBlockInputStreamBase::readImpl()
if (next_row == rows_count)
return Block();
size_t block_size = std::min<size_t>(max_block_size, rows_count - next_row);
size_t block_size = std::min(max_block_size, rows_count - next_row);
Block block = getBlock(next_row, block_size);
next_row += block_size;
return block;
......
......@@ -7,7 +7,7 @@ namespace DB
class DictionaryBlockInputStreamBase : public IBlockInputStream
{
protected:
DictionaryBlockInputStreamBase(size_t rows_count, UInt64 max_block_size);
DictionaryBlockInputStreamBase(size_t rows_count, size_t max_block_size);
virtual Block getBlock(size_t start, size_t length) const = 0;
......@@ -15,7 +15,7 @@ protected:
private:
const size_t rows_count;
const UInt64 max_block_size;
const size_t max_block_size;
size_t next_row = 0;
Block readImpl() override;
......
......@@ -749,7 +749,7 @@ PaddedPODArray<FlatDictionary::Key> FlatDictionary::getIds() const
return ids;
}
BlockInputStreamPtr FlatDictionary::getBlockInputStream(const Names & column_names, UInt64 max_block_size) const
BlockInputStreamPtr FlatDictionary::getBlockInputStream(const Names & column_names, size_t max_block_size) const
{
using BlockInputStreamType = DictionaryBlockInputStream<FlatDictionary, Key>;
return std::make_shared<BlockInputStreamType>(shared_from_this(), max_block_size, getIds(), column_names);
......
......@@ -144,7 +144,7 @@ public:
void has(const PaddedPODArray<Key> & ids, PaddedPODArray<UInt8> & out) const override;
BlockInputStreamPtr getBlockInputStream(const Names & column_names, UInt64 max_block_size) const override;
BlockInputStreamPtr getBlockInputStream(const Names & column_names, size_t max_block_size) const override;
private:
template <typename Value>
......
......@@ -753,7 +753,7 @@ PaddedPODArray<HashedDictionary::Key> HashedDictionary::getIds() const
return PaddedPODArray<Key>();
}
BlockInputStreamPtr HashedDictionary::getBlockInputStream(const Names & column_names, UInt64 max_block_size) const
BlockInputStreamPtr HashedDictionary::getBlockInputStream(const Names & column_names, size_t max_block_size) const
{
using BlockInputStreamType = DictionaryBlockInputStream<HashedDictionary, Key>;
return std::make_shared<BlockInputStreamType>(shared_from_this(), max_block_size, getIds(), column_names);
......
......@@ -144,7 +144,7 @@ public:
void isInVectorConstant(const PaddedPODArray<Key> & child_ids, const Key ancestor_id, PaddedPODArray<UInt8> & out) const override;
void isInConstantVector(const Key child_id, const PaddedPODArray<Key> & ancestor_ids, PaddedPODArray<UInt8> & out) const override;
BlockInputStreamPtr getBlockInputStream(const Names & column_names, UInt64 max_block_size) const override;
BlockInputStreamPtr getBlockInputStream(const Names & column_names, size_t max_block_size) const override;
private:
template <typename Value>
......
......@@ -46,7 +46,7 @@ struct IDictionaryBase : public IExternalLoadable
virtual bool isInjective(const std::string & attribute_name) const = 0;
virtual BlockInputStreamPtr getBlockInputStream(const Names & column_names, UInt64 max_block_size) const = 0;
virtual BlockInputStreamPtr getBlockInputStream(const Names & column_names, size_t max_block_size) const = 0;
bool supportUpdates() const override { return !isCached(); }
......
......@@ -25,7 +25,7 @@ public:
RangeDictionaryBlockInputStream(
DictionaryPtr dictionary,
UInt64 max_block_size,
size_t max_block_size,
const Names & column_names,
PaddedPODArray<Key> && ids_to_fill,
PaddedPODArray<RangeType> && start_dates,
......@@ -88,12 +88,12 @@ private:
template <typename DictionaryType, typename RangeType, typename Key>
RangeDictionaryBlockInputStream<DictionaryType, RangeType, Key>::RangeDictionaryBlockInputStream(
DictionaryPtr dictionary,
size_t max_column_size,
size_t max_block_size,
const Names & column_names,
PaddedPODArray<Key> && ids,
PaddedPODArray<RangeType> && block_start_dates,
PaddedPODArray<RangeType> && block_end_dates)
: DictionaryBlockInputStreamBase(ids.size(), max_column_size)
: DictionaryBlockInputStreamBase(ids.size(), max_block_size)
, dictionary(dictionary)
, column_names(column_names)
, ids(std::move(ids))
......
......@@ -634,7 +634,7 @@ void RangeHashedDictionary::getIdsAndDates(
template <typename RangeType>
BlockInputStreamPtr RangeHashedDictionary::getBlockInputStreamImpl(const Names & column_names, UInt64 max_block_size) const
BlockInputStreamPtr RangeHashedDictionary::getBlockInputStreamImpl(const Names & column_names, size_t max_block_size) const
{
PaddedPODArray<Key> ids;
PaddedPODArray<RangeType> start_dates;
......@@ -652,7 +652,7 @@ struct RangeHashedDIctionaryCallGetBlockInputStreamImpl
BlockInputStreamPtr stream;
const RangeHashedDictionary * dict;
const Names * column_names;
UInt64 max_block_size;
size_t max_block_size;
template <typename RangeType, size_t>
void operator()()
......@@ -663,7 +663,7 @@ struct RangeHashedDIctionaryCallGetBlockInputStreamImpl
}
};
BlockInputStreamPtr RangeHashedDictionary::getBlockInputStream(const Names & column_names, UInt64 max_block_size) const
BlockInputStreamPtr RangeHashedDictionary::getBlockInputStream(const Names & column_names, size_t max_block_size) const
{
using ListType = TypeList<UInt8, UInt16, UInt32, UInt64, Int8, Int16, Int32, Int64, Int128, Float32, Float64>;
......
......@@ -93,7 +93,7 @@ public:
const PaddedPODArray<RangeStorageType> & dates,
ColumnString * out) const;
BlockInputStreamPtr getBlockInputStream(const Names & column_names, UInt64 max_block_size) const override;
BlockInputStreamPtr getBlockInputStream(const Names & column_names, size_t max_block_size) const override;
struct Range
{
......@@ -210,7 +210,7 @@ private:
PaddedPODArray<RangeType> & end_dates) const;
template <typename RangeType>
BlockInputStreamPtr getBlockInputStreamImpl(const Names & column_names, UInt64 max_block_size) const;
BlockInputStreamPtr getBlockInputStreamImpl(const Names & column_names, size_t max_block_size) const;
friend struct RangeHashedDIctionaryCallGetBlockInputStreamImpl;
......
......@@ -758,7 +758,7 @@ Columns TrieDictionary::getKeyColumns() const
return {std::move(ip_column), std::move(mask_column)};
}
BlockInputStreamPtr TrieDictionary::getBlockInputStream(const Names & column_names, UInt64 max_block_size) const
BlockInputStreamPtr TrieDictionary::getBlockInputStream(const Names & column_names, size_t max_block_size) const
{
using BlockInputStreamType = DictionaryBlockInputStream<TrieDictionary, UInt64>;
......
......@@ -155,7 +155,7 @@ public:
void has(const Columns & key_columns, const DataTypes & key_types, PaddedPODArray<UInt8> & out) const;
BlockInputStreamPtr getBlockInputStream(const Names & column_names, UInt64 max_block_size) const override;
BlockInputStreamPtr getBlockInputStream(const Names & column_names, size_t max_block_size) const override;
private:
template <typename Value>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册