opensearch-project / opensearch-spark

Spark Accelerator framework ; It enables secondary indices to remote data stores.
Apache License 2.0
14 stars 23 forks source link

[FEATURE]Add PPL Sanity Tests Job #718

Open YANG-DB opened 1 day ago

YANG-DB commented 1 day ago

Is your feature request related to a problem?

We need a comprehensive testing framework to validate PPL commands in the Spark environment, ensuring that each new PPL (Spark) release meets critical requirements such as:

This testing job should be deployable on any Spark-PPL compatible setup and should automate the dataset setup, reducing the friction for developers and testers. Additionally, this can evolve into a multi-step project, eventually introducing TPC-H-based performance benchmarking as well as extended validation scenarios.

What solution would you like?

We propose creating a Spark PPL Sanity Job that includes the following components:

Dataset Generator:

Endpoint API:

Extendable Framework:

Plugin Strategy: Developers should be able to extend the framework by adding new types of tests. This would involve a modular architecture where each test can be a standalone plugin or module. Grammar Extensions: It should be possible to add new PPL commands or grammar rules for testing without changing the architecture or packaging of the project - testing content should be defined as an additional resource to the project.

  1. Multi-step Test Jobs:

    • The framework should allow for incremental testing, starting with basic functionality and eventually supporting complex performance benchmarks such as TPC-H (or similar) as a future expansion.

Why is this needed?

Example Use Cases & Existing Test Frameworks:

Proposed Architecture:

  1. Dataset Creation Step:

    • We could include built-in dataset generators or simple dataset templates as part of the repository. These templates could serve both sanity tests (small, controlled datasets) and performance tests (larger, more complex datasets).
  2. Parameterized Spark Job:

    • The job could accept parameters (like catalog name, schema, dataset size, test types, etc.) and trigger the corresponding tests dynamically based on the configuration.
  3. Modular Test Components:

    • Sanity Tests: Ensure that each PPL command (e.g., eval, head, sort) returns the expected results on a known dataset.
    • Performance Tests: Execute larger-scale queries and track runtime, memory usage, and throughput.
    • Backward Compatibility: Automatically run tests on previous PPL versions to check for any regressions.

Do you have any additional context?

YANG-DB commented 1 day ago

@LantaoJin @penghuo @dai-chen can you please review and comment ? thanks

anirudha commented 1 day ago

can we add milestones here/ thanks