clintropolis commented on code in PR #14932:
URL: https://github.com/apache/druid/pull/14932#discussion_r1312093327
##########
indexing-service/src/main/java/org/apache/druid/indexing/common/task/AbstractBatchIndexTask.java:
##########
@@ -520,24 +519,25 @@ public static Function<Set<DataSegment>,
Set<DataSegment>> compactionStateAnnota
TuningConfig tuningConfig = ingestionSpec.getTuningConfig();
GranularitySpec granularitySpec =
ingestionSpec.getDataSchema().getGranularitySpec();
// We do not need to store dimensionExclusions and spatialDimensions
since auto compaction does not support them
- DimensionsSpec dimensionsSpec =
ingestionSpec.getDataSchema().getDimensionsSpec() == null
- ? null
- : new
DimensionsSpec(ingestionSpec.getDataSchema().getDimensionsSpec().getDimensions());
+ DimensionsSpec dimensionsSpec =
ingestionSpec.getDataSchema().getDimensionsSpec();
+ if (dimensionsSpec != null) {
+ dimensionsSpec = new
DimensionsSpec(ingestionSpec.getDataSchema().getDimensionsSpec().getDimensions());
+ }
// We only need to store filter since that is the only field auto
compaction support
- Map<String, Object> transformSpec =
ingestionSpec.getDataSchema().getTransformSpec() == null ||
TransformSpec.NONE.equals(ingestionSpec.getDataSchema().getTransformSpec())
- ? null
- : new
ClientCompactionTaskTransformSpec(ingestionSpec.getDataSchema().getTransformSpec().getFilter()).asMap(toolbox.getJsonMapper());
- List<Object> metricsSpec =
ingestionSpec.getDataSchema().getAggregators() == null
- ? null
- :
toolbox.getJsonMapper().convertValue(ingestionSpec.getDataSchema().getAggregators(),
new TypeReference<List<Object>>() {});
+ TransformSpec transformSpec =
ingestionSpec.getDataSchema().getTransformSpec();
+ if (TransformSpec.NONE.equals(transformSpec)) {
Review Comment:
ah yeah, though i put a not null check in the else instead since it seemed a
little strange to check for null and assign null again
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]