× Heads up!

Aqua Data Studio / nhilam

Follow
IDE for Relational Databases
×
slavakiev reported 2013-07-24T12:41:51Z  · last modified 2013-08-02T19:26:33Z

Wrong results due to automatical adding FIELD_EXISTS( ) for the all aggregation functions


Priority Major
Complexity Unknown
Component MongoSQL
Version 14.0

Tested Aqua Data Studio Aqua Data Studio 14.0.0-beta-68 Build #: 33238 on Ubuntu 12.04( Mongo DB 2.4.3)  and Windows XP ( Mongo DB 2.0.9).

Currently program automatically adds FIELD_EXISTS( ) for the all aggregation functions and  this causes unpredictable results. This is not needed at all as MongoDB always applies aggregation functions only to the records with existing fields. E.g. description of $min command from the documentation:

"...the $min (page 277) operator only considers the non-null and the

non-missing values for the field."

See next scriptset:

insert into nullcoll(a,b) values (1,1)

go

insert into nullcoll(a,b) values (null,2)

go

insert into nullcoll(b) values (3)
 
go
 
select sum(a),sum(b) from nullcoll  
go
--sum(a)      sum(b)
-----------       ---------
--1                 3 
 
--You can see that sum(b) = 3 . But it should be 6
 
select push(a),push(b) from nullcoll  
go
--push(a)      push(b)
-----------       ---------
--[1,null]      [1,2] 
 
You can see that element [3] in the push(b) is absent
 
 

Issue #9652

Closed
Fixed
Resolved 2013-07-30T14:19:09Z
 
 
Completion
No due date
Fixed Build ADS 14.0.0-beta-76 (mongo-jdbc 1.2.6)
No time estimate

About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017