Skip to content

Commit

Permalink
revert change in test as well
Browse files Browse the repository at this point in the history
  • Loading branch information
cecemei committed Dec 20, 2024
1 parent ec6e3b5 commit f1aa791
Showing 1 changed file with 0 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -332,30 +329,6 @@ public void testSegmentMetadataQuery()
Assert.assertEquals(Collections.singletonList(expectedSegmentAnalysis1), results);
}

@Test
public void testSegmentMetadataQueryWorksWithRestrictions() throws Exception
{
ImmutableMap<String, Optional<Policy>> noRestriction = ImmutableMap.of(DATASOURCE, Optional.empty());
ImmutableMap<String, Optional<Policy>> alwaysTrueRestriction = ImmutableMap.of(DATASOURCE, Optional.of(
Policy.NO_RESTRICTION));
ImmutableMap<String, Optional<Policy>> 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()
{
Expand Down

0 comments on commit f1aa791

Please sign in to comment.