You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/04/06 16:19:26 UTC

[GitHub] [druid] suneet-s commented on a diff in pull request #12185: Add a new flag for ingestion to preserve existing metrics

suneet-s commented on code in PR #12185:
URL: https://github.com/apache/druid/pull/12185#discussion_r844140763


##########
core/src/main/java/org/apache/druid/data/input/InputRowSchema.java:
##########
@@ -31,15 +34,38 @@
   private final DimensionsSpec dimensionsSpec;
   private final ColumnsFilter columnsFilter;
 
+  /**
+   * List of metric names for further downstream processing by {@link InputSource}
+   */
+  @Nullable
+  private final List<String> metricNames;
+
   public InputRowSchema(
       final TimestampSpec timestampSpec,
       final DimensionsSpec dimensionsSpec,
       final ColumnsFilter columnsFilter
   )
+  {
+    this(timestampSpec, dimensionsSpec, columnsFilter, null);
+  }
+
+  public InputRowSchema(
+      final TimestampSpec timestampSpec,
+      final DimensionsSpec dimensionsSpec,
+      final ColumnsFilter columnsFilter,
+      @Nullable final List<String> metricNames
+  )
   {
     this.timestampSpec = timestampSpec;
     this.dimensionsSpec = dimensionsSpec;
     this.columnsFilter = columnsFilter;
+    this.metricNames = metricNames;
+  }
+
+  @Nullable

Review Comment:
   How should callers of this method think about the difference between a null list and an empty list?
   
   It looks like the code behaves the same right now whether or not the list is null or empty. Can we update this to be `@NotNull` and return an empty list if metricNames is null. This will make it easier for callers of this method as they do not have to add null checks.
   
   If null is meant to represent a different state, can we please add javadocs to explain that difference.



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org