Skip to content

Comments

[Improvement](dict) compute hash only if needed#18058

Merged
Gabriel39 merged 1 commit intoapache:masterfrom
Gabriel39:improve_dict_col
Mar 24, 2023
Merged

[Improvement](dict) compute hash only if needed#18058
Gabriel39 merged 1 commit intoapache:masterfrom
Gabriel39:improve_dict_col

Conversation

@Gabriel39
Copy link
Contributor

@Gabriel39 Gabriel39 commented Mar 23, 2023

Proposed changes

Hash values in dict column are always computed each time. Since those values are only needed by bloom filter predicate, this PR make it be computed only if it is needed.

Problem summary

Describe your changes.

Checklist(Required)

  • Does it affect the original behavior
  • Has unit tests been added
  • Has document been added or modified
  • Does it need to update dependencies
  • Is this PR support rollback (If NO, please explain WHY)

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

}

uint32_t get_hash_value(uint32_t idx) const { return _dict.get_hash_value(_codes[idx]); }
uint32_t get_hash_value(uint32_t idx) { return _dict.get_hash_value(_codes[idx], _type); }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'this' argument to member function 'get_hash_value' has type 'const doris::vectorized::ColumnDictionary::Dictionary', but function is not marked const [clang-diagnostic-error]

    uint32_t get_hash_value(uint32_t idx) const { return _dict.get_hash_value(_codes[idx], _type); }
                                                         ^

be/src/vec/columns/column_dictionary.h:533: in instantiation of member function 'doris::vectorized::ColumnDictionary::get_hash_value' requested here

template class ColumnDictionary<int32_t>;
               ^

be/src/vec/columns/column_dictionary.h:373: 'get_hash_value' declared here

        inline uint32_t get_hash_value(T code, FieldType type) {
                        ^

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@Gabriel39
Copy link
Contributor Author

run buildall

@Gabriel39
Copy link
Contributor Author

run buildall

1 similar comment
@Gabriel39
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

@wangbo wangbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

Copy link
Contributor

@HappenLee HappenLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Mar 24, 2023
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@Gabriel39 Gabriel39 merged commit e8b9587 into apache:master Mar 24, 2023
Gabriel39 added a commit to Gabriel39/incubator-doris that referenced this pull request Mar 24, 2023
gnehil pushed a commit to gnehil/doris that referenced this pull request Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. area/vectorization dev/1.2.4-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants