Trouble with loading batch ingestion .json task in Druid (JsonParseException: Unrecognized token)

270 views
Skip to first unread message

Miller Intel

unread,
Jul 13, 2017, 3:08:52 PM7/13/17
to Druid Development
I need to configure a JSON indexer task so that I can load my data. The task is copied and pasted into a .json file from a tutorial:

{
  "type" : "index",
  "dataSource" : "usgs",
  "granularitySpec" : {
    "type" : "uniform",
    "gran" : "MONTH",
    "intervals" : [ "1963-01-01/2013-12-31" ]
  },
  "aggregators" : [{
     "type" : "count",
     "name" : "count"
    }, {
     "type" : "doubleSum",
     "name" : "avgFlowCuFtsec",
     "fieldName" : "val"
  }],
  "firehose" : {
    "type" : "local",
    "baseDir" : "examples/usgs/",
    "filter" : "napa-flow-subset.tsv",
    "parser" : {
      "timestampSpec" : {
        "column" : "dates"
      },
      "data" : {
        "type" : "tsv",
        "columns" : ["staid","val","dates"],
        "dimensions" : ["staid","val"]
      }
    }
  }
}

But I'm having some trouble getting Druid to take it. I've tried the exact literal command specified in the tutorial and a few variations based on what I think is the correct port and path to the file. The .json file is sitting in the Druid directory, which is also the working directory of the terminal where I'm running this.

I tried:

curl -X 'POST' -H 'Content-Type:application/json' -d @examples/usgs/usgs_index_task.json localhost:8087/druid/indexer/v1/task

and

curl -X 'POST' -H 'Content-Type:application/json' -d @examples/usgs/usgs_index_task.json localhost:8090/druid/indexer/v1/task

and

curl -X 'POST' -H 'Content-Type:application/json' -d usgs_index_task.json localhost:8090/druid/indexer/v1/task

and

curl -X 'POST' -H 'Content-Type:application/json' -d @usgs_index_task.json localhost:8090/druid/indexer/v1/task

and many more variations.

but I'm getting errors like this:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 </title>
</head>
<body>
<h2>HTTP ERROR: 500</h2>
<p>Problem accessing /druid/indexer/v1/task. Reason:
<pre>    javax.servlet.ServletException: com.fasterxml.jackson.core.JsonParseException: Unrecognized token

'usgs_index_task': was expecting ('true', 'false' or 'null') at [Source: HttpInputOverHTTP@4a36c202[c=20,q=1,[0]=EOF,s=STREAM]; line: 1, column: 17]


or this:

{"error":"Instantiation of [simple type, class io.druid.indexing.common.task.IndexTask] value failed: null"}root@debian:~/drui

G

unread,
Aug 24, 2017, 3:52:00 PM8/24/17
to Druid Development
Hi, I'm also having this issue with my json query. Were you able to resolve yours.
Reply all
Reply to author
Forward
0 new messages