Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors when alter materialized view which based on dup table #4375

Merged
merged 2 commits into from
Aug 21, 2020

Conversation

EmmyMiao87
Copy link
Contributor

Proposed changes

  1. Input the correct keys type when mv is updated.
    The keys type of mv should be used in schema change job rather then keys type of base table.
    Otherwise, the be will core and thrown exception "Create replicas failed".

  2. Forbidden add non-key column on agg mv directly when base table is duplicate model
    If a dup table has a agg mv, user will not add a non-key column on mv.
    The non-key column can only be added to dup index.

Fixed #4374
Change-Id: I375f695b3109e513622110cf0ca04a4034780909

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

1. Input the correct keys type when mv is updated.
The keys type of mv should be used in schema change job rather then keys type of base table.
Otherwise, the be will core and thrown exception "Create replicas failed".

2. Forbidden add non-key column on agg mv directly when base table is duplicate model
If a dup table has a agg mv, user will not add a non-key column on mv.
The non-key column can only be added to dup index.

Fixed apache#4374
Change-Id: I375f695b3109e513622110cf0ca04a4034780909
@EmmyMiao87 EmmyMiao87 added kind/fix Categorizes issue or PR as related to a bug. area/materialized-view Issues or PRs related to materialized view branch-0.13 PR which need to merge to branch 0.13 labels Aug 17, 2020
@@ -556,6 +556,10 @@ private void addColumnInternal(OlapTable olapTable, Column newColumn, ColumnPosi
throw new DdlException("Can not assign aggregation method on column in Duplicate data model table: " + newColName);
}
if (!newColumn.isKey()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why not put "from lint 559 to line 562" outside of if stmt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't understand what you mean...

Change-Id: Ifb3b3ad2ba44770a2a0fcf0317f63e3e508161da
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 added the approved Indicates a PR has been approved by one committer. label Aug 20, 2020
@morningman morningman merged commit 09b1965 into apache:master Aug 21, 2020
acelyc111 pushed a commit to acelyc111/incubator-doris that referenced this pull request Aug 21, 2020
…apache#4375)

1. Input the correct keys type when mv is updated.
The keys type of mv should be used in schema change job rather then keys type of base table.
Otherwise, the be will core and thrown exception "Create replicas failed".

2. Forbidden add non-key column on agg mv directly when base table is duplicate model
If a dup table has a agg mv, user will not add a non-key column on mv.
The non-key column can only be added to dup index.
@yangzhg yangzhg mentioned this pull request Feb 9, 2021
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/materialized-view Issues or PRs related to materialized view branch-0.13 PR which need to merge to branch 0.13 kind/fix Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to drop column on materialized view
3 participants