Select query not working with timestamp in millis format

For time stamp I’m using millis as the specification for Tranquility based injection.

new TimestampSpec(“timestamp”, “millis”);

Other queries working fine but when I try to run select query getting below error. It looks like timestamp as milliseconds attempted to parse with DateTime, it is throwing this error.

Is it a bug, or my usage error? Is there any workaround other than changing my input date format?

2015-04-22T20:52:47,321 ERROR [select_integration1_[2015-04-22T00:00:00.000Z/2015-04-22T20:51:25.746Z]] io.druid.query.ChainedExecutionQueryRunner - Exception with one of the sequences!
java.lang.IllegalArgumentException: Invalid format: "1429735285805" is malformed at "5805"
	at org.joda.time.format.DateTimeParserBucket.doParseMillis(DateTimeParserBucket.java:187) ~[joda-time-2.6.jar:2.6]
	at org.joda.time.format.DateTimeFormatter.parseMillis(DateTimeFormatter.java:780) ~[joda-time-2.6.jar:2.6]
	at org.joda.time.convert.StringConverter.getInstantMillis(StringConverter.java:65) ~[joda-time-2.6.jar:2.6]
	at org.joda.time.base.BaseDateTime.<init>(BaseDateTime.java:175) ~[joda-time-2.6.jar:2.6]
	at org.joda.time.DateTime.<init>(DateTime.java:257) ~[joda-time-2.6.jar:2.6]
	at io.druid.query.select.EventHolder.getTimestamp(EventHolder.java:54) ~[druid-processing-0.7.0.jar:0.7.0]
	at io.druid.query.select.SelectResultValueBuilder$1.compare(SelectResultValueBuilder.java:40) ~[druid-processing-0.7.0.jar:0.7.0]
	at io.druid.query.select.SelectResultValueBuilder$1.compare(SelectResultValueBuilder.java:36) ~[druid-processing-0.7.0.jar:0.7.0]
	at com.google.common.collect.ComparatorOrdering.compare(ComparatorOrdering.java:38) ~[guava-16.0.1.jar:?]
	at com.google.common.collect.ReverseOrdering.compare(ReverseOrdering.java:38) ~[guava-16.0.1.jar:?]
	at com.google.common.collect.MinMaxPriorityQueue$Heap.crossOverUp(MinMaxPriorityQueue.java:633) ~[guava-16.0.1.jar:?]
	at com.google.common.collect.MinMaxPriorityQueue$Heap.bubbleUp(MinMaxPriorityQueue.java:537) ~[guava-16.0.1.jar:?]
	at com.google.common.collect.MinMaxPriorityQueue.offer(MinMaxPriorityQueue.java:280) ~[guava-16.0.1.jar:?]
	at com.google.common.collect.MinMaxPriorityQueue.add(MinMaxPriorityQueue.java:252) ~[guava-16.0.1.jar:?]
	at io.druid.query.select.SelectResultValueBuilder.addEntry(SelectResultValueBuilder.java:72) ~[druid-processing-0.7.0.jar:0.7.0]
	at io.druid.query.select.SelectQueryEngine$1.apply(SelectQueryEngine.java:147) ~[druid-processing-0.7.0.jar:0.7.0]
	at io.druid.query.select.SelectQueryEngine$1.apply(SelectQueryEngine.java:75) ~[druid-processing-0.7.0.jar:0.7.0]
	at io.druid.query.QueryRunnerHelper$1.apply(QueryRunnerHelper.java:74) ~[druid-processing-0.7.0.jar:0.7.0]
	at io.druid.query.QueryRunnerHelper$1.apply(QueryRunnerHelper.java:69) ~[druid-processing-0.7.0.jar:0.7.0]
	at com.metamx.common.guava.MappingAccumulator.accumulate(MappingAccumulator.java:39) ~[java-util-0.26.14.jar:?]
	at com.metamx.common.guava.MappingAccumulator.accumulate(MappingAccumulator.java:39) ~[java-util-0.26.14.jar:?]
	at com.metamx.common.guava.YieldingAccumulators$1.accumulate(YieldingAccumulators.java:32) ~[java-util-0.26.14.jar:?]
	at com.metamx.common.guava.BaseSequence.makeYielder(BaseSequence.java:104) ~[java-util-0.26.14.jar:?]
	at com.metamx.common.guava.BaseSequence.toYielder(BaseSequence.java:81) ~[java-util-0.26.14.jar:?]
	at com.metamx.common.guava.BaseSequence.accumulate(BaseSequence.java:67) ~[java-util-0.26.14.jar:?]
	at com.metamx.common.guava.MappedSequence.accumulate(MappedSequence.java:40) ~[java-util-0.26.14.jar:?]
	at com.metamx.common.guava.MappedSequence.accumulate(MappedSequence.java:40) ~[java-util-0.26.14.jar:?]
	at com.metamx.common.guava.FilteredSequence.accumulate(FilteredSequence.java:42) ~[java-util-0.26.14.jar:?]
	at com.metamx.common.guava.Sequences.toList(Sequences.java:113) ~[java-util-0.26.14.jar:?]
	at io.druid.query.ChainedExecutionQueryRunner$1$1$1.call(ChainedExecutionQueryRunner.java:130) [druid-processing-0.7.0.jar:0.7.0]
	at io.druid.query.ChainedExecutionQueryRunner$1$1$1.call(ChainedExecutionQueryRunner.java:120) [druid-processing-0.7.0.jar:0.7.0]
	at java.util.concurrent.FutureTask.run(FutureTask.java:262) [?:1.7.0_75]
	at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297) [guava-16.0.1.jar:?]
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:132) [?:1.7.0_75]
	at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:58) [guava-16.0.1.jar:?]
	at io.druid.query.ChainedExecutionQueryRunner$1$1.apply(ChainedExecutionQueryRunner.java:118) [druid-processing-0.7.0.jar:0.7.0]
	at io.druid.query.ChainedExecutionQueryRunner$1$1.apply(ChainedExecutionQueryRunner.java:110) [druid-processing-0.7.0.jar:0.7.0]
	at com.google.common.collect.Iterators$8.transform(Iterators.java:794) [guava-16.0.1.jar:?]
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48) [guava-16.0.1.jar:?]
	at com.google.common.collect.Iterators.addAll(Iterators.java:357) [guava-16.0.1.jar:?]
	at com.google.common.collect.Lists.newArrayList(Lists.java:147) [guava-16.0.1.jar:?]
	at com.google.common.collect.Lists.newArrayList(Lists.java:129) [guava-16.0.1.jar:?]
	at io.druid.query.ChainedExecutionQueryRunner$1.make(ChainedExecutionQueryRunner.java:105) [druid-processing-0.7.0.jar:0.7.0]
	at com.metamx.common.guava.BaseSequence.toYielder(BaseSequence.java:78) [java-util-0.26.14.jar:?]
	at com.metamx.common.guava.BaseSequence.accumulate(BaseSequence.java:67) [java-util-0.26.14.jar:?]
	at io.druid.query.MetricsEmittingQueryRunner$1.accumulate(MetricsEmittingQueryRunner.java:102) [druid-processing-0.7.0.jar:0.7.0]
	at io.druid.query.spec.SpecificSegmentQueryRunner$2$1.call(SpecificSegmentQueryRunner.java:85) [druid-processing-0.7.0.jar:0.7.0]
	at io.druid.query.spec.SpecificSegmentQueryRunner.doNamed(SpecificSegmentQueryRunner.java:169) [druid-processing-0.7.0.jar:0.7.0]
	at io.druid.query.spec.SpecificSegmentQueryRunner.access$400(SpecificSegmentQueryRunner.java:39) [druid-processing-0.7.0.jar:0.7.0]
	at io.druid.query.spec.SpecificSegmentQueryRunner$2.doItNamed(SpecificSegmentQueryRunner.java:160) [druid-processing-0.7.0.jar:0.7.0]
	at io.druid.query.spec.SpecificSegmentQueryRunner$2.accumulate(SpecificSegmentQueryRunner.java:78) [druid-processing-0.7.0.jar:0.7.0]
	at com.metamx.common.guava.Sequences.toList(Sequences.java:113) [java-util-0.26.14.jar:?]
	at io.druid.query.ChainedExecutionQueryRunner$1$1$1.call(ChainedExecutionQueryRunner.java:130) [druid-processing-0.7.0.jar:0.7.0]
	at io.druid.query.ChainedExecutionQueryRunner$1$1$1.call(ChainedExecutionQueryRunner.java:120) [druid-processing-0.7.0.jar:0.7.0]
	at java.util.concurrent.FutureTask.run(FutureTask.java:262) [?:1.7.0_75]
	at io.druid.query.PrioritizedExecutorService$PrioritizedListenableFutureTask.run(PrioritizedExecutorService.java:202) [druid-processing-0.7.0.jar:0.7.0]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [?:1.7.0_75]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [?:1.7.0_75]
	at java.lang.Thread.run(Thread.java:745) [?:1.7.0_75]

Hi Satyanarayana,

I believe this is a bug with the select query. Do you mind submitting a unit test that can help verify and catch the bug?

The main test code is available at:

Thanks,

FJ

Hi FJ,

Created https://github.com/druid-io/druid/issues/1332

Regards,

-SaTyA-

Thanks for the issue. Will try to have it fixed early next week.