Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable loading lookups by default in CompactionTask #16420

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address review comments
  • Loading branch information
Akshat-Jain committed May 10, 2024
commit 948eb01e8590967dfd3e70876a51fbc429790957
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ public void testCompactionTaskToClientCompactionTaskQuery() throws IOException
.transformSpec(new ClientCompactionTaskTransformSpec(new SelectorDimFilter("dim1", "foo", null)))
.build();

Map<String, Object> expectedContext = new HashMap<>();
final ClientCompactionTaskQuery expected = new ClientCompactionTaskQuery(
task.getId(),
"datasource",
Expand Down Expand Up @@ -354,22 +355,17 @@ public void testCompactionTaskToClientCompactionTaskQuery() throws IOException
new ClientCompactionTaskDimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("ts", "dim"))),
new AggregatorFactory[] {new CountAggregatorFactory("cnt")},
new ClientCompactionTaskTransformSpec(new SelectorDimFilter("dim1", "foo", null)),
new HashMap<>()
expectedContext
);

final byte[] json = mapper.writeValueAsBytes(task);
final ClientCompactionTaskQuery actual = (ClientCompactionTaskQuery) mapper.readValue(json, ClientTaskQuery.class);

Assert.assertEquals(expected.getDataSource(), actual.getDataSource());
Assert.assertEquals(expected.getId(), actual.getId());
Assert.assertEquals(expected.getType(), actual.getType());
Assert.assertEquals(expected.getGranularitySpec(), actual.getGranularitySpec());
Assert.assertEquals(expected.getDimensionsSpec(), actual.getDimensionsSpec());
Assert.assertEquals(expected.getIoConfig(), actual.getIoConfig());
Assert.assertEquals(expected.getTransformSpec(), actual.getTransformSpec());
Assert.assertArrayEquals(expected.getMetricsSpec(), actual.getMetricsSpec());
Assert.assertEquals(expected.getTuningConfig(), actual.getTuningConfig());
Assert.assertEquals(ImmutableMap.of(LookupLoadingSpec.CTX_LOOKUP_LOADING_MODE, LookupLoadingSpec.Mode.NONE.toString()), actual.getContext());
// Verify that CompactionTask has added new parameters into the context
Assert.assertNotEquals(expected, actual);

expectedContext.put(LookupLoadingSpec.CTX_LOOKUP_LOADING_MODE, LookupLoadingSpec.Mode.NONE.toString());
Assert.assertEquals(expected, actual);
}

private static ObjectMapper setupInjectablesInObjectMapper(ObjectMapper objectMapper)
Expand Down
Loading