shunping commented on issue #36145:
URL: https://github.com/apache/beam/issues/36145#issuecomment-3289834018

   The sum behavior is the same when running a similar python pipeline.
   
   ```python
   import logging
   
   logging.basicConfig(level=logging.INFO)
   
   import apache_beam as beam
   from apache_beam.options.pipeline_options import PipelineOptions
   from apache_beam import window
   from apache_beam.transforms.trigger import AfterWatermark, 
AfterProcessingTime, AccumulationMode, AfterCount
   from apache_beam.transforms.window import FixedWindows
   from apache_beam.transforms import trigger
   import apache_beam as beam
   from apache_beam import window
   from apache_beam.transforms.trigger import AfterWatermark, 
AfterProcessingTime, AccumulationMode, AfterCount
   from apache_beam.transforms.window import FixedWindows
   from apache_beam.transforms import trigger
   from apache_beam.transforms.periodicsequence import PeriodicImpulse
   from apache_beam.transforms.periodicsequence import RebaseMode
   from apache_beam.utils.timestamp import Timestamp
   from apache_beam.testing.test_stream import TestStream
   
   
   # prism runner option
   options = PipelineOptions([
       "--streaming",
       "--environment_type=LOOPBACK",
       "--runner=PrismRunner",
       #"--runner=PortableRunner", "--job_endpoint=localhost:8073",
       #"--environment_type=LOOPBACK",
       "--experiments=prism_enable_rtc",
       #"--runner=PortableRunner", "--job_endpoint=localhost:8073",
       "--prism_log_level=info",
       # Unsafe trigger: `AfterProcessingTime(delay=1)` may lose data. Reason: 
MAY_FINISH. This can be overriden with the --allow_unsafe_triggers flag.
       "--allow_unsafe_triggers",
   ])
   
   
   with beam.Pipeline(options=options) as p:
     _ = (
         p | TestStream().add_elements(elements=[1, 2, 3], event_timestamp=1000)
                         # .advance_watermark_to(2000)
                         # .add_elements(elements=[4, 5], event_timestamp=6000)
                         .advance_watermark_to(10000)
                         # .add_elements(elements=[10,], event_timestamp=52000)
                         # .advance_watermark_to(53000)
         | 'window' >> beam.WindowInto(
             FixedWindows(10 * 1000),
             #trigger=trigger.Repeatedly(trigger.AfterCount(3)),
             #trigger=trigger.AfterCount(2),
             #trigger=trigger.AfterWatermark(early=trigger.AfterCount(4)),
             #trigger=trigger.AfterWatermark(),
             trigger=trigger.Always(),
             accumulation_mode=trigger.AccumulationMode.DISCARDING)
         | beam.CombineGlobally(sum).without_defaults()
         | beam.LogElements(level=logging.WARNING,
             with_timestamp=True, with_window=True, with_pane_info=True, 
use_epoch_time=True))
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to