hello ,

i m using apache calcite mongodb adapter but aggregations , group by and
sort are not working with mongodb adapter.

select count(distinct _MAP['job']) from \"test\".\"banking\""

select * from \"test\".\"banking\" order by _MAP['job']"

select * from \"test\".\"banking\" group by _MAP['job']"

didn't work for me.


Exception in thread "main" java.sql.SQLException: Error while executing SQL
"select count(distinct _MAP['job']) from "test"."banking" ": While running
MongoDB query [{$project: {'$f0': '$job'}},

{$group: {_id: '$_0'}},

{$project: {_0: '$_id'}},

{$group: {_id: {}, 'EXPR$0': {$sum: {$cond: [ {$eq: ['_0', null]}, 0,
1]}}}}]

at org.apache.calcite.avatica.Helper.createException(Helper.java:56)

at org.apache.calcite.avatica.Helper.createException(Helper.java:41)

at org.apache.calcite.avatica.AvaticaStatement.executeInternal(
AvaticaStatement.java:163)

at org.apache.calcite.avatica.AvaticaStatement.executeQuery(
AvaticaStatement.java:227)

at

at test.applications.calcite.test.test1querycalcite$delayedInit$body.apply(
test1querycalcite.scala:29)

at scala.Function0$class.apply$mcV$sp(Function0.scala:34)

at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)

at scala.App$$anonfun$main$1.apply(App.scala:76)

at scala.App$$anonfun$main$1.apply(App.scala:76)

at scala.collection.immutable.List.foreach(List.scala:381)

at scala.collection.generic.TraversableForwarder$class.foreach(
TraversableForwarder.scala:35)

at scala.App$class.main(App.scala:76)



am i missing something?

yours sincerely,
asma

Reply via email to