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

[native] Introduce module presto-native-tests #24234

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pramodsatya
Copy link
Contributor

@pramodsatya pramodsatya commented Dec 10, 2024

Description

Introduces module presto-native-tests to run end-to-end tests with Presto native workers. Adds Github action to run these tests.

Motivation and Context

Improves Presto native test coverage by extending production tests from presto-tests module to use the native worker. For full context please refer to #23671.

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.
== RELEASE NOTES ==
General Changes
* Introduces module presto-native-tests to run end-to-end tests with Presto native workers. :pr:`24234`

@prestodb-ci prestodb-ci added the from:IBM PR from IBM label Dec 10, 2024
@prestodb-ci prestodb-ci requested review from a team and ScrapCodes and removed request for a team December 10, 2024 15:25
@pramodsatya pramodsatya force-pushed the add_native_tests branch 2 times, most recently from 6f3ef6f to ceeabce Compare December 15, 2024 06:31
Copy link
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

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

Thank you for the documentation! I made some suggestions for ease of reading and clarity.

If you feel that any of my suggestions change the meaning in a way that is not correct, let me know and we can work on them together.

presto-native-tests/README.md Show resolved Hide resolved
presto-native-tests/README.md Show resolved Hide resolved
presto-native-tests/README.md Show resolved Hide resolved
presto-native-tests/README.md Show resolved Hide resolved
presto-native-tests/README.md Show resolved Hide resolved
presto-native-tests/README.md Show resolved Hide resolved
presto-native-tests/README.md Show resolved Hide resolved
presto-native-tests/README.md Show resolved Hide resolved
Copy link
Contributor Author

@pramodsatya pramodsatya left a comment

Choose a reason for hiding this comment

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

Thanks for the feedback @steveburnett, addressed the comments, could you please take another look?

presto-native-tests/README.md Show resolved Hide resolved
presto-native-tests/README.md Show resolved Hide resolved
steveburnett
steveburnett previously approved these changes Jan 14, 2025
Copy link
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

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

LGTM!

Thanks for addressing the comments! Looks good.

Copy link
Contributor

@aditi-pandit aditi-pandit left a comment

Choose a reason for hiding this comment

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

@pramodsatya : Lets move the second commit to refactor presto-tests in a separate PR. That would make it easier to review. Lets add this work as a motivation for that refactoring.

<dependency>
<groupId>com.facebook.presto</groupId>
<artifactId>presto-tests</artifactId>
<version>${project.version}</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this particular module tried to ${project.version} and not other modules ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing it out, added for other modules as well.

protected QueryRunner createQueryRunner() throws Exception
{
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(
ImmutableMap.of("experimental.iterative-optimizer-enabled", "false"),
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this do ? Its important to specify why this test configuration matters.

}

@Override
protected void createTables()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this function be moved to AbstractTestQueriesNative ?

assertQuery("select reduce_agg(x, array[], (x, y)->array[element_at(x, 2)], (x, y)->array[element_at(x, 2)]) from (select array[array[1]]) T(x)", "select array[null]");
}

// The following approx_set function tests are overriden since approx_set returns different results in Presto C++.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have any outward article or documentation for this ? If not, then we should write one.

@Test
public void testArrayCumSumDecimals()
{
String functionNotRegisteredError = ".*Scalar function presto.default.array_cum_sum not registered with arguments.*";
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have this error because we don't have this functionality ? I don't see a reason for not building it. Do we have an issue for this ? Please create one if its not there and add the link here.


@Override
@Test
public void testDuplicateUnnestRows()
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have an issue for this ?


@Override
@Test
public void testSamplingJoinChain()
Copy link
Contributor

Choose a reason for hiding this comment

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

key_sampling seems like an important feature. Do we have an issue ?


@Override
@Test
public void testScalarSubquery()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this test separated from the java one ?


@Override
@Test
public void testLikePrefixAndSuffixWithChars()
Copy link
Contributor

Choose a reason for hiding this comment

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

These failures are because CHAR Is not supported. Lets add the issue here.

But also any reason these are written with CHAR and not VARCHAR ? We could try to split the original test.

}

@Override
public void testMergeKHyperLogLog()
Copy link
Contributor

Choose a reason for hiding this comment

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

Add an issue for the type not supported and link it here.

@prestodb prestodb deleted a comment from aditi-pandit Jan 22, 2025
@prestodb prestodb deleted a comment from aditi-pandit Jan 22, 2025
Copy link
Contributor Author

@pramodsatya pramodsatya left a comment

Choose a reason for hiding this comment

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

Thanks @aditi-pandit, addressed the comments and created missing issues. Also modified this PR to only include test classes with fewer modifications as discussed. Will open follow-up PRs for the remaining larger test classes from #23671, such as AbstractTestQueriesNative.java.
Could you please take another look?

<dependency>
<groupId>com.facebook.presto</groupId>
<artifactId>presto-tests</artifactId>
<version>${project.version}</version>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing it out, added for other modules as well.

Copy link
Contributor

@aditi-pandit aditi-pandit left a comment

Choose a reason for hiding this comment

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

Thanks @pramodsatya

private static final String storageFormat = "PARQUET";

@Override
protected QueryRunner createQueryRunner() throws Exception
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we plan to overload the expected query runner with the JavaQueryRunner as well ?

@Override
protected QueryRunner createQueryRunner() throws Exception
{
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(
Copy link
Contributor

Choose a reason for hiding this comment

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

Does native engine support these session properties ? Will native side-car catch these ?

needs: prestocpp-linux-build-for-test
runs-on: ubuntu-22.04
container:
image: prestodb/presto-native-dependency:0.290-20241014120930-e1fc090
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove this hardcoded version ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from:IBM PR from IBM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants