Delete commented code.

This commit is contained in:
Nikolai Kochetov 2019-02-04 22:40:06 +03:00
parent 1644349342
commit 91c63c201c
4 changed files with 1 additions and 173 deletions

View File

@ -86,20 +86,9 @@ void DistinctBlockInputStream::buildFilter(
SetVariants & variants) const
{
typename Method::State state(columns, key_sizes, nullptr);
/// state.init(columns);
for (size_t i = 0; i < rows; ++i)
{
/// Make a key.
// typename Method::Key key = state.getKey(columns, columns.size(), i, key_sizes);
//
// typename Method::Data::iterator it;
// bool inserted;
// method.data.emplace(key, it, inserted);
//
// if (inserted)
// method.onNewKey(*it, columns.size(), variants.string_pool);
auto emplace_result = state.emplaceKey(method.data, i, variants.string_pool);
/// Emit the record if there is no such key in the current set yet.

View File

@ -86,7 +86,6 @@ bool DistinctSortedBlockInputStream::buildFilter(
ClearableSetVariants & variants) const
{
typename Method::State state(columns, key_sizes, nullptr);
//state.init(columns);
/// Compare last row of previous block and first row of current block,
/// If rows not equal, we can clear HashSet,
@ -106,19 +105,10 @@ bool DistinctSortedBlockInputStream::buildFilter(
if (i > 0 && !clearing_hint_columns.empty() && !rowsEqual(clearing_hint_columns, i, clearing_hint_columns, i - 1))
method.data.clear();
// /// Make a key.
// typename Method::Key key = state.getKey(columns, columns.size(), i, key_sizes);
// typename Method::Data::iterator it = method.data.find(key);
// bool inserted;
// method.data.emplace(key, it, inserted);
auto emplace_result = state.emplaceKey(method.data, i, variants.string_pool);
if (emplace_result.isInserted())
{
// method.onNewKey(*it, columns.size(), variants.string_pool);
has_new_data = true;
}
/// Emit the record if there is no such key in the current set yet.
/// Skip it otherwise.

View File

@ -79,7 +79,6 @@ void NO_INLINE Set::insertFromBlockImplCase(
[[maybe_unused]] ColumnUInt8::Container * out_filter)
{
typename Method::State state(key_columns, key_sizes, nullptr);
/// state.init(key_columns);
/// For all rows
for (size_t i = 0; i < rows; ++i)
@ -88,17 +87,7 @@ void NO_INLINE Set::insertFromBlockImplCase(
if ((*null_map)[i])
continue;
/// Obtain a key to insert to the set
/// typename Method::Key key = state.getKey(key_columns, keys_size, i, key_sizes);
[[maybe_unused]] auto emplace_result = state.emplaceKey(method.data, i, variants.string_pool);
//
// typename Method::Data::iterator it;
// bool inserted;
// method.data.emplace(key, it, inserted);
//
// if (inserted)
// method.onNewKey(*it, keys_size, variants.string_pool);
if constexpr (build_filter)
(*out_filter)[i] = emplace_result.isInserted();
@ -397,9 +386,8 @@ void NO_INLINE Set::executeImplCase(
{
Arena pool;
typename Method::State state(key_columns, key_sizes, nullptr);
/// state.init(key_columns);
/// NOTE Optimization is not used for consecutive identical values.
/// NOTE Optimization is not used for consecutive identical strings.
/// For all rows
for (size_t i = 0; i < rows; ++i)
@ -409,11 +397,6 @@ void NO_INLINE Set::executeImplCase(
else
{
auto find_result = state.findKey(method.data, i, pool);
/// Build the key
/// typename Method::Key key = state.getKey(key_columns, keys_size, i, key_sizes);
///vec_res[i] = negative ^ method.data.has(key);
vec_res[i] = negative ^ find_result.isFound();
}
}

View File

@ -29,34 +29,6 @@ struct SetMethodOneNumber
Data data;
using State = ColumnsHashing::HashMethodOneNumber<typename Data::value_type, void, FieldType>;
// /// To use one `Method` in different threads, use different `State`.
// struct State
// {
// const char * vec;
//
// /** Called at the start of each block processing.
// * Sets the variables required for the other methods called in inner loops.
// */
// void init(const ColumnRawPtrs & key_columns)
// {
// vec = key_columns[0]->getRawData().data;
// }
//
// /// Get key from key columns for insertion into hash table.
// Key getKey(
// const ColumnRawPtrs & /*key_columns*/,
// size_t /*keys_size*/, /// Number of key columns.
// size_t i, /// From what row of the block I get the key.
// const Sizes & /*key_sizes*/) const /// If keys of a fixed length - their lengths. Not used in methods for variable length keys.
// {
// return unalignedLoad<FieldType>(vec + i * sizeof(FieldType));
// }
// };
//
// /** Place additional data, if necessary, in case a new key was inserted into the hash table.
// */
// static void onNewKey(typename Data::value_type & /*value*/, size_t /*keys_size*/, Arena & /*pool*/) {}
};
/// For the case where there is one string key.
@ -69,37 +41,6 @@ struct SetMethodString
Data data;
using State = ColumnsHashing::HashMethodString<typename Data::value_type, void, false>;
// struct State
// {
// const IColumn::Offset * offsets;
// const UInt8 * chars;
//
// void init(const ColumnRawPtrs & key_columns)
// {
// const IColumn & column = *key_columns[0];
// const ColumnString & column_string = static_cast<const ColumnString &>(column);
// offsets = column_string.getOffsets().data();
// chars = column_string.getChars().data();
// }
//
// Key getKey(
// const ColumnRawPtrs &,
// size_t,
// ssize_t i,
// const Sizes &) const
// {
// return StringRef(
// chars + offsets[i - 1],
// offsets[i] - offsets[i - 1] - 1);
// }
// };
//
// static void onNewKey(typename Data::value_type & value, size_t, Arena & pool)
// {
// if (value.size)
// value.data = pool.insert(value.data, value.size);
// }
};
/// For the case when there is one fixed-length string key.
@ -112,34 +53,6 @@ struct SetMethodFixedString
Data data;
using State = ColumnsHashing::HashMethodFixedString<typename Data::value_type, void, false>;
// struct State
// {
// size_t n;
// const ColumnFixedString::Chars * chars;
//
// void init(const ColumnRawPtrs & key_columns)
// {
// const IColumn & column = *key_columns[0];
// const ColumnFixedString & column_string = static_cast<const ColumnFixedString &>(column);
// n = column_string.getN();
// chars = &column_string.getChars();
// }
//
// Key getKey(
// const ColumnRawPtrs &,
// size_t,
// size_t i,
// const Sizes &) const
// {
// return StringRef(&(*chars)[i * n], n);
// }
// };
//
// static void onNewKey(typename Data::value_type & value, size_t, Arena & pool)
// {
// value.data = pool.insert(value.data, value.size);
// }
};
namespace set_impl
@ -250,35 +163,6 @@ struct SetMethodKeysFixed
Data data;
using State = ColumnsHashing::HashMethodKeysFixed<typename Data::value_type, Key, void, has_nullable_keys, false>;
//
// class State : private set_impl::BaseStateKeysFixed<Key, has_nullable_keys>
// {
// public:
// using Base = set_impl::BaseStateKeysFixed<Key, has_nullable_keys>;
//
// void init(const ColumnRawPtrs & key_columns)
// {
// if (has_nullable_keys)
// Base::init(key_columns);
// }
//
// Key getKey(
// const ColumnRawPtrs & key_columns,
// size_t keys_size,
// size_t i,
// const Sizes & key_sizes) const
// {
// if (has_nullable_keys)
// {
// auto bitmap = Base::createBitmap(i);
// return packFixed<Key>(i, keys_size, Base::getActualColumns(), key_sizes, bitmap);
// }
// else
// return packFixed<Key>(i, keys_size, key_columns, key_sizes);
// }
// };
//
// static void onNewKey(typename Data::value_type &, size_t, Arena &) {}
};
/// For other cases. 128 bit hash from the key.
@ -291,24 +175,6 @@ struct SetMethodHashed
Data data;
using State = ColumnsHashing::HashMethodHashed<typename Data::value_type, void>;
// struct State
// {
// void init(const ColumnRawPtrs &)
// {
// }
//
// Key getKey(
// const ColumnRawPtrs & key_columns,
// size_t keys_size,
// size_t i,
// const Sizes &) const
// {
// return hash128(i, keys_size, key_columns);
// }
// };
//
// static void onNewKey(typename Data::value_type &, size_t, Arena &) {}
};