× Heads up!

Aqua Data Studio / nhilam

Follow
IDE for Relational Databases
×
slavakiev reported 2013-10-15T09:58:59Z  · SachinPrakash last modified 2013-11-06T19:21:06Z

Different format of FLATTEN_ARRAY when aliases used


Priority Low
Complexity Moderate
Component MongoSQL
Version 14.0

Tested in Aqua Data Studio 14.0.0-rc-44 Build #: 34314 on Ubuntu 12.04( Mongo DB 2.4.3)  and Windows XP ( Mongo DB 2.0.9).

It is link to closed ticket 9675. When data changed - same errors appear. 
 
drop collection baseball
go
INSERT INTO baseball
VALUES (
{
"teamName": "Cubs-2",
"city": "Chicago",
"valuation": 10,
"managerName": { "first": "John", "last": "Zimmer" },
"colors": [ "blue", "gray" ],
"stats":
[
{
"year": 1904,
"wins": 100,
"mostRbis": 1000,
"grade": "A",
"battingAvg": 0.300
},
{
"year": 1987,
"wins":80,
"mostRbis":200,
"grade":"A",
"battingAvg":0.267
}
]
} )
go
INSERT INTO baseball
VALUES (
{
"teamName": "Cubs",
"city": "Luis",
"valuation": 100,
"managerName": { "first": "Dale", "last": "Sveum" },
"colors": [ "blue", "green","third" ],
"stats":
[
{
"year": 2008,
"wins": 60
 
},
{
"year": 1997,
"wins":100
}
]
} )
go
INSERT INTO baseball
VALUES (
{
"teamName": "Cubs-2",
"city": "Chicago",
"valuation": 10,
"managerName": { "first": "John", "last": "Belamy" },
"colors": [ "black", "grey" ],
"stats":
[
{
"year": 1008,
"wins": 0
 
},
{
"year": 1965,
"wins":2
}
]
} )
go
insert into baseball(valuation,city,mangerName,stats,colors) values (null,null,null,null,null) 
go
select flatten_array stats from baseball group by stats
--only 1 column
go
select flatten_array stats as sts from baseball group by stats
--many columns
go
select flatten_array min(stats) from baseball 
go
select flatten_array min(stats) from baseball group by stats
go
select flatten_array stats from baseball
--one column 
go
select flatten_array stats as sts from baseball
--one column 
go
select flatten_array first(stats) from baseball 
go
select flatten_array distinct stats  from baseball
--1 column only
go
select flatten_array distinct stats as sts from baseball
--many columns
go
 

Issue #10444

Closed
Fixed
Resolved 2013-11-06T19:21:06Z
 
 
Completion
No due date
Fixed Build ADS 14.0.3-11 (mongo-jdbc 1.3.9)
No time estimate

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