From c8e458452db929814a0e28665df1d5ed2af2728d Mon Sep 17 00:00:00 2001 From: Clint Wylie Date: Sun, 22 Oct 2023 22:54:46 -0700 Subject: [PATCH] Fix native is boolean filter cache key tests to test the right thing (#15216) --- .../druid/query/filter/IsBooleanDimFilterTest.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/processing/src/test/java/org/apache/druid/query/filter/IsBooleanDimFilterTest.java b/processing/src/test/java/org/apache/druid/query/filter/IsBooleanDimFilterTest.java index 7c4be474efe..e53158a6086 100644 --- a/processing/src/test/java/org/apache/druid/query/filter/IsBooleanDimFilterTest.java +++ b/processing/src/test/java/org/apache/druid/query/filter/IsBooleanDimFilterTest.java @@ -52,11 +52,15 @@ public class IsBooleanDimFilterTest extends InitializedNullHandlingTest @Test public void testGetCacheKey() { - EqualityFilter f1 = new EqualityFilter("x", ColumnType.STRING, "hello", null); - EqualityFilter f1_2 = new EqualityFilter("x", ColumnType.STRING, "hello", null); - EqualityFilter f2 = new EqualityFilter("x", ColumnType.STRING, "world", null); - EqualityFilter f3 = new EqualityFilter("x", ColumnType.STRING, "hello", new FilterTuning(true, null, null)); + IsTrueDimFilter f1 = IsTrueDimFilter.of(new EqualityFilter("x", ColumnType.STRING, "hello", null)); + IsTrueDimFilter f1_2 = IsTrueDimFilter.of(new EqualityFilter("x", ColumnType.STRING, "hello", null)); + IsFalseDimFilter f1_3 = IsFalseDimFilter.of(new EqualityFilter("x", ColumnType.STRING, "hello", null)); + IsFalseDimFilter f1_4 = IsFalseDimFilter.of(new EqualityFilter("x", ColumnType.STRING, "hello", null)); + IsTrueDimFilter f2 = IsTrueDimFilter.of(new EqualityFilter("x", ColumnType.STRING, "world", null)); + IsTrueDimFilter f3 = IsTrueDimFilter.of(new EqualityFilter("x", ColumnType.STRING, "hello", new FilterTuning(true, null, null))); Assert.assertArrayEquals(f1.getCacheKey(), f1_2.getCacheKey()); + Assert.assertFalse(Arrays.equals(f1.getCacheKey(), f1_3.getCacheKey())); + Assert.assertArrayEquals(f1_3.getCacheKey(), f1_4.getCacheKey()); Assert.assertFalse(Arrays.equals(f1.getCacheKey(), f2.getCacheKey())); Assert.assertArrayEquals(f1.getCacheKey(), f3.getCacheKey());