You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Corvin Deboeser (Jira)" <ji...@apache.org> on 2020/05/15 07:22:00 UTC

[jira] [Created] (BEAM-10004) ZeroDivisionError if source bundle smaller than 1mb

Corvin Deboeser created BEAM-10004:
--------------------------------------

             Summary: ZeroDivisionError if source bundle smaller than 1mb
                 Key: BEAM-10004
                 URL: https://issues.apache.org/jira/browse/BEAM-10004
             Project: Beam
          Issue Type: Bug
          Components: io-py-mongodb
    Affects Versions: 2.20.0
            Reporter: Corvin Deboeser
            Assignee: Yichi Zhang


If the desired_bundle_size is lower than 1mb, then split returns only SourceBundles with weight=0 which leads to a ZeroDivisionError down the line. 
{noformat}
ZeroDivisionError: float division by zero{noformat}

This error is raised from _compute_cumulative_weights here:

[https://github.com/apache/beam/blob/9f0cb649d39ee6236ea27f111acb4b66591a80ec/sdks/python/apache_beam/io/concat_source.py#L154]

 

Worked for me: Pulling the truncation from _get_split_keys ([here|https://github.com/apache/beam/blob/9f0cb649d39ee6236ea27f111acb4b66591a80ec/sdks/python/apache_beam/io/mongodbio.py#L226]) into split instead.

 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)