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

feat(static): static select support #3369

Merged
merged 5 commits into from
Sep 19, 2019

Conversation

big-andy-coates
Copy link
Contributor

@big-andy-coates big-andy-coates commented Sep 17, 2019

Description

static queries now support arbitrary select expressions, e.g.

SELECT a, b + 1, subString(c) FROM X;

As part of this PR I've looked to start to make use of the QueryAnalyzer to analyze static queries. I've also pulled the validation of static and continuous queries into their own validator classes, to make them more targeted: StaticQueryValidator and ContinuousQueryValiator, respectively.

As before, don't worry overly about the code in StaticQueryExecutor - it's temporary.

Testing done

Suitable tests added, then mvn test

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 #")

static queries now support arbitrary select expressions.
@big-andy-coates big-andy-coates requested a review from a team as a code owner September 17, 2019 19:46

@SuppressWarnings("OptionalGetWithoutIsPresent")
@RunWith(MockitoJUnitRunner.class)
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 test was actually just renamed to QueryAnalyzerFunctionalTest. This is just a bad diff by Git.

QueryAnalyzerFunctionalTest continuous to be a functional style that parses actual sql and then analyses it.
QueryAnalyzerTest is now a unit test.

* <p>This test file is more of a functional test, which is better implemented using QTT.
*/
@SuppressWarnings("OptionalGetWithoutIsPresent")
public class QueryAnalyzerFunctionalTest {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

renamed from QueryAnalyzerTest. Please do not review this file - I haven't changed it!

@purplefox purplefox requested review from purplefox and removed request for purplefox September 18, 2019 17:25
Copy link
Contributor

@purplefox purplefox left a comment

Choose a reason for hiding this comment

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

LGTM. Just some nits.

@big-andy-coates big-andy-coates merged commit e4b3275 into confluentinc:master Sep 19, 2019
@big-andy-coates big-andy-coates deleted the static_selects branch September 19, 2019 15:53
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