(
(let $1 (Configure! world (DataSource '"config") '"DqEngine" '"force"))
(let $2 (Configure! $1 (DataSource '"pq" '"$all") '"Attr" '"consumer" '"test_client"))
(let $3 (DataSink 'result))
(let $4 (DataSource '"pq" '"pq"))
(let $5 '('('"system" '_yql_sys_seq_no) '('"system" '_yql_sys_partition_id) '('"system" '_yql_sys_create_time) '('"system" '_yql_sys_message_group_id) '('"system" '_yql_sys_tsp_write_time) '('"system" '_yql_sys_offset)))
(let $6 (DataType 'String))
(let $7 (OptionalType $6))
(let $8 '('"color" $7))
(let $9 '('"value" $7))
(let $10 (PqTopic '"pq" '"local" '"test_topic_input" '('('"PartitionsCount" '"1")) $5 (StructType $8 $9)))
(let $11 '('"SharedReading" '"1"))
(let $12 '('('"Consumer" '"test_client") '('"Endpoint" '"<pq_pq_endpoint>") $11 '('"ReconnectPeriod" '"") '('"Format" '"json_each_row") '('"ReadGroup" '"fqrun") '('"UseSsl" '"1")))
(let $13 (DataType 'Timestamp))
(let $14 (DataType 'Uint64))
(let $15 (StructType '('_yql_sys_create_time $13) '('_yql_sys_message_group_id $6) '('_yql_sys_offset $14) '('_yql_sys_partition_id $14) '('_yql_sys_seq_no $14) '('_yql_sys_tsp_write_time $13) $8 $9))
(let $16 (DqPqTopicSource world $10 '('"color" '"value") $12 (SecureParam '"cluster:default_pq") '"" $15 '""))
(let $17 (DqStage '((DqSource $4 $16)) (lambda '($22) (block '(
  (let $23 '('_yql_sys_seq_no '_yql_sys_partition_id '_yql_sys_create_time '_yql_sys_message_group_id '_yql_sys_tsp_write_time '_yql_sys_offset))
  (let $24 '('('"format" '"json_each_row") '('"metadataColumns" $23) '('"formatSettings" '('('"data.datetime.formatname" '"POSIX") '('"data.timestamp.formatname" '"POSIX"))) '('"settings" '($11))))
  (let $25 (DqSourceWideWrap $22 $4 $15 $24))
  (return (FlatMap (NarrowMap $25 (lambda '($26 $27 $28 $29 $30 $31 $32 $33) (AsStruct '('_yql_sys_create_time $26) '('_yql_sys_message_group_id $27) '('_yql_sys_offset $28) '('_yql_sys_partition_id $29) '('_yql_sys_seq_no $30) '('_yql_sys_tsp_write_time $31) '('"color" $32) '('"value" $33)))) (lambda '($34) (Just (AsStruct '('"color" (Member $34 '"color")) '('"create_time" (Member $34 '_yql_sys_create_time)) '('"message_group_id" (Member $34 '_yql_sys_message_group_id)) '('"offset" (Member $34 '_yql_sys_offset)) '('"partition_id" (Member $34 '_yql_sys_partition_id)) '('"v" (Member $34 '_yql_sys_seq_no)) '('"value" (Member $34 '"value")) '('"write_time" (Member $34 '_yql_sys_tsp_write_time)))))))
))) '('('"_logical_id" '0))))
(let $18 (DqStage '((DqCnUnionAll (TDqOutput $17 '"0"))) (lambda '($35) $35) '('('"_logical_id" '0))))
(let $19 '('"value" '"color" '"create_time" '"write_time" '"partition_id" '"offset" '"message_group_id" '"v"))
(let $20 '('('type) '('autoref) '('columns $19)))
(let $21 (ResPull! $2 $3 (Key) (DqCnResult (TDqOutput $18 '"0") '()) $20 '"dq"))
(return (Commit! (Commit! $21 $3) (DataSink '"pq" '"pq")))
)
