Tushar, this is a duplicate question. Please see the other one for a response, and please try not to double post if possible, thanks!
On Wed, 8 May 2019 at 12:06, tushar pandit <tushar.pandi...@gmail.com> wrote: > Hi, > > I am trying to call function fetchFromDruid > > def main(args: Array[String]): Unit = { > val res = fetchFromDruid() > > // res comes as null here > } > > def fetchFromDruid(): GroupByResponse { > implicit val executionContext = ExecutionContext.Implicits.global > val client = DruidClient("http://localhost:8082") > > val query = GroupByQuery( > source = "wikipedia", > interval = new Interval(new DateTime().minusMonths(60), new DateTime()), > dimensions = Seq("countryName"), > descending = true, > granularity = Granularity.All, > aggregate = Seq( > DSL.count("row_count") > ), > postAggregate = Seq( > ), > limit = Some(100) > ) > > client(query).onComplete { > case Success(resp) => > resp.data.foreach { row => > println(row) > } > > *return resp* > println("none") > //System.exit(0) > case Failure(ex) => > ex.printStackTrace() > > return null > //System.exit(0) > } > } > > > But somehow I am not able to return the response to the caller; i.e the main > function. What could be the issue? > > > Thanks, > > Tushar > > -- > You received this message because you are subscribed to the Google Groups > "scala-functional" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scala-functional+unsubscr...@googlegroups.com. > To view this discussion on the web, visit > https://groups.google.com/d/msgid/scala-functional/e420e90d-a7f4-45d9-b87e-cbaf2e31da58%40googlegroups.com > <https://groups.google.com/d/msgid/scala-functional/e420e90d-a7f4-45d9-b87e-cbaf2e31da58%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "scala-functional" group. To unsubscribe from this group and stop receiving emails from it, send an email to scala-functional+unsubscr...@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/scala-functional/CAN3nywAL8bGPAMxaPpdToJX9TLhCEFQpspJPHF6MzbUDr8dBOg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.