Tranquility fails to start with JSON Flatten Spec

Hi,
I
am using Tranquility to push real-time streams and for simple multi-line JSON it is working as expected. I need to push multi-line nested JSON objects and I have implemented using JSON Flatten Spec as in this example. Tranquility starts fine with just path fields however, it fails to start `when root type field is specified. Stacktrace below.
java.lang.IllegalArgumentException: Instantiation of [simple type, class io.druid.data.input.impl.StringInputRowParser] value failed: json can not be null or empty
at com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:2774)
at com.fasterxml.jackson.databind.ObjectMapper.convertValue(ObjectMapper.java:2700)
at io.druid.segment.indexing.DataSchema.getParser(DataSchema.java:101)
at com.metamx.tranquility.druid.DruidBeams$.fromConfigInternal(DruidBeams.scala:293)
at com.metamx.tranquility.druid.DruidBeams$.fromConfig(DruidBeams.scala:199)
at com.metamx.tranquility.server.http.ServerMain$$anonfun$2.apply(ServerMain.scala:118)
at com.metamx.tranquility.server.http.ServerMain$$anonfun$2.apply(ServerMain.scala:98)
at com.metamx.common.scala.collection.package$MapLikeOps$$anonfun$strictMapValues$1.apply(package.scala:143)
at com.metamx.common.scala.collection.package$MapLikeOps$$anonfun$strictMapValues$1.apply(package.scala:143)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
at scala.collection.immutable.Map$Map1.foreach(Map.scala:116)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
at scala.collection.AbstractTraversable.map(Traversable.scala:104)
at com.metamx.common.scala.collection.package$MapLikeOps.strictMapValues(package.scala:143)
at com.metamx.tranquility.server.http.ServerMain$.createServlet(ServerMain.scala:98)
at com.metamx.tranquility.server.http.ServerMain$.main(ServerMain.scala:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.twitter.app.App$$anonfun$nonExitingMain$3.apply(App.scala:168)
at com.twitter.app.App$$anonfun$nonExitingMain$3.apply(App.scala:167)
at scala.Option.foreach(Option.scala:257)
at com.twitter.app.App$class.nonExitingMain(App.scala:167)
at com.metamx.tranquility.server.http.ServerMain$.nonExitingMain(ServerMain.scala:49)
at com.twitter.app.App$class.main(App.scala:133)
at com.metamx.tranquility.server.http.ServerMain$.main(ServerMain.scala:49)
at com.metamx.tranquility.distribution.DistributionMain$.main(DistributionMain.scala:34)
at com.metamx.tranquility.distribution.DistributionMain.main(DistributionMain.scala)
Caused
by: com.fasterxml.jackson.databind.JsonMappingException: Instantiation of [simple type, class io.druid.data.input.impl.StringInputRowParser] value failed: json can not be null or empty
at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.wrapException(StdValueInstantiator.java:405)
at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createFromObjectWith(StdValueInstantiator.java:234)
at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:167)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:398)

at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1064)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:264)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:156)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:126)

at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer._deserializeTypedForId(AsPropertyTypeDeserializer.java:113)

at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer.deserializeTypedFromObject(AsPropertyTypeDeserializer.java:84)
at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserializeWithType(AbstractDeserializer.java:132)
at com.fasterxml.jackson.databind.deser.impl.TypeWrappedDeserializer.deserialize(TypeWrappedDeserializer.java:41)
at com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:2769)
… 29 more
Caused by: java.lang.IllegalArgumentException: json can not be null or empty
at com.jayway.jsonpath.internal.Utils.notEmpty(Utils.java:383)
at com.jayway.jsonpath.JsonPath.compile(JsonPath.java:465)
at com.metamx.common.parsers.JSONPathParser.generateFieldPaths(JSONPathParser.java:139)
at com.metamx.common.parsers.JSONPathParser.(JSONPathParser.java:64)
at io.druid.data.input.impl.JSONParseSpec.makeParser(JSONParseSpec.java:72)
at io.druid.data.input.impl.StringInputRowParser.(StringInputRowParser.java:56)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at com.fasterxml.jackson.databind.introspect.AnnotatedConstructor.call(AnnotatedConstructor.java:125)
at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createFromObjectWith(StdValueInstantiator.java:230)
… 40 more

I’m experiencing the same issue. Were you able to resolve it??. If u did, Please let me know how u fixed it.

Hi all,

I believe Tranquility does not yet support flattenSpecs. The Kafka indexing service built-in to Druid does support this, I’d suggest trying that instead: http://druid.io/docs/latest/development/extensions-core/kafka-ingestion.html