druid/integration-tests-ex
Gian Merlino 175636b28f
Frame writers: Coerce numeric and array types in certain cases. (#16994)
This patch adds "TypeCastSelectors", which is used when writing frames to
perform two coercions:

- When a numeric type is desired and the underlying type is non-numeric or
  unknown, the underlying selector is wrapped, "getObject" is called and the
  result is coerced using "ExprEval.ofType". This differs from the prior
  behavior where the primitive methods like "getLong", "getDouble", etc, would
  be called directly. This fixes an issue where a column would be read as
  all-zeroes when its SQL type is numeric and its physical type is string, which
  can happen when evolving a column's type from string to number.

-  When an array type is desired, the underlying selector is wrapped,
   "getObject" is called, and the result is coerced to Object[]. This coercion
   replaces some earlier logic from #15917.
2024-09-05 17:20:00 -07:00
..
cases Frame writers: Coerce numeric and array types in certain cases. (#16994) 2024-09-05 17:20:00 -07:00
docs Revised IT to detect backward incompatible change (#16779) 2024-08-07 11:13:35 +05:30
image Revised IT to detect backward incompatible change (#16779) 2024-08-07 11:13:35 +05:30
tools Change Inspection Profile to set "Method is identical to its super method" as error (#16976) 2024-08-31 09:37:34 +05:30
.gitignore Docker build for the revised ITs (#12707) 2022-08-10 14:17:33 +05:30
README.md Update integration tests related documentation for better clarity (#16313) 2024-05-13 11:27:21 +05:30

README.md

Revised Integration Tests

This directory builds a Docker image for Druid, then uses that image, along with test configuration to run tests. This version greatly evolves the integration tests from the earlier form. See the History section for details.

Shortcuts

List of the most common commands once you're familiar with the framework. If you are new to the framework, see Quickstart for an explanation.

Build Druid

./it.sh build

Build the Test Image

./it.sh image

Note: If you are running it on Apple Silicon processors, you would also need to uncomment all occurrences of platform: linux/x86_64 in dependencies.yaml.

Run an IT from the Command Line

./it.sh test <category>

Where <category> is one of the test categories. You can see the list of test categories at src/test/java/org/apache/druid/testsEx/categories. The corresponding test classes are also annotated with @Category like @Category(HighAvailability.class).

For example, a sample command for running IT for @Category(HighAvailability.class) would be:

./it.sh test HighAvailability

Run an IT from the IDE

Start the cluster:

./it.sh up <category>

Where <category> is one of the test categories. Then launch the test as a JUnit test.

Contents

Background information

Goals

The goal of the present version is to simplify development.

  • Speed up the Druid test image build by avoiding download of dependencies. (Instead, any such dependencies are managed by Maven and reside in the local build cache.)
  • Use official images for dependencies to avoid the need to download, install, and manage those dependencies.
  • Make it is easy to manually build the image, launch a cluster, and run a test against the cluster.
  • Convert tests to JUnit so that they will easily run in your favorite IDE, just like other Druid tests.
  • Use the actual Druid build from distribution so we know what is tested.
  • Leverage, don't fight, Maven.
  • Run the integration tests easily on a typical development machine.

By meeting these goals, you can quickly:

  • Build the Druid distribution.
  • Build the Druid image. (< 1 minute)
  • Launch the cluster for the particular test. (a few seconds)
  • Run the test any number of times in your debugger.
  • Clean up the test artifacts.

The result is that the fastest path to develop a Druid patch or feature is:

  • Create a normal unit test and run it to verify your code.
  • Create an integration test that double-checks the code in a live cluster.