jaykanakiya commented on code in PR #19258:
URL: https://github.com/apache/druid/pull/19258#discussion_r3036210902
##########
server/src/main/java/org/apache/druid/segment/realtime/sink/Sink.java:
##########
@@ -306,11 +315,12 @@ public List<SinkSegmentReference>
acquireSegmentReferences(
private FireHydrant makeNewCurrIndex(long minTimestamp, DataSchema schema)
{
+ final DimensionsSpec dimensionsSpec =
resolveEffectiveDimensionsSpec(schema.getDimensionsSpec());
Review Comment:
Added a comment.
##########
server/src/main/java/org/apache/druid/segment/realtime/sink/Sink.java:
##########
@@ -386,6 +396,20 @@ private FireHydrant makeNewCurrIndex(long minTimestamp,
DataSchema schema)
return old;
}
+ private DimensionsSpec resolveEffectiveDimensionsSpec(DimensionsSpec
dimensionsSpec)
+ {
+ if (indexSpec == null) {
+ return dimensionsSpec;
+ }
+ final List<DimensionSchema> effectiveDimensions =
dimensionsSpec.getDimensions()
+ .stream()
+ .map(dim -> dim.getEffectiveSchema(indexSpec))
+ .collect(Collectors.toList());
+ return DimensionsSpec.builder(dimensionsSpec)
+ .setDimensions(effectiveDimensions)
+ .build();
+ }
+
Review Comment:
Added IndexSpec.getDefault() in the constructor as the default.
--
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]