[SERVER-32859] Improve error message when sorting parallel arrays Created: 23/Jan/18  Updated: 30/Oct/23  Resolved: 04/Mar/18

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 3.7.3

Type: Task Priority: Trivial - P5
Reporter: Kelsey Schubert Assignee: Charlie Swanson
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-32839 Aggregation sorts on multiple array f... Closed
Backwards Compatibility: Fully Compatible
Participants:

 Description   

The current error message states:

2018-01-22T13:38:07.220-0500 E QUERY    [thread1] Error: command failed: {
	"ok" : 0,
	"errmsg" : "cannot sort with keys that are parallel arrays",
	"code" : 2,
	"codeName" : "BadValue"
} : aggregate failed :

I would suggest removing the term parallel array for something more user-friendly, like "cannot sort on multiple fields containing arrays"



 Comments   
Comment by Githook User [ 04/Mar/18 ]

Author:

{'email': 'dandanlin.l@gmail.com', 'name': '“Dandan', 'username': 'Dandanlin0702'}

Message: SERVER-32859 Improve error message when sorting parallel arrays

Closes #1218

Signed-off-by: Charlie Swanson <charlie.swanson@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/1cf874bd73ebb13f753840bb6eea63207076c438

Comment by Charlie Swanson [ 04/Mar/18 ]

Assigning to myself to review & merge, since I'm working with Dandan as part of a CUNY course.

Comment by David Storch [ 22/Feb/18 ]

kelsey.schubert, I couldn't come up with better wording. The difficulty is that sorting on nested arrays is fine (e.g. sort({"a.b": 1}) where both "a" and "a.b" are arrays) and sorting on multiple subfields of the same array is also fine (e.g. sort({"a.b": 1, "a.c": 1}) where "a" is an array). This complexity is hard to capture in a short error message. Anyway, LGTM to merge, unless you can think of a better message.

Comment by Kelsey Schubert [ 22/Feb/18 ]

david.storch, we have an open pull request to change the logging

from "cannot sort with keys that are parallel arrays"
to "cannot sort on multiple fields containing arrays"

If you agree with the wording, let me know and I'll go through the motions get it merged into master. Otherwise would please you suggest a preferable logging message?

Thanks,
Kelsey

Generated at Thu Feb 08 04:31:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.