Skip to content

Support REFRESH MATERIALIZED VIEW#15996

Merged
highker merged 2 commits intoprestodb:masterfrom
gggrace14:mra
Jun 15, 2021
Merged

Support REFRESH MATERIALIZED VIEW#15996
highker merged 2 commits intoprestodb:masterfrom
gggrace14:mra

Conversation

@gggrace14
Copy link
Contributor

@gggrace14 gggrace14 commented Apr 26, 2021

@gggrace14 gggrace14 requested review from highker and jainxrohit April 26, 2021 07:28
@gggrace14 gggrace14 marked this pull request as ready for review April 26, 2021 07:29
@highker highker requested a review from kaikalur April 26, 2021 17:40
@highker
Copy link

highker commented Apr 30, 2021

Let's rebase this PR on top of #15910. That one is one a shape that won't have major interface or structure change.

@gggrace14
Copy link
Contributor Author

Let's rebase this PR on top of #15910. That one is one a shape that won't have major interface or structure change.

I will do it and come back.

@gggrace14 gggrace14 force-pushed the mra branch 3 times, most recently from ce11808 to 3579314 Compare May 3, 2021 17:32
@gggrace14 gggrace14 force-pushed the mra branch 3 times, most recently from 984033e to 3794b30 Compare May 3, 2021 22:19
Copy link

@highker highker left a comment

Choose a reason for hiding this comment

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

Quick comments on the first commit

@gggrace14 gggrace14 requested a review from highker May 4, 2021 08:04
@jainxrohit
Copy link
Contributor

Have only looked at the query building part of it, have left some comments for clarification.

Copy link

@highker highker left a comment

Choose a reason for hiding this comment

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

Let's clean up the initial comments, rebase, and have another round of review

@gggrace14 gggrace14 force-pushed the mra branch 4 times, most recently from 7a0c4b7 to b141d3d Compare May 20, 2021 18:04
@gggrace14 gggrace14 requested review from highker and jainxrohit May 20, 2021 21:51
@jainxrohit
Copy link
Contributor

Can we please resolve the the comments which are already addressed?

Copy link
Contributor

@jainxrohit jainxrohit left a comment

Choose a reason for hiding this comment

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

Left the change in comments

@gggrace14
Copy link
Contributor Author

Addressed comments, and also changed TestHiveLogicalPlanner to use REFRESH MV to write to MVs and enabled the test cases.

@jainxrohit
Copy link
Contributor

jainxrohit commented Jun 5, 2021

@gggrace14 are we planning to fix testMaterializedViewForJoin test as part of this PR?
If not can we create a new task and update the TODO?

I see that testMaterializedViewForJoinWithMultiplePartitions as well is disabled. Can we enable it if there are no issues?

Copy link
Contributor

@jainxrohit jainxrohit left a comment

Choose a reason for hiding this comment

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

Overall it looks good to me. Lets make the final set of requested changes.

I would have preferred to keep the query rewriting logic at one place, as it is easier to read and debug. But may be we can create a task for refactoring it.

cc: @highker

@gggrace14
Copy link
Contributor Author

gggrace14 commented Jun 7, 2021

@gggrace14 are we planning to fix testMaterializedViewForJoin test as part of this PR?
If not can we create a new task and update the TODO?

I see that testMaterializedViewForJoinWithMultiplePartitions as well is disabled. Can we enable it if there are no issues?

Yes, testMaterializedViewForJoinWithMultiplePartitions is enabled now and it is good with replacing insert w/ refresh. Fixing testMaterializedViewForJoin needs more complete population of the columnMappings structure, which is orthogonal to REFRESH and deserves a standalone PR. Filing the issue #16220 and updating the TODO.

@jainxrohit
Copy link
Contributor

testMaterializedViewForJoinWithMultiplePartitions

I was also talking about test method
public void testMaterializedViewForJoin()

@gggrace14
Copy link
Contributor Author

@gggrace14 are we planning to fix testMaterializedViewForJoin test as part of this PR?
If not can we create a new task and update the TODO?

I see that testMaterializedViewForJoinWithMultiplePartitions as well is disabled. Can we enable it if there are no issues?

Yes, testMaterializedViewForJoinWithMultiplePartitions is enabled now and it is good with replacing insert w/ refresh.

@gggrace14
Copy link
Contributor Author

testMaterializedViewForJoinWithMultiplePartitions

I was also talking about test method
public void testMaterializedViewForJoin()

Filing the issue #16220 and updating the TODO.

Comment on lines 79 to 89
Copy link

Choose a reason for hiding this comment

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

Remove this interface. Let's only keep the constructor(s)

Copy link

Choose a reason for hiding this comment

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

Use the constructor instead of withXXX

Comment on lines 2374 to 2375
Copy link

Choose a reason for hiding this comment

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

No need to call it viewDefinitionWithRefreshColumns, just reuse viewDefinition

Comment on lines 744 to 746
Copy link

Choose a reason for hiding this comment

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

merge into one line

Copy link

Choose a reason for hiding this comment

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

typo: REFERSH

Comment on lines 1202 to 1127
Copy link

Choose a reason for hiding this comment

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

Let's keep these unchanged

@highker highker self-assigned this Jun 13, 2021
@gggrace14 gggrace14 force-pushed the mra branch 3 times, most recently from 6b7d0db to 17bd4f4 Compare June 14, 2021 16:29
@highker highker merged commit f8f2690 into prestodb:master Jun 15, 2021
@ajaygeorge
Copy link
Contributor

@gggrace14 There are no release notes on this PR. Can you please add them.
cc @highker / @jainxrohit

@jainxrohit
Copy link
Contributor

@gggrace14 There are no release notes on this PR. Can you please add them.
cc @highker / @jainxrohit

My bad, @gggrace14, let add no release notes for this PR.

@gggrace14
Copy link
Contributor Author

Yes, will do!

@mayankgarg1990 mayankgarg1990 mentioned this pull request Jun 18, 2021
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants