[druid-user] Ingested metric name VS fieldName

Hi all,

I’ve observed in one of our ingestion specs such an odd thing:

“type”: “longSum”,
*“*name": “targetMetric”,
*”*fieldName": “sourceMetric”

The thing is that in the source data there is no such field as sourceMetric*.* There is the field targetMetric though. As result, after ingestion it works as it was:

“type”: “longSum”,
*“*name": “targetMetric”,
*”*fieldName": “targetMetric

Does anybody have any explanation for this, please? Is there any default, like if there is not sourceMetric, then use targetMetric?


I can’t find any references to sourceMetric. Were you ingesting through the web console?



sourceMetric is just an example value for the fieldName.

Let me describe a better example.
Having a dataset with next data:

In other words, I could reproduce the description in red from below

Thank you for the clarification. It might be expected behavior? I found this:

private HyperUniqueFinalizingPostAggregator(

String name,

String fieldName,

@Nullable AggregatorFactory aggregatorFactory



this.fieldName = Preconditions.checkNotNull(fieldName, "fieldName is null");

//Note that, in general, name shouldn't be null, we are defaulting

//to fieldName here just to be backward compatible with 0.7.x

this.name = name == null ? fieldName : name;

this.aggregatorFactory = aggregatorFactory;


Thanks for response.

It does not seem to be the case because we have both fields (name and fieldName) set in the spec. I guess it should be somewhere in the code where the hadoop job effectively reads the values of name/fieldName fields.