(
(let $1 (OptionalType (DataType 'Uint32)))
(let $2 (lambda '($39 $40) $40 $39))
(let $3 '('"region" $1))
(let $4 '('('"_logical_id" '1361) '('"_id" '"21a332d9-f9164754-972a976e-107668ed") '('"_wide_channels" (StructType '('_yql_agg_0 $1) $3))))
(let $5 (DqPhyStage '() (lambda '() (block '(
  (let $15 '@@["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"String"]];["value";["DataType";"String"]]]]@@)
  (let $16 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '1) '('UniqueKeys '0) '('Type $15)))
  (let $17 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('Attrs '('('"native_strict_schema" 'false)))))
  (let $18 (YtStat '('Id '"Input") '('RecordsCount '"12") '('DataSize '"525") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
  (let $19 (YtTable '"Input" $16 $17 $18 '() (Void) (Void) '"/Root/plato"))
  (let $20 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $19 '('"key" '"subkey") (Void) (Void))) '()))))
  (let $21 (Uint32 '"10"))
  (let $22 (Uint32 '1))
  (let $23 (Bool 'false))
  (let $24 (Just (Uint32 '0)))
  (return (DqPhyHashCombine (WideToBlocks (FromFlow (DqReadWideWrap $20 '()))) '-1073741824 (lambda '($25 $26) (SafeCast $26 $1)) (lambda '($27 $28 $29) (block '(
    (let $30 (SafeCast $28 $1))
    (let $31 (% $30 $21))
    (return (If (And (Coalesce (>= $31 $22) $23) (Coalesce (<= $31 (% (SafeCast $29 $1) $21)) $23)) $30 $24))
  ))) (lambda '($32 $33 $34 $35) (block '(
    (let $36 (SafeCast $33 $1))
    (let $37 (% $36 $21))
    (let $38 (If (And (Coalesce (>= $37 $22) $23) (Coalesce (<= $37 (% (SafeCast $34 $1) $21)) $23)) $36 $24))
    (return (AggrMax $38 $35))
  ))) $2))
))) $4))
(let $6 (DqCnHashShuffle (TDqOutput $5 '0) '('1) '0 '"HashV2"))
(let $7 '"max_age_at_range_intersect")
(let $8 (StructType '($7 $1) $3))
(let $9 '('('"_logical_id" '2350) '('"_id" '"d9d479e3-d1cfeae6-1d1144b1-db155381") '('"_wide_channels" $8)))
(let $10 (DqPhyStage '($6) (lambda '($41) (block '(
  (let $42 (WideCombiner (ToFlow (WideFromBlocks $41)) '"" (lambda '($43 $44) $44) (lambda '($45 $46 $47) $46) (lambda '($48 $49 $50 $51) (AggrMax $49 $51)) $2))
  (return (FromFlow (WideSort $42 '('('1 (Bool 'true))))))
))) $9))
(let $11 (DqCnMerge (TDqOutput $10 '0) '('('1 '"Asc"))))
(let $12 (DqPhyStage '($11) (lambda '($52) (FromFlow (NarrowMap (ToFlow $52) (lambda '($53 $54) (AsStruct '($7 $53) '('"region" $54)))))) '('('"_logical_id" '2362) '('"_id" '"86a5c8b1-4284cbcc-e682141-177b93af"))))
(let $13 '($5 $10 $12))
(let $14 (DqCnResult (TDqOutput $12 '0) '('"region" $7)))
(return (KqpPhysicalQuery '((KqpPhysicalTx $13 '($14) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $8) '0 '0)) '('('"type" '"query"))))
)
