Skip to content

[CALCITE-5921] SqlOperatorFixture.checkFails and checkAggFails don't check runtime failure#3471

Merged
rubenada merged 1 commit intoapache:mainfrom
mihaibudiu:issue5921
Oct 25, 2023
Merged

[CALCITE-5921] SqlOperatorFixture.checkFails and checkAggFails don't check runtime failure#3471
rubenada merged 1 commit intoapache:mainfrom
mihaibudiu:issue5921

Conversation

@mihaibudiu
Copy link
Contributor

This supersedes #3412.

Like #3412, this temporarily disables a test for a regression described by https://issues.apache.org/jira/browse/CALCITE-5990.
I have a pending PR fixing 5990, but it needs this PR to be merged first.

As https://issues.apache.org/jira/browse/CALCITE-5921 has pointed out, none of the checkFails test that fail at runtime were ever executed. This PR (like #3412) remedies this situation, and it also corrects some error messages which were never validated. Some of these error messages leak internal compiler data structures (e.g., "was not expecting value for enumeration), but cleaning them should be part of a future PR.

While trying to fix 5990 I have discovered that the tests that were run by fixture.checkFail were rewritten in different ways from the tests that were executed by fixture.checkScalar*. So it was possible to have test T such that f.checkScalar(T) fails with an exception but f.checkFails(T) fails because no exception is thrown! The change to SqlRuntimeTester ensures that the same test is run, and thus the execution proceeds in both cases in the same way. This change is in addition to the changes in #3412.

As soon as this PR is merged I will submit a fix for CALCITE-5990 as well.

…check runtime failure

Signed-off-by: Mihai Budiu <mbudiu@gmail.com>
@mihaibudiu
Copy link
Contributor Author

Thanks to @herunkang2018 for the original PR on which this one is based.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

88.2% 88.2% Coverage
11.1% 11.1% Duplication

@rubenada
Copy link
Contributor

LGTM

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.

2 participants