(
(let $1 (DataType 'String))
(let $2 (OptionalType $1))
(let $3 (OptionalType (DataType 'Bool)))
(let $4 (OptionalType (DataType 'Float)))
(let $5 (StructType '('"animal" $2) '('"miss" $3) '('"pet" $3) '('"sizeRating" $2) '('"weightMax" $4) '('"weightMin" $4) '('"wild" $3)))
(let $6 '('('"_logical_id" '1139) '('"_id" '"a4540bd4-41d97f88-e2c33445-7f66b69b") '('"_wide_channels" $5)))
(let $7 (DqPhyStage '() (lambda '() (block '(
  (let $12 '@@["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"String"]];["_rest";["DictType";["DataType";"String"];["DataType";"Yson"]]]]]@@)
  (let $13 (Bool 'true))
  (let $14 '('"key" '"subkey"))
  (let $15 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '1) '('UniqueKeys '0) '('Type $12) '('SortDirections '($13 $13)) '('SortMembers $14) '('SortedBy $14) '('SortedByTypes '($1 $1))))
  (let $16 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('Attrs '('('"native_strict_schema" '"false")))))
  (let $17 (YtStat '('Id '"Input") '('RecordsCount '"5") '('DataSize '"589") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
  (let $18 (YtTable '"Input" $15 $16 $17 '() (Void) (Void) '"/Root/plato"))
  (let $19 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $18 '('"_rest") (Void) (Void))) '('('"unordered"))))))
  (let $20 (Sort (NarrowMap (DqReadWideWrap $19 '()) (lambda '($22) (block '(
    (let $23 (Nothing (OptionalType (DictType $1 $1))))
    (let $24 (Just $22))
    (let $25 (TryWeakMemberFromDict $23 $24 'String '"animal"))
    (let $26 (TryWeakMemberFromDict $23 $24 'Bool '"miss"))
    (let $27 (TryWeakMemberFromDict $23 $24 'Bool '"pet"))
    (let $28 (TryWeakMemberFromDict $23 $24 'String '"size"))
    (let $29 (TryWeakMemberFromDict $23 $24 'Float '"weightMax"))
    (let $30 (TryWeakMemberFromDict $23 $24 'Float '"weightMin"))
    (let $31 (TryWeakMemberFromDict $23 $24 'Bool '"wild"))
    (return (AsStruct '('"animal" $25) '('"miss" (Coalesce $26 (Just $13))) '('"pet" (Coalesce $27 (Just (Bool '"false")))) '('"sizeRating" $28) '('"weightMax" $29) '('"weightMin" $30) '('"wild" $31)))
  )))) $13 (lambda '($32) (Member $32 '"weightMin"))))
  (let $21 (lambda '($33) (Member $33 '"animal") (Member $33 '"miss") (Member $33 '"pet") (Member $33 '"sizeRating") (Member $33 '"weightMax") (Member $33 '"weightMin") (Member $33 '"wild")))
  (return (FromFlow (ExpandMap $20 $21)))
))) $6))
(let $8 (DqCnMerge (TDqOutput $7 '0) '('('"5" '"Asc"))))
(let $9 (DqPhyStage '($8) (lambda '($34) (FromFlow (NarrowMap (ToFlow $34) (lambda '($35 $36 $37 $38 $39 $40 $41) (AsStruct '('"animal" $35) '('"miss" $36) '('"pet" $37) '('"sizeRating" $38) '('"weightMax" $39) '('"weightMin" $40) '('"wild" $41)))))) '('('"_logical_id" '1151) '('"_id" '"2634978-95aaae53-d3df8477-62d6d611"))))
(let $10 '('"animal" '"sizeRating" '"weightMin" '"weightMax" '"wild" '"pet" '"miss"))
(let $11 (DqCnResult (TDqOutput $9 '0) $10))
(return (KqpPhysicalQuery '((KqpPhysicalTx '($7 $9) '($11) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $5) '0 '0)) '('('"type" '"query"))))
)
