github-advanced-security[bot] commented on code in PR #17762:
URL: https://github.com/apache/druid/pull/17762#discussion_r2376740365


##########
processing/src/main/java/org/apache/druid/segment/IndexSpec.java:
##########
@@ -162,6 +190,92 @@
     return jsonCompression;
   }
 
+  @JsonProperty
+  @JsonInclude(JsonInclude.Include.NON_NULL)
+  @Nullable
+  public NestedCommonFormatColumnFormatSpec getAutoColumnFormatSpec()
+  {
+    return autoColumnFormatSpec;
+  }
+
+  /**
+   * Populate all null fields of {@link IndexSpec}, first from {@link 
#getDefault()} and finally falling back to hard
+   * coded defaults if no overrides are defined.
+   */
+  @JsonIgnore
+  public IndexSpec getEffectiveSpec()
+  {
+    Builder bob = IndexSpec.builder();
+    final IndexSpec defaultSpec = getDefault();
+
+    if (bitmapSerdeFactory != null) {
+      bob.withBitmapSerdeFactory(bitmapSerdeFactory);
+    } else if (defaultSpec.bitmapSerdeFactory != null) {
+      bob.withBitmapSerdeFactory(defaultSpec.bitmapSerdeFactory);
+    } else {
+      bob.withBitmapSerdeFactory(new BitmapSerde.DefaultBitmapSerdeFactory());
+    }
+
+    if (dimensionCompression != null) {
+      bob.withDimensionCompression(dimensionCompression);
+    } else if (defaultSpec.dimensionCompression != null) {
+      bob.withDimensionCompression(defaultSpec.dimensionCompression);
+    } else {
+      
bob.withDimensionCompression(CompressionStrategy.DEFAULT_COMPRESSION_STRATEGY);
+    }
+
+    if (stringDictionaryEncoding != null) {
+      bob.withStringDictionaryEncoding(stringDictionaryEncoding);
+    } else if (defaultSpec.stringDictionaryEncoding != null) {
+      bob.withStringDictionaryEncoding(defaultSpec.stringDictionaryEncoding);
+    } else {
+      bob.withStringDictionaryEncoding(StringEncodingStrategy.DEFAULT);
+    }
+
+    if (metricCompression != null) {
+      bob.withMetricCompression(metricCompression);
+    } else if (defaultSpec.metricCompression != null) {
+      bob.withMetricCompression(defaultSpec.metricCompression);
+    } else {
+      
bob.withMetricCompression(CompressionStrategy.DEFAULT_COMPRESSION_STRATEGY);
+    }
+
+    if (longEncoding != null) {
+      bob.withLongEncoding(longEncoding);
+    } else if (defaultSpec.longEncoding != null) {
+      bob.withLongEncoding(defaultSpec.longEncoding);
+    } else {
+      bob.withLongEncoding(CompressionFactory.DEFAULT_LONG_ENCODING_STRATEGY);
+    }
+
+    if (complexMetricCompression != null) {
+      bob.withComplexMetricCompression(complexMetricCompression);
+    } else if (defaultSpec.complexMetricCompression != null) {
+      bob.withComplexMetricCompression(defaultSpec.complexMetricCompression);
+    }
+
+    if (jsonCompression != null) {
+      bob.withJsonCompression(jsonCompression);
+    } else if (defaultSpec.jsonCompression != null) {
+      bob.withJsonCompression(defaultSpec.jsonCompression);

Review Comment:
   ## Deprecated method or constructor invocation
   
   Invoking [Builder.withJsonCompression](1) should be avoided because it has 
been deprecated.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/10408)



##########
processing/src/main/java/org/apache/druid/segment/IndexSpec.java:
##########
@@ -162,6 +190,92 @@
     return jsonCompression;
   }
 
+  @JsonProperty
+  @JsonInclude(JsonInclude.Include.NON_NULL)
+  @Nullable
+  public NestedCommonFormatColumnFormatSpec getAutoColumnFormatSpec()
+  {
+    return autoColumnFormatSpec;
+  }
+
+  /**
+   * Populate all null fields of {@link IndexSpec}, first from {@link 
#getDefault()} and finally falling back to hard
+   * coded defaults if no overrides are defined.
+   */
+  @JsonIgnore
+  public IndexSpec getEffectiveSpec()
+  {
+    Builder bob = IndexSpec.builder();
+    final IndexSpec defaultSpec = getDefault();
+
+    if (bitmapSerdeFactory != null) {
+      bob.withBitmapSerdeFactory(bitmapSerdeFactory);
+    } else if (defaultSpec.bitmapSerdeFactory != null) {
+      bob.withBitmapSerdeFactory(defaultSpec.bitmapSerdeFactory);
+    } else {
+      bob.withBitmapSerdeFactory(new BitmapSerde.DefaultBitmapSerdeFactory());
+    }
+
+    if (dimensionCompression != null) {
+      bob.withDimensionCompression(dimensionCompression);
+    } else if (defaultSpec.dimensionCompression != null) {
+      bob.withDimensionCompression(defaultSpec.dimensionCompression);
+    } else {
+      
bob.withDimensionCompression(CompressionStrategy.DEFAULT_COMPRESSION_STRATEGY);
+    }
+
+    if (stringDictionaryEncoding != null) {
+      bob.withStringDictionaryEncoding(stringDictionaryEncoding);
+    } else if (defaultSpec.stringDictionaryEncoding != null) {
+      bob.withStringDictionaryEncoding(defaultSpec.stringDictionaryEncoding);
+    } else {
+      bob.withStringDictionaryEncoding(StringEncodingStrategy.DEFAULT);
+    }
+
+    if (metricCompression != null) {
+      bob.withMetricCompression(metricCompression);
+    } else if (defaultSpec.metricCompression != null) {
+      bob.withMetricCompression(defaultSpec.metricCompression);
+    } else {
+      
bob.withMetricCompression(CompressionStrategy.DEFAULT_COMPRESSION_STRATEGY);
+    }
+
+    if (longEncoding != null) {
+      bob.withLongEncoding(longEncoding);
+    } else if (defaultSpec.longEncoding != null) {
+      bob.withLongEncoding(defaultSpec.longEncoding);
+    } else {
+      bob.withLongEncoding(CompressionFactory.DEFAULT_LONG_ENCODING_STRATEGY);
+    }
+
+    if (complexMetricCompression != null) {
+      bob.withComplexMetricCompression(complexMetricCompression);
+    } else if (defaultSpec.complexMetricCompression != null) {
+      bob.withComplexMetricCompression(defaultSpec.complexMetricCompression);
+    }
+
+    if (jsonCompression != null) {
+      bob.withJsonCompression(jsonCompression);

Review Comment:
   ## Deprecated method or constructor invocation
   
   Invoking [Builder.withJsonCompression](1) should be avoided because it has 
been deprecated.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/10407)



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