How to get the original field name of an aggregator by segment metadata queries?

Hi everyone,

I want to get the original field name of a hyperUnique aggregator by post a “segmentMetadata” query with the “aggregators” keyword in the “analysisTypes” section. The related JSON sections in response content as below:

“aggregators” : {

...

"user_unique" : {

  "type" : "hyperUnique",

  "name" : "user_unique",

  "fieldName" : "user_unique",

  "isInputHyperUnique" : false,

  "round" : false

}

}

I found the value “fieldName” field is “user_unique” which is the same as the value of “name” field. I hope to see “user” as the value of “fieldName” because this hyperUnique aggregator is come from “user” field.

I explored Druid source code and I found in the process of ingestion, and during the persistence of the “metadata.drd” part of the smoosh file, the method below is called:

public AggregatorFactory getCombiningFactory()
{
  return new HyperUniquesAggregatorFactory(name, name, false, round);
}

So the value of “fieldName” is the same as the “name” field.

So, how can I get the original field name of an aggregator (include hyperUnique and all other aggregators)?

Thank you so much.

Regards,

ZR

I don’t think that’s possible, the original field name isn’t retained during ingestion.

  • Jon