# Golden test output of ABTPlanGeneration/LowerGroupByNode

==== VARIATION: GroupByNode one output with type Complete ====
-- INPUT:
GroupBy [{key1, key2}]
|   aggregations: 
|       [outFunc1]
|           FunctionCall [$sum]
|           Variable [aggInput1]
Evaluation [{aggInput1}]
|   FunctionCall [getField]
|   |   Const ["c"]
|   Variable [scan0]
Evaluation [{key2}]
|   FunctionCall [getField]
|   |   Const ["b"]
|   Variable [scan0]
Evaluation [{key1}]
|   FunctionCall [getField]
|   |   Const ["a"]
|   Variable [scan0]
PhysicalScan [{'<root>': scan0}, collName]

-- OUTPUT:
[4] group [s2, s3] [s5 = sum(s4)] 
[1] project [s2 = getField(s1, "a"), s3 = getField(s1, "b"), s4 = getField(s1, "c")] 
[0] scan s1 none none none none none none none lowPriority [] @"<collUUID>" true false 

==== VARIATION: GroupByNode multiple outputs with type Complete ====
-- INPUT:
GroupBy [{key1, key2}]
|   aggregations: 
|       [outFunc1]
|           FunctionCall [$sum]
|           Variable [aggInput1]
|       [outFunc2]
|           FunctionCall [$sum]
|           Variable [aggInput2]
Evaluation [{aggInput2}]
|   FunctionCall [getField]
|   |   Const ["d"]
|   Variable [scan0]
Evaluation [{aggInput1}]
|   FunctionCall [getField]
|   |   Const ["c"]
|   Variable [scan0]
Evaluation [{key2}]
|   FunctionCall [getField]
|   |   Const ["b"]
|   Variable [scan0]
Evaluation [{key1}]
|   FunctionCall [getField]
|   |   Const ["a"]
|   Variable [scan0]
PhysicalScan [{'<root>': scan0}, collName]

-- OUTPUT:
[5] group [s2, s3] [s6 = sum(s4), s7 = sum(s5)] 
[1] project [s2 = getField(s1, "a"), s3 = getField(s1, "b"), s4 = getField(s1, "c"), s5 = getField(s1, "d")] 
[0] scan s1 none none none none none none none lowPriority [] @"<collUUID>" true false 

==== VARIATION: GroupByNode one output with type Local ====
-- INPUT:
GroupBy [{key1, key2}, Local]
|   aggregations: 
|       [outFunc1]
|           FunctionCall [$sum]
|           Variable [aggInput1]
Evaluation [{aggInput1}]
|   FunctionCall [getField]
|   |   Const ["c"]
|   Variable [scan0]
Evaluation [{key2}]
|   FunctionCall [getField]
|   |   Const ["b"]
|   Variable [scan0]
Evaluation [{key1}]
|   FunctionCall [getField]
|   |   Const ["a"]
|   Variable [scan0]
PhysicalScan [{'<root>': scan0}, collName]

-- OUTPUT:
[4] group [s2, s3] [s5 = sum(s4)] 
[1] project [s2 = getField(s1, "a"), s3 = getField(s1, "b"), s4 = getField(s1, "c")] 
[0] scan s1 none none none none none none none lowPriority [] @"<collUUID>" true false 

==== VARIATION: GroupByNode multiple outputs with type Local ====
-- INPUT:
GroupBy [{key1, key2}, Local]
|   aggregations: 
|       [outFunc1]
|           FunctionCall [$sum]
|           Variable [aggInput1]
|       [outFunc2]
|           FunctionCall [$sum]
|           Variable [aggInput2]
Evaluation [{aggInput2}]
|   FunctionCall [getField]
|   |   Const ["d"]
|   Variable [scan0]
Evaluation [{aggInput1}]
|   FunctionCall [getField]
|   |   Const ["c"]
|   Variable [scan0]
Evaluation [{key2}]
|   FunctionCall [getField]
|   |   Const ["b"]
|   Variable [scan0]
Evaluation [{key1}]
|   FunctionCall [getField]
|   |   Const ["a"]
|   Variable [scan0]
PhysicalScan [{'<root>': scan0}, collName]

-- OUTPUT:
[5] group [s2, s3] [s6 = sum(s4), s7 = sum(s5)] 
[1] project [s2 = getField(s1, "a"), s3 = getField(s1, "b"), s4 = getField(s1, "c"), s5 = getField(s1, "d")] 
[0] scan s1 none none none none none none none lowPriority [] @"<collUUID>" true false 

==== VARIATION: GroupByNode one output with type Global ====
-- INPUT:
GroupBy [{key1, key2}, Global]
|   aggregations: 
|       [outFunc1]
|           FunctionCall [$sum]
|           Variable [aggInput1]
Evaluation [{aggInput1}]
|   FunctionCall [getField]
|   |   Const ["c"]
|   Variable [scan0]
Evaluation [{key2}]
|   FunctionCall [getField]
|   |   Const ["b"]
|   Variable [scan0]
Evaluation [{key1}]
|   FunctionCall [getField]
|   |   Const ["a"]
|   Variable [scan0]
PhysicalScan [{'<root>': scan0}, collName]

-- OUTPUT:
[4] group [s2, s3] [s5 = sum(s4)] 
[1] project [s2 = getField(s1, "a"), s3 = getField(s1, "b"), s4 = getField(s1, "c")] 
[0] scan s1 none none none none none none none lowPriority [] @"<collUUID>" true false 

==== VARIATION: GroupByNode multiple outputs with type Global ====
-- INPUT:
GroupBy [{key1, key2}, Global]
|   aggregations: 
|       [outFunc1]
|           FunctionCall [$sum]
|           Variable [aggInput1]
|       [outFunc2]
|           FunctionCall [$sum]
|           Variable [aggInput2]
Evaluation [{aggInput2}]
|   FunctionCall [getField]
|   |   Const ["d"]
|   Variable [scan0]
Evaluation [{aggInput1}]
|   FunctionCall [getField]
|   |   Const ["c"]
|   Variable [scan0]
Evaluation [{key2}]
|   FunctionCall [getField]
|   |   Const ["b"]
|   Variable [scan0]
Evaluation [{key1}]
|   FunctionCall [getField]
|   |   Const ["a"]
|   Variable [scan0]
PhysicalScan [{'<root>': scan0}, collName]

-- OUTPUT:
[5] group [s2, s3] [s6 = sum(s4), s7 = sum(s5)] 
[1] project [s2 = getField(s1, "a"), s3 = getField(s1, "b"), s4 = getField(s1, "c"), s5 = getField(s1, "d")] 
[0] scan s1 none none none none none none none lowPriority [] @"<collUUID>" true false 
