From user:
When we turned on flatten_array, Aqua froze for a minute or two and then eventually ran out of memory and crashed. But as I said, the data we were querying had arrays nested within arrays, some of which had hundreds of elements, so without flatten_array it only returned a handful of rows, with flatten_array on, it probably would work out to tens or hundreds of thousands of records because it needed to compute the cartesian product of all of them.
I believe the show tree view and text view were both on, though those don’t appear to be the problem because when we ran the query without flatten array option, everything came back immediately and without issue.
Desired behavior: ADS does a memory check to see if it has enough RAM available as it is performing a FLATTEN_ARRAY operation. If not there isn't enough available RAM, display an error message and abort the operation.
151 KB
11 KB
72 KB
137 KB
194 KB
Hello Jenny,
Can you please suggest what needs to be done from driver side for this issue? It seems that this is ADS side implementation ?
Thanks.
The FLATTEN_ARRAY option is processed in the MongoJDBC Driver. Take a look at the FlattenableResultSet class. If flatteningType is FLATTEN_ARRAY, it'll expand the arrays.
The FLATTEN_ARRAY option is processed in the MongoJDBC Driver. Take a look at the FlattenableResultSet class. If flatteningType is FLATTEN_ARRAY, it'll expand the arrays.
Here is my observation :
I have created collection having name "test14242" which has single record with nested arrays inside. When I tried to run the queries on this collection using MongoJS(FLATTEN_ARRAY option is on) then it returned 793152 rows. screenshot.
Same thing happens when I run following query.
SELECT FLATTEN_ARRAY * FROM test14242
I think FlattenResultset is returning multiple results if there are more nested arrays in collection.
I have attached JSON which is used to create "test14242" collection.
We need to verify that, FalttenableResultset is returning correct results or not ? I am not sure but it seems this is a bug .
@Jenny,
How ADS sets FlattenArray option when we use MongoJS?
Thanks.
Here is my observation :
I have created collection having name "test14242" which has single record with nested arrays inside. When I tried to run the queries on this collection using MongoJS(FLATTEN_ARRAY option is on) then it returned 793152 rows. screenshot.
Same thing happens when I run following query.
SELECT FLATTEN_ARRAY * FROM test14242
I think FlattenResultset is returning multiple results if there are more nested arrays in collection.
I have attached JSON which is used to create "test14242" collection.
We need to verify that, FalttenableResultset is returning correct results or not ? I am not sure but it seems this is a bug .
@Jenny,
How ADS sets FlattenArray option when we use MongoJS?
Thanks.
See attachment MongoJS.png.
In the MongoJS Query Analyzer, there is the "FLATTEN_ARRAY for Grid Results" option in the toolbar. If it is selected, when we execute MongoJS statements, we submit "EVAL_ARRAY(js_statements)". If it is not selected, we submit "EVAL(js_statements)".
In the MongoJDBC Driver, the EVAL_ARRAY command flattens the arrays in the Grid result set.
See attachment MongoJS.png.
In the MongoJS Query Analyzer, there is the "FLATTEN_ARRAY for Grid Results" option in the toolbar. If it is selected, when we execute MongoJS statements, we submit "EVAL_ARRAY(js_statements)". If it is not selected, we submit "EVAL(js_statements)".
In the MongoJDBC Driver, the EVAL_ARRAY command flattens the arrays in the Grid result set.
We need to verify that, FalttenableResultset is returning correct results or not ? I am not sure but it seems this is a bug.
This is not a bug. All flatten records returned are correct.
Desired behavior: ADS does a memory check to see if it has enough RAM available as it is performing a FLATTEN_ARRAY operation. If not there isn't enough available RAM, display an error message and abort the operation.
As mentioned in issue, If there isn't enough memory available then ADS displays error. See screenshot.
This behaviour is already present in ADS. Please correct me if I am getting wrong.
If ADS has enough memory allocated then ADS works fine and displays all records in grid tab. screenshot
Thanks.
We need to verify that, FalttenableResultset is returning correct results or not ? I am not sure but it seems this is a bug.
This is not a bug. All flatten records returned are correct.
Desired behavior: ADS does a memory check to see if it has enough RAM available as it is performing a FLATTEN_ARRAY operation. If not there isn't enough available RAM, display an error message and abort the operation.
As mentioned in issue, If there isn't enough memory available then ADS displays error. See screenshot.
This behaviour is already present in ADS. Please correct me if I am getting wrong.
If ADS has enough memory allocated then ADS works fine and displays all records in grid tab. screenshot
Thanks.
@shilpa: pls have QA work on reproducing the issue. Once we have a scenario that reproduces the issue, dev can debug it further.
@shilpa: pls have QA work on reproducing the issue. Once we have a scenario that reproduces the issue, dev can debug it further.
@Laxdeep - Reproduce the issues and share detail steps for it.
Provide scenarios where we are able to reproduce it and when we cannot.
@Laxdeep - Reproduce the issues and share detail steps for it.
Provide scenarios where we are able to reproduce it and when we cannot.
@sachin sir, @jenny ma'am, @shilpa ma'am,
I have tested the flatten_array ON and flatten_array OFF option with the collection having records more than 18000 records with array in array fields in ADS-v17 and ADS-18-beta-2 & 3.
I have following observations for the tests (with default memory):
1. ADS hangs and goes in to "Non Responding" mode without generating any OutOfMemory pop up / error in View Log many times in Windows builds for ADS 17 & ADS 18.
2. The frequency of halting the ADS in Ubuntu builds are less. But the time required to execute the script is more in Ubuntu than Windows build.
3. The Grid result with "flatten_array ON" is not the only case for the halting of the ADS. Some times tree node also takes time to load the result and halts the ADS.
I have highlighted the test cases for above scenarios in the doc.
I am still working on the issue with extended memory of ADS.
@sachin sir, @jenny ma'am, @shilpa ma'am,
I have tested the flatten_array ON and flatten_array OFF option with the collection having records more than 18000 records with array in array fields in ADS-v17 and ADS-18-beta-2 & 3.
I have following observations for the tests (with default memory):
1. ADS hangs and goes in to "Non Responding" mode without generating any OutOfMemory pop up / error in View Log many times in Windows builds for ADS 17 & ADS 18.
2. The frequency of halting the ADS in Ubuntu builds are less. But the time required to execute the script is more in Ubuntu than Windows build.
3. The Grid result with "flatten_array ON" is not the only case for the halting of the ADS. Some times tree node also takes time to load the result and halts the ADS.
I have highlighted the test cases for above scenarios in the doc.
I am still working on the issue with extended memory of ADS.
Issue #14242 |
Verified |
Fixed |
Resolved |
Completion |
No due date |
No fixed build |
No time estimate |
1 issue link |
relates to #15532
Issue #15532MongoDB does not limit results by count |
Hello Jenny,
Can you please suggest what needs to be done from driver side for this issue? It seems that this is ADS side implementation ?
Thanks.