(
(let $1 (DataType 'Int64))
(let $2 '('"l_orderkey" $1))
(let $3 '('"l_shipmode" (DataType 'Utf8)))
(let $4 '('"_wide_channels" (StructType $2 $3)))
(let $5 '('('"_logical_id" '5193) '('"_id" '"79f4f5c-9b6d5e56-c3b0dedf-6a85753c") $4))
(let $6 (DqPhyStage '() (lambda '() (block '(
  (let $24 (KqpTable '"/local/test_db/olap_yatests/tpch/s1/lineitem" '"72075186224037897:10" '"" '1))
  (let $25 '('"l_commitdate" '"l_orderkey" '"l_receiptdate" '"l_shipdate" '"l_shipmode"))
  (let $26 (KqpBlockReadOlapTableRanges $24 (Void) $25 '() '() (lambda '($27) (block '(
    (let $28 '('eq '"l_shipmode" (String '"MAIL")))
    (let $29 '('eq '"l_shipmode" (String '"SHIP")))
    (let $30 (lambda '($41 $42) (< $41 $42)))
    (let $31 (DataType 'Date32))
    (let $32 (StructType '('"l_commitdate" $31) $2 '('"l_receiptdate" $31) '('"l_shipdate" $31) $3))
    (let $33 (KqpOlapApplyColumnArg $32 '"l_commitdate"))
    (let $34 (KqpOlapApplyColumnArg $32 '"l_receiptdate"))
    (let $35 (KqpOlapApply $30 '($33 $34) '""))
    (let $36 (KqpOlapApply $30 '((KqpOlapApplyColumnArg $32 '"l_shipdate") $33) '""))
    (let $37 '($34))
    (let $38 (KqpOlapApply (lambda '($43) (>= $43 (Date '"8766"))) $37 '""))
    (let $39 (KqpOlapApply (lambda '($44) (Coalesce (< $44 (Just (Date '"9131"))) (Bool 'false))) $37 '""))
    (let $40 (KqpOlapAnd (KqpOlapOr $28 $29) $35 $36 $38 $39))
    (return (TKqpOlapExtractMembers (KqpOlapFilter $27 $40) '('"l_orderkey" '"l_shipmode")))
  )))))
  (return (FromFlow $26))
))) $5))
(let $7 (DqCnUnionAll (TDqOutput $6 '0)))
(let $8 '('('"_logical_id" '5800) '('"_id" '"60922edc-e59fd611-874a2e21-c725dc5d") $4))
(let $9 (DqPhyStage '($7) (lambda '($45) $45) $8))
(let $10 (DqCnBroadcast (TDqOutput $9 '0)))
(let $11 '('0))
(let $12 (StructType '('_yql_agg_0 $1) '('_yql_agg_1 $1) $3))
(let $13 '('('"_logical_id" '5965) '('"_id" '"a579cda7-7d78fad8-fe96a12b-ecd1ea89") '('"_wide_channels" $12)))
(let $14 (DqPhyStage '($10) (lambda '($46) (block '(
  (let $47 '('Many 'Hashed 'Compact))
  (let $48 (NarrowSqueezeToDict (ToFlow (WideFromBlocks $46)) (lambda '($52 $53) $52) (lambda '($54 $55) (AsStruct '('"l_orderkey" $54) '('"l_shipmode" $55))) $47))
  (let $49 (lambda '($60 $61) (block '(
    (let $62 (String '"1-URGENT"))
    (let $63 (String '"2-HIGH"))
    (let $64 (Int32 '1))
    (let $65 (Int32 '0))
    (let $66 (If (Or (== $61 $62) (== $61 $63)) $64 $65))
    (let $67 (If (And (!= $61 $62) (!= $61 $63)) $64 $65))
    (return $60 $66 $67)
  ))))
  (let $50 (AggBlockApply 'sum (DataType 'Int32)))
  (let $51 (lambda '($68 $69 $70 $71) $69 $70 $68 $71))
  (return (FromFlow (WideMap (ToFlow (BlockCombineHashed (WideToBlocks (FromFlow (WideMap (FlatMap $48 (lambda '($56) (block '(
    (let $57 (KqpTable '"/local/test_db/olap_yatests/tpch/s1/orders" '"72075186224037897:12" '"" '1))
    (let $58 (KqpBlockReadOlapTableRanges $57 (Void) '('"o_orderkey" '"o_orderpriority") '() '() (lambda '($59) $59)))
    (return (MapJoinCore (ToFlow (WideFromBlocks (FromFlow $58))) $56 '"Inner" $11 '('"l_orderkey") '('1 '1) '('"l_shipmode" '0) '('"o.o_orderkey") '('"l.l_orderkey")))
  )))) $49))) (Void) $11 '('($50 '1) '($50 '"2")))) $51)))
))) $13))
(let $15 (DqCnHashShuffle (TDqOutput $14 '0) '('"2") '0 '"HashV1"))
(let $16 (StructType '('"high_line_count" $1) $3 '('"low_line_count" $1)))
(let $17 '('('"_logical_id" '7574) '('"_id" '"c24da813-bbb134c1-4a6b7a0b-a9bfc944") '('"_wide_channels" $16)))
(let $18 (DqPhyStage '($15) (lambda '($72) (block '(
  (let $73 (lambda '($76 $77 $78 $79) $78 $76 $77 $79))
  (let $74 (AggBlockApplyState 'sum $1 $1))
  (let $75 (lambda '($80 $81 $82) $81 $80 $82))
  (return (FromFlow (WideMap (WideSort (ToFlow (WideFromBlocks (BlockMergeFinalizeHashed (FromFlow (WideMap (ToFlow $72) $73)) $11 '('($74 '1) '($74 '"2"))))) '('('0 (Bool 'true)))) $75)))
))) $17))
(let $19 (DqCnMerge (TDqOutput $18 '0) '('('1 '"Asc"))))
(let $20 (DqPhyStage '($19) (lambda '($83) (FromFlow (NarrowMap (ToFlow $83) (lambda '($84 $85 $86) (AsStruct '('"high_line_count" $84) '('"l_shipmode" $85) '('"low_line_count" $86)))))) '('('"_logical_id" '7586) '('"_id" '"8357fae5-60fd5e16-fa8da7fd-df989be0"))))
(let $21 '($6 $9 $14 $18 $20))
(let $22 '('"l_shipmode" '"high_line_count" '"low_line_count"))
(let $23 (DqCnResult (TDqOutput $20 '0) $22))
(return (KqpPhysicalQuery '((KqpPhysicalTx $21 '($23) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $16) '0 '0)) '('('"type" '"query"))))
)
