コード例 #1
0
 def expand(self, pcoll):
     return (pcoll
             | 'TopPerMonthWindow' >> beam.WindowInto(
                 FixedWindows(size=THIRTY_DAYS_IN_SECONDS))
             | 'Top' >> combiners.core.CombineGlobally(
                 combiners.TopCombineFn(
                     10, lambda first, second: first[1] < second[1])).
             without_defaults())
コード例 #2
0
 def expand(self, pcoll):
     return (pcoll
             | 'TopPerMonthWindow' >> beam.WindowInto(
                 FixedWindows(size=THIRTY_DAYS_IN_SECONDS))
             | 'Top' >> combiners.core.CombineGlobally(
                 combiners.TopCombineFn(
                     n=10, key=lambda sessions_count: sessions_count[1])).
             without_defaults())