(
(let $1 (OptionalType (DataType 'Uint8)))
(let $2 '('0 '1 '"2"))
(let $3 '('"SearchPhrase" (DataType 'Utf8)))
(let $4 '('"UserID" (DataType 'Int64)))
(let $5 (DataType 'Uint64))
(let $6 '('m $1))
(let $7 (StructType $3 $4 '('_yql_agg_0 $5) $6))
(let $8 '('('"_logical_id" '4477) '('"_id" '"a937f5c2-520ade69-bf2c52fd-18a9ce5f") '('"_wide_channels" $7)))
(let $9 (DqPhyStage '() (lambda '() (block '(
  (let $21 (KqpTable '"/local/test_db/olap_yatests/clickbench/hits" '"72075186224037897:8" '"" '1))
  (let $22 '('"EventTime" '"SearchPhrase" '"UserID"))
  (let $23 (KqpBlockReadOlapTableRanges $21 (Void) $22 '() '() (lambda '($26) $26)))
  (let $24 (lambda '($27 $28 $29) (block '(
    (let $30 (OptionalType (DataType 'Timestamp)))
    (let $31 (TupleType (TupleType $30) (StructType) (TupleType)))
    (let $32 (CallableType '() '($1) '($30)))
    (let $33 (Udf '"DateTime2.GetMinute" (Void) $31 '"" $32 (VoidType) '"" '('('"blocks") '('"strict"))))
    (return $28 $29 (Apply $33 (SafeCast $27 $30)))
  ))))
  (let $25 (lambda '($34 $35 $36 $37 $38) $34 $35 $37 $36 $38))
  (return (FromFlow (WideMap (ToFlow (BlockCombineHashed (WideToBlocks (FromFlow (WideMap (ToFlow (WideFromBlocks (FromFlow $23))) $24))) (Void) $2 '('((AggBlockApply 'count_all))))) $25)))
))) $8))
(let $10 '('0 '1 '3))
(let $11 (DqCnHashShuffle (TDqOutput $9 '0) $10 '0 '"HashV1"))
(let $12 (Uint64 '10))
(let $13 (StructType '('Count0 $5) $3 $4 $6))
(let $14 '('('"_logical_id" '5104) '('"_id" '"ce48554-a75988ac-56a46fa8-b7237085") '('"_wide_channels" $13)))
(let $15 (DqPhyStage '($11) (lambda '($39) (block '(
  (let $40 (lambda '($44 $45 $46 $47 $48) $44 $45 $47 $46 $48))
  (let $41 (AggBlockApplyState 'count_all $5 $5))
  (let $42 (WideTopSort (ToFlow (WideFromBlocks (BlockMergeFinalizeHashed (FromFlow (WideMap (ToFlow $39) $40)) $2 '('($41 '3))))) $12 '('('3 (Bool 'false)))))
  (let $43 (lambda '($49 $50 $51 $52) $52 $49 $50 $51))
  (return (FromFlow (WideMap $42 $43)))
))) $14))
(let $16 (DqCnMerge (TDqOutput $15 '0) '('('0 '"Desc"))))
(let $17 (DqPhyStage '($16) (lambda '($53) (FromFlow (NarrowMap (Take (ToFlow $53) $12) (lambda '($54 $55 $56 $57) (AsStruct '('"SearchPhrase" $55) '('"UserID" $56) '('"cnt" $54) '('m $57)))))) '('('"_logical_id" '5230) '('"_id" '"76b33625-dc3d5569-1408fcfa-c35a459a"))))
(let $18 '($9 $15 $17))
(let $19 '('"UserID" 'm '"SearchPhrase" '"cnt"))
(let $20 (DqCnResult (TDqOutput $17 '0) $19))
(return (KqpPhysicalQuery '((KqpPhysicalTx $18 '($20) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType (StructType $3 $4 '('"cnt" $5) $6)) '0 '0)) '('('"type" '"query"))))
)
