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

[WIP] Add support for incremental rewrite of nested queries #400

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

AliceYeh12
Copy link
Contributor

What changes are proposed in this pull request, and why are they necessary?

How was this patch tested?

Comment on lines 18 to 21
private RelNode incrementalRelNode;
private RelNode refreshRelNode;
private Map<String, RelNode> intermediateQueryRelNodes;
private List<String> intermediateOrderings;
Copy link
Contributor

Choose a reason for hiding this comment

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

As we discussed does it make sense to get rid of incrementalRelNode? Is it a special case of Map<String, RelNode> intermediateQueryRelNodes?

private RelNode incrementalRelNode;
private RelNode refreshRelNode;
private Map<String, RelNode> intermediateQueryRelNodes;
private List<String> intermediateOrderings;
Copy link
Contributor

Choose a reason for hiding this comment

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

intermediateOrderings --> materializationOrder?

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'm now getting indices from the map so will get rid of this entirely.


public IncrementalTransformerResults() {
incrementalRelNode = null;
refreshRelNode = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should it be a list of refresh relnodes? We can remove from current PR till we converge on the best representation.

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, this should be a list of refresh RelNodes—one for each aggregate query. Will remove for now.

RelShuttle converter = new RelShuttleImpl() {
@Override
public RelNode visit(TableScan scan) {
RelOptTable originalTable = scan.getTable();

// Set relOptSchema
if (relOptSchema == null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the use case for this check? when will relOptSchema not be present in the table?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This check is to set relOptSchema only when it has not previously already been set. I don't think it's absolutely necessary but I just added a comment to explain the conditional's purpose.

IncrementalTransformerResults incrementalTransformerResultsRight = convertRelIncremental(right);
RelNode incrementalLeft = incrementalTransformerResultsLeft.getIncrementalRelNode();
RelNode incrementalRight = incrementalTransformerResultsRight.getIncrementalRelNode();
incrementalTransformerResults
Copy link
Contributor

Choose a reason for hiding this comment

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

will it simplify the logic if we make intermediateQueryRelNodes global?

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, we are actually getting rid of IncrementalTransformerResults and keeping all logic inside of the transformer itself (larger discussion in the Slack channel).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants