==== VARIATION: $project then $match ====
-- INPUTS:
pipeline: [{$project: {s: {$add: ['$a', '$b']}, c: 1}}, {$match: {$or: [{c: 2}, {s: {$gte: 10}}]}}]
metadata: 
	number of partitions: 1
	scan definitions: 
		collection: 
			options: 
			distribution and paths: 
				distribution type: Centralized
				distribution paths: 
			indexes: 
			collection exists: 1
			CE type: -1

-- OUTPUT:
Root [{combinedProjection_0}]
Filter []
|   EvalFilter []
|   |   Variable [combinedProjection_0]
|   PathComposeA []
|   |   PathGet [c]
|   |   PathTraverse [1]
|   |   PathCompare [Eq]
|   |   Const [2]
|   PathGet [s]
|   PathTraverse [1]
|   PathComposeM []
|   |   PathCompare [Lt]
|   |   Const [""]
|   PathCompare [Gte]
|   Const [10]
Evaluation [{combinedProjection_0}]
|   EvalPath []
|   |   Variable [scan_0]
|   PathComposeM []
|   |   PathDefault []
|   |   Const [{}]
|   PathComposeM []
|   |   PathField [s]
|   |   PathConstant []
|   |   Variable [projGetPath_0]
|   PathKeep [_id, c, s]
Evaluation [{projGetPath_0}]
|   BinaryOp [Add]
|   |   EvalPath []
|   |   |   Variable [scan_0]
|   |   PathGet [b]
|   |   PathIdentity []
|   EvalPath []
|   |   Variable [scan_0]
|   PathGet [a]
|   PathIdentity []
Scan [collection, {scan_0}]


==== VARIATION: basic $group ====
-- INPUTS:
pipeline: [{$group: {_id: '$a.b', s: {$sum: {$multiply: ['$b', '$c']}}}}]
metadata: 
	number of partitions: 1
	scan definitions: 
		collection: 
			options: 
			distribution and paths: 
				distribution type: Centralized
				distribution paths: 
			indexes: 
			collection exists: 1
			CE type: -1

-- OUTPUT:
Root [{agg_project_0}]
Evaluation [{agg_project_0}]
|   EvalPath []
|   |   Const [{}]
|   PathComposeM []
|   |   PathField [s]
|   |   PathConstant []
|   |   Variable [field_agg_0]
|   PathField [_id]
|   PathConstant []
|   Variable [groupByProj_0]
GroupBy [{groupByProj_0}]
|   aggregations: 
|       [field_agg_0]
|           FunctionCall [$sum]
|           Variable [groupByInputProj_0]
Evaluation [{groupByInputProj_0}]
|   BinaryOp [Mult]
|   |   EvalPath []
|   |   |   Variable [scan_0]
|   |   PathGet [c]
|   |   PathIdentity []
|   EvalPath []
|   |   Variable [scan_0]
|   PathGet [b]
|   PathIdentity []
Evaluation [{groupByProj_0}]
|   EvalPath []
|   |   Variable [scan_0]
|   PathGet [a]
|   PathTraverse [inf]
|   PathGet [b]
|   PathIdentity []
Scan [collection, {scan_0}]


==== VARIATION: $group local global ====
-- INPUTS:
pipeline: [{$group: {_id: '$a', c: {$sum: '$b'}}}]
metadata: 
	number of partitions: 1
	scan definitions: 
		collection: 
			options: 
			distribution and paths: 
				distribution type: Centralized
				distribution paths: 
			indexes: 
			collection exists: 1
			CE type: -1

-- OUTPUT:
Root [{agg_project_0}]
Evaluation [{agg_project_0}]
|   EvalPath []
|   |   Const [{}]
|   PathComposeM []
|   |   PathField [c]
|   |   PathConstant []
|   |   Variable [field_agg_0]
|   PathField [_id]
|   PathConstant []
|   Variable [groupByProj_0]
GroupBy [{groupByProj_0}]
|   aggregations: 
|       [field_agg_0]
|           FunctionCall [$sum]
|           Variable [groupByInputProj_0]
Evaluation [{groupByInputProj_0}]
|   EvalPath []
|   |   Variable [scan_0]
|   PathGet [b]
|   PathIdentity []
Evaluation [{groupByProj_0}]
|   EvalPath []
|   |   Variable [scan_0]
|   PathGet [a]
|   PathIdentity []
Scan [collection, {scan_0}]


==== VARIATION: $group with complex _id ====
-- INPUTS:
pipeline: [{$group: {_id: {'isin': '$isin', 'year': '$year'}, 'count': {$sum: 1}, 'open': {$first: '$$ROOT'}}}]
metadata: 
	number of partitions: 1
	scan definitions: 
		collection: 
			options: 
			distribution and paths: 
				distribution type: Centralized
				distribution paths: 
			indexes: 
			collection exists: 1
			CE type: -1

-- OUTPUT:
Root [{agg_project_0}]
Evaluation [{agg_project_0}]
|   EvalPath []
|   |   Const [{}]
|   PathComposeM []
|   |   PathField [open]
|   |   PathConstant []
|   |   Variable [field_agg_1]
|   PathComposeM []
|   |   PathField [count]
|   |   PathConstant []
|   |   Variable [field_agg_0]
|   PathField [_id]
|   PathComposeM []
|   |   PathField [year]
|   |   PathConstant []
|   |   Variable [groupByProj_1]
|   PathField [isin]
|   PathConstant []
|   Variable [groupByProj_0]
GroupBy [{groupByProj_0, groupByProj_1}]
|   aggregations: 
|       [field_agg_0]
|           FunctionCall [$sum]
|           Const [1]
|       [field_agg_1]
|           FunctionCall [$first]
|           Variable [scan_0]
Evaluation [{groupByProj_1}]
|   EvalPath []
|   |   Variable [scan_0]
|   PathGet [year]
|   PathIdentity []
Evaluation [{groupByProj_0}]
|   EvalPath []
|   |   Variable [scan_0]
|   PathGet [isin]
|   PathIdentity []
Scan [collection, {scan_0}]


