aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/s-expressions/suites/Optimizers/ExtendWithFill.yql
blob: 2e266ddca25adecad0a0d06d5785f8afb45eb9bc (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
(
# Should not generate single MrFill for all content
(import aggregate_module '"/lib/yql/aggregate.yql")
(let world (block '(
  (let x (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) (Void) '()))
  (let world (Left! x))
  (let table2 (Right! x))
  (let values (block '(
    (let select (block '(
      (let core (UnionAll (block '(
        (let select (block '(
          (let core table2)
          (let core (Aggregate core '('"key") '('('Sum0 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Cast (Member row '"subkey") 'Uint32)))))))
          (let core (FlatMap core (lambda '(row) (block '(
            (let res (AsStruct '('"key" (Member row '"key")) '('"value" (Member row 'Sum0))))
            (let res (AsList res))
            (return res)
          )))))
          (return core)
        )))
        (return select)
      )) (block '(
        (let select (block '(
          (let core table2)
          (let core (Aggregate core '() '('('Sum1 (Apply (bind aggregate_module '"sum_traits_factory") (TypeOf core) (lambda '(row) (Cast (Member row '"subkey") 'Uint32)))))))
          (let core (FlatMap core (lambda '(row) (block '(
            (let res (AsStruct '('"key" (String '"")) '('"value" (Member row 'Sum1))))
            (let res (AsList res))
            (return res)
          )))))
          (return core)
        )))
        (return select)
      ))))
      (let core (FlatMap core (lambda '(row) (block '(
        (let res (AsList row))
        (return res)
      )))))
      (return core)
    )))
    (return select)
  )))
  (let world (block '(
    (let sink (DataSink '"yt" '"plato"))
    (let world (Write! world sink (Key '('table (String '"Output"))) values '('('mode 'append))))
    (return world)
  )))
  (return world)
)))
(let world (block '(
  (let plato_sink (DataSink '"yt" '"plato"))
  (let world (Commit! world plato_sink))
  (return world)
)))
(return world)
)