# Golden test output of ABTPlanGeneration/LowerSpoolNodes

==== VARIATION: Spool in union with Eager producer and Regular consumer ====
-- INPUT:
Union [{proj0}]
|   SpoolConsumer [Regular, id: 1, {proj0}]
SpoolProducer [Eager, id: 1, {proj0}]
|   |   Const [true]
Evaluation [{proj0}]
|   FunctionCall [getField]
|   |   Const ["a"]
|   Variable [scan0]
PhysicalScan [{'<root>': scan0}, collName]

-- OUTPUT:
[4] union [s4] 
    branch0 [s2] 
        [2] espool sp1 [s2] 
        [1] project [s2 = getField(s1, "a")] 
        [0] scan s1 none none none none none [] @"<collUUID>" true false 
    branch1 [s3] 
        [3] cspool sp1 [s3] 


==== VARIATION: Spool in union with Eager producer and Stack consumer ====
-- INPUT:
Union [{proj0}]
|   SpoolConsumer [Stack, id: 1, {proj0}]
SpoolProducer [Eager, id: 1, {proj0}]
|   |   Const [true]
Evaluation [{proj0}]
|   FunctionCall [getField]
|   |   Const ["a"]
|   Variable [scan0]
PhysicalScan [{'<root>': scan0}, collName]

-- OUTPUT:
[4] union [s4] 
    branch0 [s2] 
        [2] espool sp1 [s2] 
        [1] project [s2 = getField(s1, "a")] 
        [0] scan s1 none none none none none [] @"<collUUID>" true false 
    branch1 [s3] 
        [3] sspool sp1 [s3] 


==== VARIATION: Spool in union with Lazy producer and Regular consumer ====
-- INPUT:
Union [{proj0}]
|   SpoolConsumer [Regular, id: 1, {proj0}]
SpoolProducer [Lazy, id: 1, {proj0}]
|   |   Const [true]
Evaluation [{proj0}]
|   FunctionCall [getField]
|   |   Const ["a"]
|   Variable [scan0]
PhysicalScan [{'<root>': scan0}, collName]

-- OUTPUT:
[4] union [s4] 
    branch0 [s2] 
        [2] lspool sp1 [s2] {true} 
        [1] project [s2 = getField(s1, "a")] 
        [0] scan s1 none none none none none [] @"<collUUID>" true false 
    branch1 [s3] 
        [3] cspool sp1 [s3] 


==== VARIATION: Spool in union with Lazy producer and Stack consumer ====
-- INPUT:
Union [{proj0}]
|   SpoolConsumer [Stack, id: 1, {proj0}]
SpoolProducer [Lazy, id: 1, {proj0}]
|   |   Const [true]
Evaluation [{proj0}]
|   FunctionCall [getField]
|   |   Const ["a"]
|   Variable [scan0]
PhysicalScan [{'<root>': scan0}, collName]

-- OUTPUT:
[4] union [s4] 
    branch0 [s2] 
        [2] lspool sp1 [s2] {true} 
        [1] project [s2 = getField(s1, "a")] 
        [0] scan s1 none none none none none [] @"<collUUID>" true false 
    branch1 [s3] 
        [3] sspool sp1 [s3] 


==== VARIATION: Spool in union with filter expression ====
-- INPUT:
Union [{proj0}]
|   SpoolConsumer [Stack, id: 1, {proj0}]
SpoolProducer [Lazy, id: 1, {proj0}]
|   |   BinaryOp [FillEmpty]
|   |   |   Const [false]
|   |   BinaryOp [Gte]
|   |   |   Const [0]
|   |   BinaryOp [Cmp3w]
|   |   |   Const [23]
|   |   FunctionCall [getField]
|   |   |   Const ["b"]
|   |   Variable [scan0]
Evaluation [{proj0}]
|   FunctionCall [getField]
|   |   Const ["a"]
|   Variable [scan0]
PhysicalScan [{'<root>': scan0}, collName]

-- OUTPUT:
[4] union [s4] 
    branch0 [s2] 
        [2] lspool sp1 [s2] {(((getField(s1, "b") <=> 23) >= 0ll) ?: false)} 
        [1] project [s2 = getField(s1, "a")] 
        [0] scan s1 none none none none none [] @"<collUUID>" true false 
    branch1 [s3] 
        [3] sspool sp1 [s3] 

