-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[CALCITE-5615] Program to run SQL Logic Tests for Calcite #3145
Conversation
Kudos, SonarCloud Quality Gate passed! |
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.
Quick pass leaving some comments along the way while trying to grasp what the contribution is about. I plan to leave also some questions comments under the JIRA ticket.
slt/src/main/java/org/apache/calcite/slt/FieldsAreNonnullByDefault.java
Outdated
Show resolved
Hide resolved
slt/src/main/java/org/apache/calcite/slt/executors/CalciteExecutor.java
Outdated
Show resolved
Hide resolved
* Represents the data from a .test file from the | ||
* SqlLogicTest test framework. | ||
*/ | ||
/* |
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.
It's confusing to have javadoc and non-javadoc comment coming one after the other. Please combine them together and use proper javadoc annotations to ensure it displays properly.
I will only address @zabetak 's comments once we understand how this should be packaged; I have sent an email to the dev mailing list asking for suggestions. One thing I would encourage people to do in the meantime is to actually run the code (first on one or two test files, these are specified on the command-line, e.g., |
@mbudiu-vmw Sure it makes sense to wait a bit. I will actually run the code during the weekend; I am already convinced that it is a very useful contribution :) I am just not sure yet where/how it should land. Thanks again for taking the time to contribute this to the community. |
Imported from apache/calcite#3145 as of 2022/04/13. Omit build.gradle.kts and gradle.properties because we are using Maven, not Gradle. Disable Checkstyle Add a basic test; add an option so that Main does not call System.exit
Imported from apache/calcite#3145 as of 2022/04/13. Omit build.gradle.kts and gradle.properties because we are using Maven, not Gradle. Disable Checkstyle Add a basic test; add an option so that Main does not call System.exit
Imported from apache/calcite#3145 as of 2022/04/13. Omit build.gradle.kts and gradle.properties because we are using Maven, not Gradle. Disable Checkstyle Add a basic test; add an option so that Main does not call System.exit
I think this code could go into the existing |
@zabetak thank you for the comments, I will address them once sql-logic-test 2.0 is available in my next PR. |
@mihaibudiu From my perspective (and Julian's I think) this PR should contain something equivalent to what is now |
With the latest commit this is testing the CalciteExecutor against the candidate 0.2 release of sql-logic-test. |
f48d5ab
to
e4b82c4
Compare
plus/src/test/java/org/apache/calcite/slt/executors/CalciteExecutor.java
Outdated
Show resolved
Hide resolved
Kudos, SonarCloud Quality Gate passed! |
Rather than checking that the number of failures doesn't change, it's better to check that there are no failures other than the list of 'expected failures' You don't want the situation where you fix one test and introduce a new failure. It's much better to have a list of known failures rather than just a count. |
Currently the "execute" method from Main only returns an integer and writes all diagnostic to the supplied streams. |
It took about 6 minutes to run 10K tests using CalciteExecutor, so by extrapolation it would take about 2 days to run all tests. |
Here are some thoughts regarding duration and frequency:
Obviously we don't have to setup everything as part of this PR but it would be nice if we could at least put the 5minute bucket in place.
I guess we can find ways to address memory pressure; some quick ideas:
|
I think having many small tests is probably better. There are 622 test files in the project. However, JUnit5 has a capability called DynamicTests using the |
Signed-off-by: Mihai Budiu <[email protected]>
Signed-off-by: Mihai Budiu <[email protected]>
Signed-off-by: Mihai Budiu <[email protected]>
Signed-off-by: Mihai Budiu <[email protected]>
Signed-off-by: Mihai Budiu <[email protected]>
Signed-off-by: Mihai Budiu <[email protected]>
Signed-off-by: Mihai Budiu <[email protected]>
Signed-off-by: Mihai Budiu <[email protected]>
ab681c2
to
b76a4a8
Compare
Signed-off-by: Mihai Budiu <[email protected]>
Kudos, SonarCloud Quality Gate passed! |
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, I am doing some final touches locally and will merge this to master in the next few days.
We could also regenerate the golden file to account for the fixes made in the meantime. But I am on vacation for the next week so I can't do it right away. |
…dapter Signed-off-by: Mihai Budiu <[email protected]> Close apache#3145
@mihaibudiu I am now testing everything along with my changes here: https://github.com/zabetak/calcite/tree/slt If run comes back green I will merge it and we can work on follow-ups after that. |
…dapter Signed-off-by: Mihai Budiu <[email protected]> Close apache#3145
This PR essentially adds more than 7 million SQL tests to Calcite, from the SQL Logic Test Suite built by sqlite.
This addresses https://issues.apache.org/jira/browse/CALCITE-5615
This is a larger PR but it is for a completely self-contained program with a main entry point.
The README.md contained in this PR documents the program structure and its intended usage.
Using this program will require users to install separately the tests from the SQL Logic Test Suite: https://www.sqlite.org/sqllogictest/doc/trunk/about.wiki
The testing program finds multiple bugs in the default configuration of the Calcite compiler, both crashes and incorrect outputs. The plan is to file separate issues for each of these bugs as they are found.
However, this program is also intended to be extended to test other Calcite-based compilers (or it could be used for other SQL query engines; there is nothing special about Calcite in the implementation.)