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

PHOENIX-5592 MapReduce job to asynchronously delete rows where the VI… #664

Closed
wants to merge 4 commits into from

Conversation

yanxinyi
Copy link
Contributor

…EW_TTL has expired

String deleteIfExpiredStatement = "SELECT /*+ NO_INDEX */ count(*) FROM " + value.getViewName();
deletingExpiredRows(connection, view, Long.valueOf(value.getViewTtl()),
deleteIfExpiredStatement, config);
List<PTable> allIndexesOnView = view.getIndexes();
Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIK, this also gets indexes on the base table. Is it expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's expected. We delete expired rows for the base table, as well as the index table.

Copy link
Contributor

Choose a reason for hiding this comment

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

@yanxinyi We are only deleting from view indexes right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes. that's correct.

}

@Override public float getProgress() throws IOException, InterruptedException {
return 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we evaluate this?

deletingExpiredRows(tenantConnection, value, config);
}
} else {
deletingExpiredRows(connection, value, config);
Copy link
Contributor

Choose a reason for hiding this comment

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

I am assuming these are for global views? And have been validated that they do not have any child views. It would be useful to pass that info (global/tenant view) in the value (ViewInfoTracker) so that additional validation can be done here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We already did check before passing to the mapper. In other words, only leaf view can be processed and deleted

}

public String getJobName() {
if (this.jobName == null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Can we define a job name format and build that consistently?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

all jobs start with prefix ViewTTLTool-

Copy link
Contributor

@jpisaac jpisaac left a comment

Choose a reason for hiding this comment

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

A few nit changes here and there otherwise looking good, will take another pass later.

@yanxinyi
Copy link
Contributor Author

close this PR since implementation changes. the new PR is here: #762

@yanxinyi yanxinyi closed this Apr 20, 2020
jpisaac pushed a commit to jpisaac/phoenix that referenced this pull request Jun 10, 2022
Co-authored-by: Gokcen Iskender <47044859+gokceni@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants