(
(let $1 (DataType 'Double))
(let $2 (DataType 'Int64))
(let $3 (StructType '('"l_discount" $1) '('"l_extendedprice" $1) '('"l_orderkey" $2) '('"l_suppkey" $2)))
(let $4 '('('"_logical_id" '7393) '('"_id" '"c8c40192-83d49998-eeaf2aca-39cca4ba") '('"_wide_channels" $3)))
(let $5 (DqPhyStage '() (lambda '() (block '(
  (let $50 (KqpTable '"/local/test_db/olap_yatests/tpch/s1/lineitem" '"72075186224037897:10" '"" '1))
  (let $51 '('"l_discount" '"l_extendedprice" '"l_orderkey" '"l_suppkey"))
  (let $52 (KqpBlockReadOlapTableRanges $50 (Void) $51 '() '() (lambda '($54) $54)))
  (let $53 (lambda '($55 $56 $57 $58 $59) (block '(
    (let $60 (BlockAsStruct '('"l_discount" $55) '('"l_extendedprice" $56) '('"l_orderkey" $57) '('"l_suppkey" $58)))
    (return (BlockMember $60 '"l_discount") (BlockMember $60 '"l_extendedprice") (BlockMember $60 '"l_orderkey") (BlockMember $60 '"l_suppkey") $59)
  ))))
  (return (FromFlow (WideMap $52 $53)))
))) $4))
(let $6 '('"o_custkey" $2))
(let $7 '('"o_orderkey" $2))
(let $8 (Bool 'false))
(let $9 '('('"_logical_id" '5115) '('"_id" '"5ecf7346-9849abb6-308b8c18-36568632") '('"_wide_channels" (StructType $6 $7))))
(let $10 (DqPhyStage '() (lambda '() (block '(
  (let $61 (KqpTable '"/local/test_db/olap_yatests/tpch/s1/orders" '"72075186224037897:12" '"" '1))
  (let $62 '('"o_custkey" '"o_orderdate" '"o_orderkey"))
  (let $63 (KqpBlockReadOlapTableRanges $61 (Void) $62 '() '() (lambda '($65) (block '(
    (let $66 (StructType $6 '('"o_orderdate" (DataType 'Date32)) $7))
    (let $67 '('"o_orderdate"))
    (let $68 (KqpOlapApply $66 $67 '() (lambda '($70) (>= $70 (Date '"8766")))))
    (let $69 (KqpOlapApply $66 $67 '() (lambda '($71) (Coalesce (< $71 (Just (Date '"9131"))) $8))))
    (return (TKqpOlapExtractMembers (KqpOlapFilter $65 (KqpOlapAnd $68 $69)) '('"o_custkey" '"o_orderkey")))
  )))))
  (let $64 (lambda '($72 $73 $74) (block '(
    (let $75 (BlockAsStruct '('"o_custkey" $72) '('"o_orderkey" $73)))
    (return (BlockMember $75 '"o_custkey") (BlockMember $75 '"o_orderkey") $74)
  ))))
  (return (FromFlow (WideMap $63 $64)))
))) $9))
(let $11 (DqCnBroadcast (TDqOutput $10 '0)))
(let $12 '('Many 'Hashed 'Compact))
(let $13 (DataType 'Int32))
(let $14 (StructType '('"c.c_custkey" $2) '('"c.c_nationkey" $13) '('"o.o_custkey" $2) '('"o.o_orderkey" $2)))
(let $15 '('('"_logical_id" '5515) '('"_id" '"ab5cb1f9-37b19096-67c41693-4b6c79ed") '('"_wide_channels" $14)))
(let $16 (DqPhyStage '($11) (lambda '($76) (block '(
  (let $77 (NarrowSqueezeToDict (ToFlow (WideFromBlocks $76)) (lambda '($79 $80) $79) (lambda '($81 $82) (AsStruct '('"o_custkey" $81) '('"o_orderkey" $82))) $12))
  (let $78 (lambda '($94) (Member $94 '"c.c_custkey") (Member $94 '"c.c_nationkey") (Member $94 '"o.o_custkey") (Member $94 '"o.o_orderkey")))
  (return (FromFlow (ExpandMap (FlatMap $77 (lambda '($83) (block '(
    (let $84 (KqpTable '"/local/test_db/olap_yatests/tpch/s1/customer" '"72075186224037897:9" '"" '1))
    (let $85 (KqpBlockReadOlapTableRanges $84 (Void) '('"c_custkey" '"c_nationkey") '() '() (lambda '($89) $89)))
    (let $86 (lambda '($90 $91 $92) (BlockAsStruct '('"c_custkey" $90) '('"c_nationkey" $91)) $92))
    (let $87 '('"c_custkey" '"c.c_custkey" '"c_nationkey" '"c.c_nationkey"))
    (let $88 '('"o_custkey" '"o.o_custkey" '"o_orderkey" '"o.o_orderkey"))
    (return (MapJoinCore (NarrowMap (ToFlow (WideFromBlocks (FromFlow (WideMap $85 $86)))) (lambda '($93) $93)) $83 '"Inner" '('"c_custkey") '('"o_custkey") $87 $88 '('"c.c_custkey") '('"o.o_custkey")))
  )))) $78)))
))) $15))
(let $17 '('"r_regionkey"))
(let $18 '('('"_logical_id" '5144) '('"_id" '"314afc3c-f4b8d5fb-49acd033-a0d45ecf") '('"_wide_channels" (StructType '('"r_regionkey" $13)))))
(let $19 (DqPhyStage '() (lambda '() (block '(
  (let $95 (KqpTable '"/local/test_db/olap_yatests/tpch/s1/region" '"72075186224037897:15" '"" '1))
  (let $96 (KqpBlockReadOlapTableRanges $95 (Void) '('"r_name" '"r_regionkey") '() '() (lambda '($98) (block '(
    (let $99 '('eq '"r_name" (String '"ASIA")))
    (return (TKqpOlapExtractMembers (KqpOlapFilter $98 $99) $17))
  )))))
  (let $97 (lambda '($100 $101) (BlockMember (BlockAsStruct '('"r_regionkey" $100)) '"r_regionkey") $101))
  (return (FromFlow (WideMap $96 $97)))
))) $18))
(let $20 (DqCnBroadcast (TDqOutput $19 '0)))
(let $21 (DataType 'Utf8))
(let $22 '('"n.n_name" $21))
(let $23 '('"n.n_nationkey" $13))
(let $24 '('"n.n_regionkey" $13))
(let $25 '('"r.r_regionkey" $13))
(let $26 (StructType $22 $23 $24 $25))
(let $27 '('('"_logical_id" '5547) '('"_id" '"b05a5b0-56dd635-25b7086c-975d73e5") '('"_wide_channels" $26)))
(let $28 (DqPhyStage '($20) (lambda '($102) (block '(
  (let $103 (NarrowSqueezeToDict (ToFlow (WideFromBlocks $102)) (lambda '($105) $105) (lambda '($106) (AsStruct '('"r_regionkey" $106))) $12))
  (let $104 (lambda '($120) (Member $120 '"n.n_name") (Member $120 '"n.n_nationkey") (Member $120 '"n.n_regionkey") (Member $120 '"r.r_regionkey")))
  (return (FromFlow (ExpandMap (FlatMap $103 (lambda '($107) (block '(
    (let $108 (KqpTable '"/local/test_db/olap_yatests/tpch/s1/nation" '"72075186224037897:11" '"" '1))
    (let $109 '('"n_name" '"n_nationkey" '"n_regionkey"))
    (let $110 (KqpBlockReadOlapTableRanges $108 (Void) $109 '() '() (lambda '($113) $113)))
    (let $111 (lambda '($114 $115 $116 $117) (block '(
      (let $118 (BlockAsStruct '('"n_name" $114) '('"n_nationkey" $115) '('"n_regionkey" $116)))
      (return $118 $117)
    ))))
    (let $112 '('"n_name" '"n.n_name" '"n_nationkey" '"n.n_nationkey" '"n_regionkey" '"n.n_regionkey"))
    (return (MapJoinCore (NarrowMap (ToFlow (WideFromBlocks (FromFlow (WideMap $110 $111)))) (lambda '($119) $119)) $107 '"Inner" '('"n_regionkey") $17 $112 '('"r_regionkey" '"r.r_regionkey") '('"n.n_regionkey") '('"r.r_regionkey")))
  )))) $104)))
))) $27))
(let $29 (DqCnBroadcast (TDqOutput $28 '0)))
(let $30 (StructType $22 $23 $24 $25 '('"s.s_nationkey" $13) '('"s.s_suppkey" $2)))
(let $31 '('('"_logical_id" '5696) '('"_id" '"b8ea353a-4d1a98d3-cf7f6165-1a30f84") '('"_wide_channels" $30)))
(let $32 (DqPhyStage '($29) (lambda '($121) (block '(
  (let $122 (NarrowSqueezeToDict (ToFlow $121) (lambda '($124 $125 $126 $127) $125) (lambda '($128 $129 $130 $131) (AsStruct '('"n.n_name" $128) '('"n.n_nationkey" $129) '('"n.n_regionkey" $130) '('"r.r_regionkey" $131))) $12))
  (let $123 (lambda '($144) (Member $144 '"n.n_name") (Member $144 '"n.n_nationkey") (Member $144 '"n.n_regionkey") (Member $144 '"r.r_regionkey") (Member $144 '"s.s_nationkey") (Member $144 '"s.s_suppkey")))
  (return (FromFlow (ExpandMap (FlatMap $122 (lambda '($132) (block '(
    (let $133 (KqpTable '"/local/test_db/olap_yatests/tpch/s1/supplier" '"72075186224037897:16" '"" '1))
    (let $134 (KqpBlockReadOlapTableRanges $133 (Void) '('"s_nationkey" '"s_suppkey") '() '() (lambda '($139) $139)))
    (let $135 (lambda '($140 $141 $142) (BlockAsStruct '('"s_nationkey" $140) '('"s_suppkey" $141)) $142))
    (let $136 '('"n.n_nationkey"))
    (let $137 '('"s_nationkey" '"s.s_nationkey" '"s_suppkey" '"s.s_suppkey"))
    (let $138 '('"n.n_name" '"n.n_name" '"n.n_nationkey" '"n.n_nationkey" '"n.n_regionkey" '"n.n_regionkey" '"r.r_regionkey" '"r.r_regionkey"))
    (return (MapJoinCore (NarrowMap (ToFlow (WideFromBlocks (FromFlow (WideMap $134 $135)))) (lambda '($143) $143)) $132 '"Inner" '('"s_nationkey") $136 $137 $138 '('"s.s_nationkey") $136))
  )))) $123)))
))) $31))
(let $33 (DqCnMap (TDqOutput $5 '0)))
(let $34 (DqCnHashShuffle (TDqOutput $16 '0) '('3)))
(let $35 (DqCnBroadcast (TDqOutput $32 '0)))
(let $36 '($33 $34 $35))
(let $37 '('1))
(let $38 (lambda '($189 $190) $190 $189))
(let $39 '('"n_name" $21))
(let $40 '('('"_logical_id" '5995) '('"_id" '"ac49e8cd-632db2be-1488f2e4-23144778") '('"_wide_channels" (StructType '('_yql_agg_0 $1) $39))))
(let $41 (DqPhyStage $36 (lambda '($145 $146 $147) (block '(
  (let $148 (NarrowSqueezeToDict (ToFlow $147) (lambda '($150 $151 $152 $153 $154 $155) '($155 $151)) (lambda '($156 $157 $158 $159 $160 $161) (AsStruct '('"n.n_name" $156) '('"n.n_nationkey" $157) '('"n.n_regionkey" $158) '('"r.r_regionkey" $159) '('"s.s_nationkey" $160) '('"s.s_suppkey" $161))) $12))
  (let $149 (Int32 '1))
  (return (FromFlow (WideCombiner (FlatMap $148 (lambda '($162) (block '(
    (let $163 (lambda '($169 $170 $171 $172) $170 $172))
    (let $164 '('0 '0 '1 '1 '3 '2))
    (let $165 (GraceJoinCore (ToFlow (WideFromBlocks $145)) (WideMap (ToFlow $146) $163) '"Inner" '('2) $37 $164 '('0 '3) '('"l.l_orderkey") '('"o.o_orderkey") '()))
    (let $166 (lambda '($173 $174 $175 $176) $176 $173 $174 $175))
    (let $167 '('"s.s_suppkey" '"n.n_nationkey"))
    (let $168 '('1 '0 '2 '1))
    (return (MapJoinCore (WideMap $165 $166) $162 '"Inner" '('3 '0) $167 $168 '('"n.n_name" '2) '('"l.l_suppkey" '"c.c_nationkey") $167))
  )))) '-1073741824 (lambda '($177 $178 $179) $179) (lambda '($180 $181 $182 $183) (* $182 (- $149 $181))) (lambda '($184 $185 $186 $187 $188) (AggrAdd (* $186 (- $149 $185)) $188)) $38)))
))) $40))
(let $42 (DqCnHashShuffle (TDqOutput $41 '0) $37))
(let $43 (StructType $39 '('"revenue" $1)))
(let $44 '('('"_logical_id" '7251) '('"_id" '"14c3f3c0-d553b1d6-1c17e996-3e296f6a") '('"_wide_channels" $43)))
(let $45 (DqPhyStage '($42) (lambda '($191) (block '(
  (let $192 (WideCombiner (ToFlow $191) '"" (lambda '($194 $195) $195) (lambda '($196 $197 $198) $197) (lambda '($199 $200 $201 $202) (AggrAdd $200 $202)) $38))
  (let $193 (lambda '($203 $204) $204 $203))
  (return (FromFlow (WideMap (WideSort $192 '('('0 $8))) $193)))
))) $44))
(let $46 (DqCnMerge (TDqOutput $45 '0) '('('1 '"Desc"))))
(let $47 (DqPhyStage '($46) (lambda '($205) (FromFlow (NarrowMap (ToFlow $205) (lambda '($206 $207) (AsStruct '('"n_name" $206) '('"revenue" $207)))))) '('('"_logical_id" '7263) '('"_id" '"dce02df4-1c0817c1-3a94ea34-6fff6b98"))))
(let $48 '($5 $10 $16 $19 $28 $32 $41 $45 $47))
(let $49 (DqCnResult (TDqOutput $47 '0) '('"n_name" '"revenue")))
(return (KqpPhysicalQuery '((KqpPhysicalTx $48 '($49) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $43) '0 '0)) '('('"type" '"query"))))
)
