Skip to content

Conversation

@qianheng-aws
Copy link
Collaborator

@qianheng-aws qianheng-aws commented Apr 14, 2025

Description

This PR aims to refactoring the current Calcite remote IT. It has drawbacks:

  1. Although enabling fallback by default, Calcite*IT will run most tests without fallback in fact, it has duplication process with NonFallbackCalcite*IT which extends from it. This will increase our IT time cost a lot with unnecessary tests.
  2. For some tests we originally expect them throw exception(because of incorrect PPL), we don't want to test with fallback to v2 because v2 will throw exception as well. E.g. WhereCommandIT::testInWithIncompatibleType. Testing the error message in separate suite(calcite enable/disable) is enough.

This PR unify Calcite*IT with NonFallbackCalcite*IT together, and override tests with fallback for those we've previous ignored in NonFallbackCalcite*IT

And this PR will also fix the cases where some test/suite have been ignored incorrectly.

Resolves #3546

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Heng Qian <qianheng@amazon.com>
}

public static void withFallbackEnabled(Runnable f, String msg) throws IOException {
System.out.printf("Need fallback to v2 due to %s%n", msg);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is sysout the preferred way to log in test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

LOG should be better, will change to use LOG.info.

penghuo
penghuo previously approved these changes Apr 14, 2025

import org.opensearch.sql.ppl.WhereCommandIT;

public class CalciteWhereCommandIT extends WhereCommandIT {
Copy link
Member

Choose a reason for hiding this comment

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

This PR unify CalciteIT with NonFallbackCalciteIT together, and override tests with fallback for those we've previous ignored in NonFallbackCalcite*IT

Why does this PR only delete one IT file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will migrate others if this approach is acceptable

Signed-off-by: Heng Qian <qianheng@amazon.com>
Signed-off-by: Heng Qian <qianheng@amazon.com>
Signed-off-by: Heng Qian <qianheng@amazon.com>
@penghuo penghuo merged commit 3c1591a into opensearch-project:main Apr 15, 2025
22 checks passed
penghuo pushed a commit that referenced this pull request Jun 16, 2025
#3544)

* [Calcite Engine] Only enable fallback for tests that need to fall back

Signed-off-by: Heng Qian <qianheng@amazon.com>

* Address comments

Signed-off-by: Heng Qian <qianheng@amazon.com>

* Migrate all calcite remote IT and fix incorrectly ignored test

Signed-off-by: Heng Qian <qianheng@amazon.com>

* Follow the previous action to ignore prometheus test

Signed-off-by: Heng Qian <qianheng@amazon.com>

---------

Signed-off-by: Heng Qian <qianheng@amazon.com>
Signed-off-by: xinyual <xinyual@amazon.com>
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.

[FEATURE] Calcite Remote IT refactoring

4 participants