[SERVER-73517] Skip path lowering when converting ABT to EExpression in the stage builders Created: 01/Feb/23  Updated: 02/Mar/23  Resolved: 02/Mar/23

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

Type: Improvement Priority: Major - P3
Reporter: David Storch Assignee: Rui Liu
Resolution: Won't Do Votes: 0
Labels: pm2697-m4
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Sprint: QE 2023-02-20, QE 2023-03-06
Participants:
Story Points: 1

 Description   

This code appears to be extraneous. The stage builders don't construct ABTs which use the path model, and therefore the call into EvalPathLowering is unnecessary. We should remove it.



 Comments   
Comment by David Storch [ 02/Mar/23 ]

rui.liu@mongodb.com I see, thanks for looking into it. Yeah, given that the path lowering step is actually needed in the case of ColumnIndexScanNode I don't think there is a strong reason to do this ticket right now. I'll close it as "Won't Do".

Comment by Rui Liu [ 02/Mar/23 ]

Ok it seems that the reason is in column scan stage builder, we're using optimizer::FieldMapBuilder, which generates ABT nodes like "PathKeep" that needs to be handled by the linked code in the description. cc david.storch@mongodb.com Are you happy to close this issue?

Comment by Alberto Massari [ 01/Feb/23 ]

It seems it is still needed: this query is hitting nodes in the ABT tree that are not handled by the conversion to EExpression

[js_test:and_or_nested] uncaught exception: Error: error: {
[js_test:and_or_nested] 	"ok" : 0,
[js_test:and_or_nested] 	"errmsg" : "ABT expression lowering encountered operator which cannot be directly lowered to an SBE expression.",
[js_test:and_or_nested] 	"code" : 6624237,
[js_test:and_or_nested] 	"codeName" : "Location6624237",
[js_test:and_or_nested] 	"$clusterTime" : {
[js_test:and_or_nested] 		"clusterTime" : Timestamp(1675265199, 14),
[js_test:and_or_nested] 		"signature" : {
[js_test:and_or_nested] 			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
[js_test:and_or_nested] 			"keyId" : NumberLong(0)
[js_test:and_or_nested] 		}
[js_test:and_or_nested] 	},
[js_test:and_or_nested] 	"operationTime" : Timestamp(1675265199, 14)
[js_test:and_or_nested] } :
[js_test:and_or_nested] _getErrorWithCode@src/mongo/shell/utils.js:24:13
[js_test:and_or_nested] DBCommandCursor@src/mongo/shell/query.js:644:15
[js_test:and_or_nested] DBQuery.prototype._exec@src/mongo/shell/query.js:124:28
[js_test:and_or_nested] DBQuery.prototype.hasNext@src/mongo/shell/query.js:242:10
[j1:prim] | 2023-02-01T15:26:39.183+00:00 I  NETWORK  22944   [conn51] "Connection ended","attr":{"remote":"127.0.0.1:55378","uuid":{"uuid":{"$uuid":"be677012-063d-4445-af29-b877801c48da"}},"connectionId":51,"connectionCount":1}
[js_test:and_or_nested] DBQuery.prototype.toArray@src/mongo/shell/query.js:295:17
[js_test:and_or_nested] @jstests\core\query\and\and_or_nested.js:39:80
[js_test:and_or_nested] runWithDifferentIndexes@jstests\core\query\and\and_or_nested.js:17:9
[js_test:and_or_nested] @jstests\core\query\and\and_or_nested.js:38:24
[js_test:and_or_nested] @jstests\core\query\and\and_or_nested.js:68:3
[js_test:and_or_nested] failed to load: jstests\core\query\and\and_or_nested.js

[js_test:find4] uncaught exception: Error: error: {
[js_test:find4] 	"ok" : 0,
[js_test:find4] 	"errmsg" : "ABT expression lowering encountered operator which cannot be directly lowered to an SBE expression.",
[js_test:find4] 	"code" : 6624237,
[j3:prim] | 2023-02-01T15:26:49.007+00:00 I  NETWORK  22944   [conn66] "Connection ended","attr":{"remote":"127.0.0.1:55476","uuid":{"uuid":{"$uuid":"28bc461d-8b83-4aae-b6c7-2177d1a5d345"}},"connectionId":66,"connectionCount":1}
[js_test:find4] 	"codeName" : "Location6624237",
[js_test:find4] 	"$clusterTime" : {
[js_test:find4] 		"clusterTime" : Timestamp(1675265208, 2),
[js_test:find4] 		"signature" : {
[js_test:find4] 			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
[js_test:find4] 			"keyId" : NumberLong(0)
[js_test:find4] 		}
[js_test:find4] 	},
[js_test:find4] 	"operationTime" : Timestamp(1675265208, 2)
[js_test:find4] } :
[js_test:find4] _getErrorWithCode@src/mongo/shell/utils.js:24:13
[js_test:find4] DBCommandCursor@src/mongo/shell/query.js:644:15
[js_test:find4] DBQuery.prototype._exec@src/mongo/shell/query.js:124:28
[js_test:find4] DBQuery.prototype.hasNext@src/mongo/shell/query.js:242:10
[js_test:find4] DBCollection.prototype.findOne@src/mongo/shell/collection.js:267:17
[js_test:find4] @jstests\core\query\find\find4.js:14:10
[js_test:find4] @jstests\core\query\find\find4.js:42:2
[js_test:find4] failed to load: jstests\core\query\find\find4.js

Generated at Thu Feb 08 06:24:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.