Skip to content

Conversation

@acelyc111
Copy link
Member

Proposed changes

This patch mainly do the following refactors:

  • Use int64_t instead of int32_t for 'version' in DeleteHandler
  • Move some comments from .cpp to .h file, add some new comments in .h files, and also remove some meaningless comments
  • Use switch...case... instead of multiple if..else.. for DeleteConditionHandler::is_condition_value_valid
  • Use range loop to simplify code
  • Reduce some compare operations in Cond::del_eval
  • Improve some branch predictions in Reader
  • Fix and improve some unit tests

Types of changes

What types of changes does your code introduce to Doris?
Put an x in the boxes that apply

  • [] Bugfix (non-breaking change which fixes an issue)
  • [] New feature (non-breaking change which adds functionality)
  • [] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [] Documentation Update (if none of the other choices apply)
  • Code refactor (Modify the code structure, format the code, etc...)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • [] I have create an issue on (Fix #ISSUE), and have described the bug/feature there in detail
  • Compiling and unit tests pass locally with my changes
  • [] I have added tests that prove my fix is effective or that my feature works
  • [] If this change need a document change, I have updated the document
  • [] Any dependent changes have been merged

@acelyc111 acelyc111 force-pushed the reader_conds_refactor branch from ae68a0f to edd1ef5 Compare November 19, 2020 06:20
_has_sequence_col = true;
break;
}
DCHECK_NE(_sequence_col_idx, -1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why using DCHECK here?

Copy link
Member Author

@acelyc111 acelyc111 Nov 22, 2020

Choose a reason for hiding this comment

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

@morningman Because has_sequence_col() in line 600 is inline bool has_sequence_col() const { return _sequence_col_idx != -1; }, so _sequence_col_idx shoule always be -1 here.

@morningman morningman added the kind/refactor Issues or PRs to refactor code label Nov 21, 2020
@acelyc111 acelyc111 force-pushed the reader_conds_refactor branch 4 times, most recently from 963f6ca to 780999e Compare November 30, 2020 03:52
morningman
morningman previously approved these changes Dec 1, 2020
Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

LGTM

@acelyc111 acelyc111 force-pushed the reader_conds_refactor branch 3 times, most recently from 352b777 to 8e9656a Compare December 1, 2020 16:08
morningman
morningman previously approved these changes Dec 3, 2020
Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

LGTM

@morningman morningman merged commit 9c9992e into apache:master Dec 4, 2020
morningman pushed a commit to morningman/doris that referenced this pull request Dec 4, 2020
Introduced due to conflict of apache#5018 and apache#4925
@morningman morningman mentioned this pull request Dec 4, 2020
morningman pushed a commit to morningman/doris that referenced this pull request Dec 5, 2020
EmmyMiao87 pushed a commit that referenced this pull request Dec 5, 2020
…5028)

This reverts commit 9c9992e.

Co-authored-by: morningman <chenmingyu@baidu.com>
acelyc111 added a commit to acelyc111/incubator-doris that referenced this pull request Dec 6, 2020
This patch mainly do the following refactors:
- Use int64_t instead of int32_t for 'version' in DeleteHandler
- Move some comments from .cpp to .h file, add some new comments in .h files, and also remove some meaningless comments
- Use switch...case... instead of multiple if..else.. for DeleteConditionHandler::is_condition_value_valid
- Use range loop to simplify code
- Reduce some compare operations in Cond::del_eval
- Improve some branch predictions in Reader
- Fix and improve some unit tests
yangzhg pushed a commit that referenced this pull request Dec 8, 2020
* [Refactor] Refactor DeleteHandler and Cond module (#4925)

This patch mainly do the following refactors:
- Use int64_t instead of int32_t for 'version' in DeleteHandler
- Move some comments from .cpp to .h file, add some new comments in .h files, and also remove some meaningless comments
- Use switch...case... instead of multiple if..else.. for DeleteConditionHandler::is_condition_value_valid
- Use range loop to simplify code
- Reduce some compare operations in Cond::del_eval
- Improve some branch predictions in Reader
- Fix and improve some unit tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/refactor Issues or PRs to refactor code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants