Dimension extraction javascript function returning null

I have a simple setup of kafka indexing on a single machine setup. I am trying to use javascript extraction function but I am getting all the values as null for that function. Am I missing something here? Attached is my supervisor-spec.json file. Any help is appreciated.

supervisor-spec.json (1.49 KB)

Hi Rahul,

The dimensionsSpec at ingestion time doesn’t support extractionFns (only query time dimensions support them).

There is a “transformSpec” functionality at ingestion time added in 0.12.0 that you might find useful. It isn’t documented yet (we will be adding docs soon!!). You can find info in the PR that added the feature: https://github.com/druid-io/druid/pull/4890, paired with the expression documentation: http://druid.io/docs/latest/misc/math-expr.html

The “transformSpec” goes in the “dataSchema” of your ingestion spec, on the same nesting level as “datasource” and “parser”, e.g.:

“transformSpec”: {

"transforms": [

   {

     "type": "expression",

     "name": "eventTime",

     "expression": "timestamp_format(eventTime, yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC)"

   }

]

}

Where “expression” is an expression suitable for your use case.