From 446c9a5afa05c16b8fcadfe15031440db90d7076 Mon Sep 17 00:00:00 2001 From: Atul Mohan Date: Mon, 12 Sep 2022 13:41:06 -0700 Subject: [PATCH 1/2] Initialize null handling --- .../test/java/org/apache/druid/frame/key/KeyTestUtils.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/processing/src/test/java/org/apache/druid/frame/key/KeyTestUtils.java b/processing/src/test/java/org/apache/druid/frame/key/KeyTestUtils.java index 8576250c4de6..53b016be04d5 100644 --- a/processing/src/test/java/org/apache/druid/frame/key/KeyTestUtils.java +++ b/processing/src/test/java/org/apache/druid/frame/key/KeyTestUtils.java @@ -21,6 +21,7 @@ import org.apache.datasketches.memory.Memory; import org.apache.datasketches.memory.WritableMemory; +import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.Frame; import org.apache.druid.frame.FrameType; import org.apache.druid.frame.allocation.HeapMemoryAllocator; @@ -45,6 +46,10 @@ private KeyTestUtils() // No instantiation. } + static { + NullHandling.initializeForTests(); + } + /** * Create a signature matching {@code sortColumns}, using types from {@code inspector}. */ From 4cf977500dd29a3f4f74a88d3ead12fe7596dd56 Mon Sep 17 00:00:00 2001 From: Atul Mohan Date: Tue, 13 Sep 2022 08:49:41 -0700 Subject: [PATCH 2/2] Refactor nullhandlingconfig init --- .../druid/msq/statistics/DelegateOrMinKeyCollectorTest.java | 5 +++++ .../msq/statistics/QuantilesSketchKeyCollectorTest.java | 5 +++++ .../test/java/org/apache/druid/frame/key/KeyTestUtils.java | 5 ----- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/statistics/DelegateOrMinKeyCollectorTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/statistics/DelegateOrMinKeyCollectorTest.java index f5a07de1af5c..09b52a37157c 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/statistics/DelegateOrMinKeyCollectorTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/statistics/DelegateOrMinKeyCollectorTest.java @@ -20,6 +20,7 @@ package org.apache.druid.msq.statistics; import com.google.common.collect.ImmutableList; +import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.key.ClusterBy; import org.apache.druid.frame.key.KeyTestUtils; import org.apache.druid.frame.key.RowKey; @@ -41,6 +42,10 @@ public class DelegateOrMinKeyCollectorTest private final RowSignature signature = RowSignature.builder().add("x", ColumnType.LONG).build(); private final Comparator comparator = clusterBy.keyComparator(); + static { + NullHandling.initializeForTests(); + } + @Test public void testEmpty() { diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/statistics/QuantilesSketchKeyCollectorTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/statistics/QuantilesSketchKeyCollectorTest.java index 0555c7c5d555..974f79c7bfb8 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/statistics/QuantilesSketchKeyCollectorTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/statistics/QuantilesSketchKeyCollectorTest.java @@ -20,6 +20,7 @@ package org.apache.druid.msq.statistics; import com.google.common.collect.ImmutableList; +import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.key.ClusterBy; import org.apache.druid.frame.key.ClusterByPartition; import org.apache.druid.frame.key.ClusterByPartitions; @@ -41,6 +42,10 @@ public class QuantilesSketchKeyCollectorTest private final Comparator comparator = clusterBy.keyComparator(); private final int numKeys = 500_000; + static { + NullHandling.initializeForTests(); + } + @Test public void test_empty() { diff --git a/processing/src/test/java/org/apache/druid/frame/key/KeyTestUtils.java b/processing/src/test/java/org/apache/druid/frame/key/KeyTestUtils.java index 53b016be04d5..8576250c4de6 100644 --- a/processing/src/test/java/org/apache/druid/frame/key/KeyTestUtils.java +++ b/processing/src/test/java/org/apache/druid/frame/key/KeyTestUtils.java @@ -21,7 +21,6 @@ import org.apache.datasketches.memory.Memory; import org.apache.datasketches.memory.WritableMemory; -import org.apache.druid.common.config.NullHandling; import org.apache.druid.frame.Frame; import org.apache.druid.frame.FrameType; import org.apache.druid.frame.allocation.HeapMemoryAllocator; @@ -46,10 +45,6 @@ private KeyTestUtils() // No instantiation. } - static { - NullHandling.initializeForTests(); - } - /** * Create a signature matching {@code sortColumns}, using types from {@code inspector}. */