kfaraz commented on code in PR #14932:
URL: https://github.com/apache/druid/pull/14932#discussion_r1312014590


##########
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:
   Should this handle `transformSpec == null` too?



##########
processing/src/main/java/org/apache/druid/timeline/CompactionState.java:
##########
@@ -43,27 +46,21 @@ public class CompactionState
 {
   private final PartitionsSpec partitionsSpec;
   private final DimensionsSpec dimensionsSpec;
-  // org.apache.druid.segment.transform.TransformSpec cannot be used here 
because it's in the 'processing' module which
-  // has a dependency on the 'core' module where this class is.
-  private final Map<String, Object> transformSpec;
-  // org.apache.druid.segment.IndexSpec cannot be used here because it's in 
the 'processing' module which
-  // has a dependency on the 'core' module where this class is.
-  private final Map<String, Object> indexSpec;
+  private final TransformSpec transformSpec;
+  private final IndexSpec indexSpec;
   // org.apache.druid.segment.indexing.granularity.GranularitySpec cannot be 
used here because it's in the
-  // 'server' module which has a dependency on the 'core' module where this 
class is.
-  private final Map<String, Object> granularitySpec;
-  // org.apache.druid.query.aggregation.AggregatorFactory cannot be used here 
because it's in the 'processing' module which
-  // has a dependency on the 'core' module where this class is.
-  private final List<Object> metricsSpec;
+  // 'server' module which has a dependency on the 'processing' module where 
this class is.

Review Comment:
   Can remove this comment too.



##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/sampler/SamplerConfig.java:
##########
@@ -22,6 +22,7 @@
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.google.common.base.Preconditions;
+import org.apache.druid.indexer.granularity.GranularitySpec;

Review Comment:
   Nit: This might get flagged as an unnecessary import as it is only used in 
javadoc.



-- 
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]

Reply via email to