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

Refactor KsqlParser #1775

Merged
merged 6 commits into from
Aug 24, 2018

Conversation

big-andy-coates
Copy link
Contributor

Description

While investigating how the parser worked and the different steps used to parse statements and build the AST I noticed that the code was in need of a refactor. So this PR does just that. Main class to change is KsqlParser. I've tried to remove duplication from clients of KsqlParser and improve encapsulation, (so, for example, the struct re-write is only done in one place now).

When reviewing, I'd first look at KsqlParser.

Testing done

Ran tests.

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

@big-andy-coates big-andy-coates requested review from dguy, apurvam, rodesai, hjafarpour and a team August 23, 2018 12:16
Copy link
Contributor

@dguy dguy left a comment

Choose a reason for hiding this comment

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

LGTM

final Pair<String, PlanNode> statementPlanPair = logicalPlans.get(i);
if (statementPlanPair.getRight() == null) {
final Statement statement = statementList.get(i).getRight();
final LogicalPlanNode statementPlanPair = logicalPlans.get(i);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: maybe a better name for the variable?

@bluemonk3y
Copy link

Lgtm

Copy link

@bluemonk3y bluemonk3y left a comment

Choose a reason for hiding this comment

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

Lgtm

@big-andy-coates big-andy-coates merged commit 1ad2aed into confluentinc:master Aug 24, 2018
@big-andy-coates big-andy-coates deleted the refactor_parser branch August 24, 2018 13:35
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