Tushar, this seems to be an issue with whatever Druid is. This mailing list
is for questions about Functional Programming in Scala, both in general and
more specifically the book with that title. If you ask your question in a
more relevant forum somebody may be able to provide you with an answer.

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/8bc53b5e-729d-497d-89bd-ab2568674cc7%40googlegroups.com
> <https://groups.google.com/d/msgid/scala-functional/8bc53b5e-729d-497d-89bd-ab2568674cc7%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/CAN3nywAbk_%3DMsmsY0gOQc80WQFL5keW--hengy7rB5y9O8SKoQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to