(
(let $1 (DataType 'Int64))
(let $2 (OptionalType $1))
(let $3 (lambda '($47) (Member $47 '_yql_agg_0) (Member $47 'odd)))
(let $4 (lambda '($48 $49) (AsStruct '('_yql_agg_0 $48) '('odd $49))))
(let $5 '('odd (OptionalType (DataType 'Int32))))
(let $6 '('('"_logical_id" '1423) '('"_id" '"a2cd4246-50ae061-893777c5-8c398249") '('"_wide_channels" (StructType '('_yql_agg_0 $2) $5))))
(let $7 (DqPhyStage '() (lambda '() (block '(
  (let $16 '@@["StructType";[["key";["OptionalType";["DataType";"String"]]];["subkey";["OptionalType";["DataType";"String"]]]]]@@)
  (let $17 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '0) '('UniqueKeys '0) '('Type $16)))
  (let $18 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('Attrs '('('"native_strict_schema" '"false")))))
  (let $19 (YtStat '('Id '"Input4") '('RecordsCount '"5") '('DataSize '"264") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
  (let $20 (YtTable '"Input4" $17 $18 $19 '() (Void) (Void) '"/Root/plato"))
  (let $21 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $20 '('"_other" '"subkey") (Void) (Void))) '()))))
  (let $22 (Nothing (OptionalType (DictType (DataType 'String) (DataType 'Yson)))))
  (let $23 (Just (Uint32 '999)))
  (let $24 (lambda '($37) (Just (SafeCast $37 $1))))
  (let $25 (Nothing $2))
  (let $26 (CombineCore (NarrowMap (DqReadWideWrap $21 '()) (lambda '($27 $28) (block '(
    (let $29 (AsStruct '('"_other" $27) '('"subkey" $28)))
    (return (AsStruct '('"_other" (Member $29 '"_other")) '('odd (% (SafeCast (Member $29 '"subkey") (OptionalType (DataType 'Uint32))) (Int32 '"2")))))
  )))) (lambda '($30) (Member $30 'odd)) (lambda '($31 $32) (block '(
    (let $33 (Just (Member $32 '"_other")))
    (let $34 (TryWeakMemberFromDict $33 $22 'Int32 '"data3"))
    (let $35 (TryWeakMemberFromDict $33 $22 'Uint32 '"datahole3"))
    (let $36 (IfPresent (+ $34 (Coalesce $35 $23)) $24 $25))
    (return (AsStruct '('_yql_agg_0 $36)))
  ))) (lambda '($38 $39 $40) (block '(
    (let $41 (Just (Member $39 '"_other")))
    (let $42 (TryWeakMemberFromDict $41 $22 'Int32 '"data3"))
    (let $43 (TryWeakMemberFromDict $41 $22 'Uint32 '"datahole3"))
    (let $44 (IfPresent (+ $42 (Coalesce $43 $23)) $24 $25))
    (return (AsStruct '('_yql_agg_0 (AggrAdd $44 (Member $40 '_yql_agg_0)))))
  ))) (lambda '($45 $46) (Just (AsStruct '('_yql_agg_0 (Member $46 '_yql_agg_0)) '('odd $45)))) '0))
  (return (FromFlow (ExpandMap (NarrowMap (ExpandMap $26 $3) $4) $3)))
))) $6))
(let $8 (DqCnHashShuffle (TDqOutput $7 '0) '('1) '0 '"HashV2"))
(let $9 (StructType $5 '('"score" $2)))
(let $10 '('('"_logical_id" '2649) '('"_id" '"a429def2-1f4eea4f-2e30e348-cb423016") '('"_wide_channels" $9)))
(let $11 (DqPhyStage '($8) (lambda '($50) (block '(
  (let $51 (lambda '($59 $60 $61) $60 $61))
  (let $52 (lambda '($62 $63 $64 $65 $66) (AggrAdd $63 $65) $66))
  (let $53 (WideCombiner (ExpandMap (NarrowMap (ToFlow $50) $4) $3) '"" (lambda '($57 $58) $58) $51 $52 $51))
  (let $54 (Bool 'true))
  (let $55 (Sort (NarrowMap $53 (lambda '($67 $68) (block '(
    (let $69 (AsStruct '('Sum0 $67) '('odd $68)))
    (return (AsStruct '('odd (Member $69 'odd)) '('"score" (Member $69 'Sum0))))
  )))) '($54 $54) (lambda '($70) '((Member $70 'odd) (Member $70 '"score")))))
  (let $56 (lambda '($71) (Member $71 'odd) (Member $71 '"score")))
  (return (FromFlow (ExpandMap $55 $56)))
))) $10))
(let $12 (DqCnMerge (TDqOutput $11 '0) '('('0 '"Asc") '('1 '"Asc"))))
(let $13 (DqPhyStage '($12) (lambda '($72) (FromFlow (NarrowMap (ToFlow $72) (lambda '($73 $74) (AsStruct '('odd $73) '('"score" $74)))))) '('('"_logical_id" '2661) '('"_id" '"5cbcbb98-44f32172-1c9423f8-bddfc31f"))))
(let $14 '($7 $11 $13))
(let $15 (DqCnResult (TDqOutput $13 '0) '('odd '"score")))
(return (KqpPhysicalQuery '((KqpPhysicalTx $14 '($15) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $9) '0 '0)) '('('"type" '"query"))))
)
