(
(let $1 (DataType 'String))
(let $2 '('"key" $1))
(let $3 '('"subkey" $1))
(let $4 '('"value" $1))
(let $5 '"_equijoin_column_0")
(let $6 (OptionalType $1))
(let $7 '('"kk" $1))
(let $8 '('"sk" $1))
(let $9 (StructType '($5 $6) $7 $8 $4))
(let $10 (DqPhyStage '() (lambda '() (block '(
  (let $20 '@@["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"String"]];["value";["DataType";"String"]]]]@@)
  (let $21 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '1) '('UniqueKeys '0) '('Type $20)))
  (let $22 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('HasRLS '0) '('Attrs '('('"native_strict_schema" 'false)))))
  (let $23 (YtStat '('Id '"Input") '('RecordsCount '"4") '('DataSize '"166") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
  (let $24 (YtTable '"Input" $21 $22 $23 '() (Void) (Void) '"/Root/plato"))
  (let $25 '('"key" '"subkey" '"value"))
  (let $26 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $24 $25 (Void) (Void) (Void))) '()))))
  (return (FromFlow (NarrowFlatMap (DqReadWideWrap $26 '()) (lambda '($27 $28 $29) (block '(
    (let $30 (AsStruct '('"key" $27) '('"subkey" $28) '('"value" $29)))
    (let $31 (StructType $2 $3 $4))
    (let $32 (VariantType (TupleType $31 $9)))
    (let $33 (/ (SafeCast $27 (OptionalType (DataType 'Uint32))) (Int32 '"100")))
    (let $34 (IfPresent $33 (lambda '($37) (Just (SafeCast $37 $1))) (Nothing $6)))
    (let $35 (AsStruct '($5 $34) '('"kk" $27) '('"sk" $28) '('"value" (Concat (String '"data: ") $29))))
    (let $36 (If (Coalesce (< $33 (Int32 '"5")) (Bool 'false)) (AsList (Variant $35 '1 $32)) (List (ListType $32))))
    (return (Extend (AsList (Variant $30 '0 $32)) $36))
  ))))))
))) '('('"_logical_id" '2329) '('"_id" '"37104cf5-3d5fdf1f-ce648b54-c980d492"))))
(let $11 (DqCnMap (TDqOutput $10 '0)))
(let $12 (DqCnBroadcast (TDqOutput $10 '1)))
(let $13 (StructType $2 $7 $8 $3 $4 '('"valueFromInput" $1)))
(let $14 '('('"_logical_id" '2558) '('"_id" '"6a42c7e4-e3a2693d-a6c842c2-f764841a") '('"_wide_channels" $13)))
(let $15 (DqPhyStage '($11 $12) (lambda '($38 $39) (block '(
  (let $40 '('Many 'Hashed 'Compact))
  (let $41 (SqueezeToDict (FlatMap (ToFlow $39) (lambda '($45) (block '(
    (let $46 (Member $45 $5))
    (let $47 (Nothing (OptionalType (TupleType $1 $9))))
    (let $48 (IfPresent $46 (lambda '($49) (Just '($49 $45))) $47))
    (return (If (Exists $46) $48 $47))
  )))) (lambda '($50) (Nth $50 '0)) (lambda '($51) (Nth $51 '1)) $40))
  (let $42 (Bool 'true))
  (let $43 (Sort (Map (FlatMap $41 (lambda '($52) (block '(
    (let $53 '('"key" '"Input.key" '"subkey" '"Input.subkey" '"value" '"Input.value"))
    (let $54 '('"kk" '"d.kk" '"sk" '"d.sk" '"value" '"d.value"))
    (return (MapJoinCore (ToFlow $38) $52 'Inner '('"subkey") '($5) $53 $54 '('"Input.subkey") '('"d._equijoin_column_0")))
  )))) (lambda '($55) (AsStruct '('"key" (Member $55 '"Input.key")) '('"kk" (Member $55 '"d.kk")) '('"sk" (Member $55 '"d.sk")) '('"subkey" (Member $55 '"Input.subkey")) '('"value" (Member $55 '"d.value")) '('"valueFromInput" (Member $55 '"Input.value"))))) '($42 $42) (lambda '($56) '((Member $56 '"key") (Member $56 '"value")))))
  (let $44 (lambda '($57) (Member $57 '"key") (Member $57 '"kk") (Member $57 '"sk") (Member $57 '"subkey") (Member $57 '"value") (Member $57 '"valueFromInput")))
  (return (FromFlow (ExpandMap $43 $44)))
))) $14))
(let $16 (DqCnMerge (TDqOutput $15 '0) '('('0 '"Asc") '('"4" '"Asc"))))
(let $17 (DqPhyStage '($16) (lambda '($58) (FromFlow (NarrowMap (ToFlow $58) (lambda '($59 $60 $61 $62 $63 $64) (AsStruct '('"key" $59) '('"kk" $60) '('"sk" $61) '('"subkey" $62) '('"value" $63) '('"valueFromInput" $64)))))) '('('"_logical_id" '2570) '('"_id" '"266bd88c-8edaa60b-bf6a2829-5bdec4f4"))))
(let $18 '($10 $15 $17))
(let $19 (DqCnResult (TDqOutput $17 '0) '()))
(return (KqpPhysicalQuery '((KqpPhysicalTx $18 '($19) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $13) '0 '0)) '('('"type" '"query"))))
)
