-
Notifications
You must be signed in to change notification settings - Fork 11
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
build: Add better SQL Test Infrastructure #31
base: main
Are you sure you want to change the base?
build: Add better SQL Test Infrastructure #31
Conversation
- Switch to JUnit5 for parametrized tests and parallel execution - Maven: Add Airlist Check SKIP switches for fast prototyping - Maven: remove Checklist Modules, since those are provided by Airbase - Eclipse formatter configuration for Airlift style - SQL Parser and Unparser Tests, read from SQL Files - Updated some Tests to benefit from JUnit5
|
Maven Spotless Plugin to enforce Airlift compliant formatting based on Eclipse formatter
Add basic Sphinx Template with minimal content Add Gradle task for Changelog Add Gradle task for Rail Road Diagrams (although it does not work yet because this Grammar is strong) Add Gradle task for building the Sphinx documentation, including the Prologue Add Github Action for deploying the HTML to Github Pages Add Github Action for Maven build Add Github Issue template Tweak the .gitignore file
Greetings. I have worked a bit around the infrastructure. Added some Readme, Website/Github Pages and Test SQLs (so to read the statements from a formatted SQL file instead from Java Code). I also wanted to add Rail-Road Diagrams, but this did not work yet since the Grammar uses some features I have never seen before. Bug reported GuntherRademacher/rr#20 Added some support for formatting. Please do let me know what you like or don't like. Previews: Cheers |
parser/src/test/java/com/facebook/coresql/parser/TestSqlParser.java
Outdated
Show resolved
Hide resolved
rewriter/src/test/java/com/facebook/coresql/rewriter/TestOrderByRewriter.java
Outdated
Show resolved
Hide resolved
sphinx/src/keywords.rst
Outdated
Restricted Keywords | ||
*********************** | ||
|
||
The following Keywords are **restricted** in Version |JSQLPARSER_VERSION| and must not be used for **Naming Objects**: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we having references to JSQL here? I thought JSQL would simply use this package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for feedback.
This particular reference is only a variable name used in a template. It will be replaced/filled with the actual version.
Before changing it, we will want to agree on a proper Brand Name for this software and the decision is all yours. Will it be Presto SQL Parser
, since it is linked to Presto?
Or should it aim broader, like `JSQL:2016', 'JavaSQL16', 'ParseSQL16', 'JSQLSuite', 'JSQLTools'?
Since we are on it, the Git Repo checks out as sql
(which immediately collided with my curated collection of the worst SQL statements I have seen in my life.)
Please make a choice and I would adjust everything accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm this is a tricky one. Definitely let's not call it jsql especially since we have C++ version (which your changes will hopefully not impact). Presto SQL parser might be most appropriate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So be it! I would adjust this tomorrow, also remove any manticore references and submit.
Thanks for the feedback!
I did not touch any C++ Version.
Although: I would like to have a comprehensive Test/CI Suite, which can warn us. If it succeeds, we should be good. When not, then reject.
Update the Line Wrapping Options for Function and Array Parameters. Tweak the Eclipse Formatter Configuration to match the Airlift Checkstyle rules precisely. Now, calling `mvn spotless:apply` will guarantee compliance with Airlift style.
Add plenty of SQL samples Separate succeeding samples from failing samples so that failures will not block the build Let the tests show the Statement and the Parser Error Further tune the Eclipse Formatter since Airlift is really strict Simplify some Regular Expressions
I would like to apologize upfront for the massive change-set.
Now we can pick from here one by one, analyze what goes wrong and decide if we want to support it or not. Any new success should be moved to the mandatory test suite. All tests are parseable with JSQLParser and have been formatted with JSQLFormatter. |
Added Gradle Build support Updated Airlift/Base to io.airlift 219 Provide explicit Airlift Checkstyle config Move the JavaCC Grammar to a more appropriate place Generate RailRoad Diagrams for the Grammar Downgrade Maven JUnit5 as requested by Airlift Add an ASCII Tree for visualizing the AST
Signed-off-by: Andreas Reichel <[email protected]>
It maybe ok for now to have this large PR as it's just adding a bunch of new things and doesn't seem to change the grammar. But in general we prefer separate small PRs . Also we generally squash all commits into one before merging but looks like you have many different things so it maybe ok. Also looks like this repo is also under Linux Foundation. We need to check if it's ok to have manticore as a package under sql. I suggest creating a sql-manticore toplevel package so the grammar module is clean with just the grammar. So we should eventually have parser, linter, rewriter and formatter as the toplevel packages. |
Happy new year 2023. I know, that this PR is way too large -- however, it is really hard to work on Build/Test infrastructure and Documentation and keep it small, when the PR is kept pending for a long time. I can remove any "manticore" related reference in the packages of course, it was just copy'n paste. Btw, Rail Road Diagrams: https://manticore-projects.github.io/sql/syntax.html |
It's fine to have manticore references but keep that in a separate package. I just want to keep the parser package super clean with no specific reference to anything else. Just like presto has a lot of connectors that all sit in presto-xxx packages. |
The railroad diagram is amazing! |
So just two changes needed to merge this PR: 1. fix the naming to 'Presto SQL Parser' and 2. move the formatter out to a separate package. |
Agreed. You will have it tomorrow. Thanks again for the guidance. |
Signed-off-by: Andreas Reichel <[email protected]>
Greetings. I have removed all references to "manticore-projects" and/or "JSQLParser" and have applied "Presto SQL:2016 Parser" where possible. Github Actions run CI and publish site. |
Signed-off-by: Andreas Reichel <[email protected]>
Signed-off-by: Andreas Reichel <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you very much for doing this much needed setup cleanup! |
@mbasmanova do you think you can stamp this PR - it's simply adding a bunch of test/ci stuff with no changes to the grammar/ast side of things? I need to find some others who can do this now so that @manticore-projects and I can work on it and merge without delays. |
Signed-off-by: Andreas Reichel <[email protected]>
fixes #1706
Maven: remove Checklist Modules, since those are provided by Airbaseturns out, those are needed r/ Java 8219100 (Last Java 8 supporting version)