How to ingest batch data to druid


I have csv files stored in HDFS. I want to ingest them to druid. How can i do this ?

I am new to druid, using it for the first time.

Please help me.

Thank you.


Please check if this would be useful :

You will need appropriate Hadoop extensions.

I performed the steps given in the document you gave. but i am facing the error.

I am submitting the task using below command:

curl -X 'POST' -H 'Content-Type:application/json' -d @flight-index.json [http://localhost:8090/druid/indexer/v1/task](http://localhost:8090/druid/indexer/v1/task)                   

It throws below error:

2019-01-05 10:47:25,619 pool-1-thread-1 ERROR Unable to register shutdown hook because JVM is shutting down. java.lang.IllegalStateException: Not started
 at io.druid.common.config.Log4jShutdown.addShutdownCallback(
 at org.apache.logging.log4j.core.impl.Log4jContextFactory.addShutdownCallback(
 at org.apache.logging.log4j.core.LoggerContext.setUpShutdownHook(
 at org.apache.logging.log4j.core.LoggerContext.start(
 at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(
 at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(
 at org.apache.logging.log4j.LogManager.getContext(
 at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(
 at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(
 at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(
 at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(
 at org.slf4j.LoggerFactory.getLogger(
 at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(
 at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(
 at org.apache.commons.logging.LogFactory.getLog(
 at org.apache.hadoop.hdfs.LeaseRenewer.<clinit>(
 at org.apache.hadoop.hdfs.DFSClient.getLeaseRenewer(
 at org.apache.hadoop.hdfs.DFSClient.close(
 at org.apache.hadoop.hdfs.DistributedFileSystem.close(
 at org.apache.hadoop.fs.FileSystem$Cache.closeAll(
 at org.apache.hadoop.fs.FileSystem$Cache$
 at java.util.concurrent.Executors$
 at java.util.concurrent.ThreadPoolExecutor.runWorker(
 at java.util.concurrent.ThreadPoolExecutor$


Attached is the flight-index.json file and the file.

i have also placed hadoop configuration XMLs (core-site.xml, hdfs-site.xml, yarn-site.xml, mapred-site.xml) into `conf/druid/_common/`.

Thank you

[flight-index.json|attachment](upload://unLyPoLhHtT1DsWbYwNuT3oesYY.json) (8.71 KB)

[|attachment](upload:// (4.38 KB)

Can you attach complete task logs, after masking any sensitive info ?

there will be more information before this one which caused the failure.

attached document is complete task log.

log.txt (166 KB)

From the input file name it seems you might be trying to ingest csv file.

But the parser being used is a JSON parser which is not able to parse the input data. (Refer the ParseException in the logs) has details on different supported format and the sample parsers.

Hope it helps.

I am really new to druid. I have created the index.json file from the another example, i am not aware of the parameters. I am trying to update according to the link you have given.

Thank you.

Is timestamp field compulsory in input data(csv files) ?

That’s correct, a timestamp field is required for Druid input data.

i am not able to ingest csv file to druid even after adding timestamp field to input csv files.

I am submitting job using below command:

curl -X ‘POST’ -H ‘Content-Type:application/json’ -d @flight-index.json http://localhost:8090/druid/indexer/v1/task


i am sharing error log, input csv file and index.json file.

can anyone help me to solve this issue ?

flight-index.json (7.13 KB)

log.txt (242 KB)

t1.csv (151 Bytes)

Are you using a remote Hadoop cluster?

Rommel Garcia

Director, Field Engineering

I am using hortonworks sandbox 2.6.5 on virtual box.

I think you need to include “hasHeaderRow" : true,


“type” : “index”,

“spec” : {

"dataSchema" : {

  “dataSource" : "Test",

  "parser" : {

    "type" : "string",

    "parseSpec" : {

      "format" : "csv",

      "hasHeaderRow" : true,

      "dimensionsSpec" : {

        "dimensions" : [

Its failing on the first row.

Eric Graham

Solutions Engineer -** **Imply

**cell: **303-589-4581


Hi Eric,

still its not working. i am sharing the error log.

Thank you.

flight-index.json (1.36 KB)

log.txt (160 KB)


Your column header for the timestamp is time not timestamp.

Please try this -

“columns” : [“time”,“year”,“deptime”,“arrtime”],

“delimiter” : “,” ,

“timestampSpec” : {

“format” : “auto”,

“column" : “time”


Eric Graham

Solutions Engineer -** **Imply

**cell: **303-589-4581


already did this changes still same issue.

if i remove header than it successfully ingests csv file to druid.

Hi Jonathan,

May i know why timestamp field is required for Druid input data ? and what if input data do not have timestamp and want to ingest data to Druid ?

Thank you.