[Opt](Hash) Deduce virtual function call is null at in single nullable column (#16650)
This commit is contained in:
@ -215,7 +215,7 @@ struct HashMethodSingleLowNullableColumn : public SingleColumnMethod {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ColumnRawPtrs key_columns;
|
||||
const ColumnNullable* key_column;
|
||||
|
||||
static const ColumnRawPtrs get_nested_column(const IColumn* col) {
|
||||
auto* nullable = check_and_get_column<ColumnNullable>(*col);
|
||||
@ -227,11 +227,11 @@ struct HashMethodSingleLowNullableColumn : public SingleColumnMethod {
|
||||
HashMethodSingleLowNullableColumn(const ColumnRawPtrs& key_columns_nullable,
|
||||
const Sizes& key_sizes, const HashMethodContextPtr& context)
|
||||
: Base(get_nested_column(key_columns_nullable[0]), key_sizes, context),
|
||||
key_columns(key_columns_nullable) {}
|
||||
key_column(assert_cast<const ColumnNullable*>(key_columns_nullable[0])) {}
|
||||
|
||||
template <typename Data>
|
||||
ALWAYS_INLINE EmplaceResult emplace_key(Data& data, size_t row, Arena& pool) {
|
||||
if (key_columns[0]->is_null_at(row)) {
|
||||
if (key_column->is_null_at(row)) {
|
||||
bool has_null_key = data.has_null_key_data();
|
||||
data.has_null_key_data() = true;
|
||||
|
||||
@ -261,7 +261,7 @@ struct HashMethodSingleLowNullableColumn : public SingleColumnMethod {
|
||||
template <typename Data, typename Func, typename CreatorForNull>
|
||||
ALWAYS_INLINE typename std::enable_if_t<has_mapped, Mapped>& lazy_emplace_key(
|
||||
Data& data, size_t row, Arena& pool, Func&& f, CreatorForNull&& null_creator) {
|
||||
if (key_columns[0]->is_null_at(row)) {
|
||||
if (key_column->is_null_at(row)) {
|
||||
bool has_null_key = data.has_null_key_data();
|
||||
data.has_null_key_data() = true;
|
||||
if (!has_null_key) std::forward<CreatorForNull>(null_creator)(data.get_null_key_data());
|
||||
@ -277,7 +277,7 @@ struct HashMethodSingleLowNullableColumn : public SingleColumnMethod {
|
||||
ALWAYS_INLINE typename std::enable_if_t<has_mapped, Mapped>& lazy_emplace_key(
|
||||
Data& data, size_t row, Arena& pool, size_t hash_value, Func&& f,
|
||||
CreatorForNull&& null_creator) {
|
||||
if (key_columns[0]->is_null_at(row)) {
|
||||
if (key_column->is_null_at(row)) {
|
||||
bool has_null_key = data.has_null_key_data();
|
||||
data.has_null_key_data() = true;
|
||||
if (!has_null_key) std::forward<CreatorForNull>(null_creator)(data.get_null_key_data());
|
||||
@ -291,7 +291,7 @@ struct HashMethodSingleLowNullableColumn : public SingleColumnMethod {
|
||||
|
||||
template <typename Data>
|
||||
ALWAYS_INLINE FindResult find_key(Data& data, size_t row, Arena& pool) {
|
||||
if (key_columns[0]->is_null_at(row)) {
|
||||
if (key_column->is_null_at(row)) {
|
||||
bool has_null_key = data.has_null_key_data();
|
||||
if constexpr (has_mapped)
|
||||
return FindResult(&data.get_null_key_data(), has_null_key);
|
||||
|
||||
Reference in New Issue
Block a user