If Timestamp in millis then how to define intervals

I have data of following type,

{"time": "1468455413", "url": "/foo/bar", "user": "alice", "latencyMs": 32}
{"time": "1468455207", "url": "/", "user": "bob", "latencyMs": 11}
{"time": "1468456949", "url": "/foo/bar", "user": "bob", "latencyMs": 45}

I am defining the timestampSpec as follows :-

"timestampSpec": {
  "format": "millis",
  "column": "time"

What should be the interval in granularitySpec :-

“granularitySpec”: {
“type”: “uniform”,
“segmentGranularity”: “day”,
“queryGranularity”: “none”,
“intervals”: [“2016-07-10/2016-07-16”]

above interval fails with

Caused by: java.lang.RuntimeException: No buckets?? seems there is no data to index.
	at io.druid.indexer.IndexGeneratorJob.run(IndexGeneratorJob.java:172) ~[druid-indexing-hadoop-]
	at io.druid.indexer.JobHelper.runJobs(JobHelper.java:323) ~[druid-indexing-hadoop-]
	at io.druid.indexer.HadoopDruidIndexerJob.run(HadoopDruidIndexerJob.java:94) ~[druid-indexing-hadoop-]
	at io.druid.indexing.common.task.HadoopIndexTask$HadoopIndexGeneratorInnerProcessing.runTask(HadoopIndexTask.java:261) ~[druid-indexing-service-]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_71]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_71]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_71]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_71]
	at io.druid.indexing.common.task.HadoopTask.invokeForeignLoader(HadoopTask.java:201) ~[druid-indexing-service-]
	... 7 more

I also tried following interval :-

“dataSchema” : {
“dataSource” : “pageviews-1”,
“granularitySpec”: {
“type”: “uniform”,
“segmentGranularity”: “day”,
“queryGranularity”: “none”,
“intervals”: [“1468455200/1468456999”]

but I get following error,

File “bin/post-index-task”, line 110, in


File “bin/post-index-task”, line 99, in main

task_id = json.loads(post_task(args, read_task_file(args), submit_timeout_at))["task"]

File “bin/post-index-task”, line 34, in post_task


File “bin/post-index-task”, line 84, in raise_friendly_error

raise Exception("HTTP Error {0}: {1}, check overlord log for more details.\n{2}".format(e.code, e.reason, text))

Exception: HTTP Error 400: Bad Request, check overlord log for more details.

{“error”:“Invalid format: “1468455200” is malformed at “0” (through reference chain: java.util.ArrayList[0])”}

How to define interval for timestamp in millis ?

The TimestampSpec is for ingesting the data and defining how your timestamp in the data items looks like.
This could be for example a ISO-8601 Timestamp, Unix-Timestamp in Seconds or Milliseconds.

This has nothing to do with quering your data, because the Interval should be a ISO-8601 Timestamp. And the ISO-8601 descripes milliseconds written to HH:mm:ss.sss, meaning the digits after the period should be the milliseconds.

That’s for the second error.

The first error is because at the location you specified and with the interval you specified, there is no data in that interval.

I’d double check to make sure there is actually data from “intervals”: [“2016-07-10/2016-07-16”]