From f1aa7918d59fac5bf94c1b74a6ce89ce42cc5647 Mon Sep 17 00:00:00 2001 From: cecemei Date: Thu, 19 Dec 2024 23:33:22 -0800 Subject: [PATCH] revert change in test as well --- .../metadata/SegmentMetadataQueryTest.java | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/processing/src/test/java/org/apache/druid/query/metadata/SegmentMetadataQueryTest.java b/processing/src/test/java/org/apache/druid/query/metadata/SegmentMetadataQueryTest.java index 1e5160e2ed83..1abe8ec08c29 100644 --- a/processing/src/test/java/org/apache/druid/query/metadata/SegmentMetadataQueryTest.java +++ b/processing/src/test/java/org/apache/druid/query/metadata/SegmentMetadataQueryTest.java @@ -52,13 +52,11 @@ import org.apache.druid.query.Result; import org.apache.druid.query.TableDataSource; import org.apache.druid.query.aggregation.AggregatorFactory; -import org.apache.druid.query.filter.NullFilter; import org.apache.druid.query.metadata.metadata.AggregatorMergeStrategy; import org.apache.druid.query.metadata.metadata.ColumnAnalysis; import org.apache.druid.query.metadata.metadata.ListColumnIncluderator; import org.apache.druid.query.metadata.metadata.SegmentAnalysis; import org.apache.druid.query.metadata.metadata.SegmentMetadataQuery; -import org.apache.druid.query.policy.Policy; import org.apache.druid.query.spec.LegacySegmentSpec; import org.apache.druid.segment.IncrementalIndexSegment; import org.apache.druid.segment.QueryableIndex; @@ -88,7 +86,6 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.Optional; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -332,30 +329,6 @@ public void testSegmentMetadataQuery() Assert.assertEquals(Collections.singletonList(expectedSegmentAnalysis1), results); } - @Test - public void testSegmentMetadataQueryWorksWithRestrictions() throws Exception - { - ImmutableMap> noRestriction = ImmutableMap.of(DATASOURCE, Optional.empty()); - ImmutableMap> alwaysTrueRestriction = ImmutableMap.of(DATASOURCE, Optional.of( - Policy.NO_RESTRICTION)); - ImmutableMap> withRestriction = ImmutableMap.of( - DATASOURCE, - Optional.of(Policy.fromRowFilter( - new NullFilter("some-column", null))) - ); - List results1 = runner1.run(QueryPlus.wrap(testQuery.withPolicyRestrictions(noRestriction, Policy.TablePolicySecurityLevel.POLICY_CHECKED_ON_ALL_TABLES_POLICY_MUST_EXIST))) - .toList(); - List results2 = runner1.run(QueryPlus.wrap(testQuery.withPolicyRestrictions(alwaysTrueRestriction, Policy.TablePolicySecurityLevel.POLICY_CHECKED_ON_ALL_TABLES_POLICY_MUST_EXIST))) - .toList(); - - Assert.assertEquals(Collections.singletonList(expectedSegmentAnalysis1), results1); - Assert.assertEquals(Collections.singletonList(expectedSegmentAnalysis1), results2); - Assert.assertThrows( - RuntimeException.class, - () -> runner1.run(QueryPlus.wrap(testQuery.withPolicyRestrictions(withRestriction, Policy.TablePolicySecurityLevel.POLICY_CHECKED_ON_ALL_TABLES_POLICY_MUST_EXIST))) - ); - } - @Test public void testSegmentMetadataQueryWithRollupMerge() {