aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/s-expressions/suites/Aggregation/AggregateSameDistinct.yqls
blob: 9f4fb017570472ed1b473a67fd36dcb8b0daccc8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
(
(let $1 world)
(let $2 (DataSource '"yt" '"plato"))
(let $3 (String '"Input"))
(let $4 '('table $3))
(let $5 (Key $4))
(let $6 '('"key"))
(let $7 '())
(let $8 (Read! $1 $2 $5 $6 $7))
(let $9 (Left! $8))
(let $10 (DataSink 'result))
(let $11 (Key))
(let $12 (Right! $8))
(let $13 '())
(let $14 (TypeOf $12))
(let $15 (ListItemType $14))
(let $16 (StructMemberType $15 '"key"))
(let $17 (lambda '($49) (block '(
  (let $51 (Exists $49))
  (let $52 (Convert $51 'Uint64))
  (return $52)
))))
(let $18 (lambda '($53 $54) (block '(
  (let $56 (Exists $53))
  (let $57 (Convert $56 'Uint64))
  (let $58 (lambda '($60 $61) (block '(
    (let $63 (+ $60 $61))
    (return $63)
  ))))
  (let $59 (OptionalReduce $54 $57 $58))
  (return $59)
))))
(let $19 (lambda '($64) (block '(
  (return $64)
))))
(let $20 (lambda '($66) (block '(
  (return $66)
))))
(let $21 (lambda '($68 $69) (block '(
  (let $71 (lambda '($73 $74) (block '(
    (let $76 (+ $73 $74))
    (return $76)
  ))))
  (let $72 (OptionalReduce $68 $69 $71))
  (return $72)
))))
(let $22 (lambda '($77) (block '(
  (return $77)
))))
(let $23 (AggregationTraits $16 $17 $18 $19 $20 $21 $22 (Null)))
(let $24 '('Count0 $23 '"key"))
(let $25 (TypeOf $12))
(let $26 (ListItemType $25))
(let $27 (StructMemberType $26 '"key"))
(let $28 (lambda '($79) (block '(
  (return $79)
))))
(let $29 (lambda '($81 $82) (block '(
  (let $84 (lambda '($86 $87) (block '(
    (let $89 (Min $86 $87))
    (return $89)
  ))))
  (let $85 (OptionalReduce $82 $81 $84))
  (return $85)
))))
(let $30 (lambda '($90) (block '(
  (return $90)
))))
(let $31 (lambda '($92) (block '(
  (return $92)
))))
(let $32 (lambda '($94 $95) (block '(
  (let $97 (lambda '($99 $100) (block '(
    (let $102 (Min $99 $100))
    (return $102)
  ))))
  (let $98 (OptionalReduce $94 $95 $97))
  (return $98)
))))
(let $33 (lambda '($103) (block '(
  (return $103)
))))
(let $34 (AggregationTraits $27 $28 $29 $30 $31 $32 $33 (Null)))
(let $35 '('Min1 $34 '"key"))
(let $36 '($24 $35))
(let $37 (Aggregate $12 $13 $36))
(let $38 (lambda '($105) (block '(
  (let $107 (Struct))
  (let $108 (Member $105 'Count0))
  (let $109 (AddMember $107 '"column0" $108))
  (let $110 (Member $105 'Min1))
  (let $111 (AddMember $109 '"column1" $110))
  (let $112 (AsList $111))
  (return $112)
))))
(let $39 (FlatMap $37 $38))
(let $40 '('type))
(let $41 '('autoref))
(let $42 '('"column0" '"column1"))
(let $43 '('columns $42))
(let $44 '($40 $41 $43))
(let $45 (Write! $9 $10 $11 $39 $44))
(let $46 (Commit! $45 $10))
(let $47 (DataSink '"yt" '"plato"))
(let $48 (Commit! $46 $47))
(return $48)
)