Skip to content

[Bug]: avro_dict_to_beam_row negative integer incorrectly converts to uint #34438

Open
@Abacn

Description

@Abacn

What happened?

Found in #34354 (comment) . The tests has been accidentally succeeding.

Print out the output pcollection of avro_dict_to_beam_row, it shows:

| beam.Map(avro_dict_to_beam_row(avro_schema, beam_schema))

Row(name='Henry', favorite_number=3, favorite_color='green')
Row(name='Toby', favorite_number=7, favorite_color='brown')
Row(name='Gordon', favorite_number=4, favorite_color='blue')
Row(name='Emily', favorite_number=4294967295, favorite_color='Red')
Row(name='Percy', favorite_number=6, favorite_color='Green')
Row(name='Bruce', favorite_number=None, favorite_color=None)

this happens to both before and after this change (#34354)

more suprisingly, when read back, it converts back to -1:

{'name': 'Thomas', 'favorite_number': 1, 'favorite_color': 'blue'}
{'name': 'Henry', 'favorite_number': 3, 'favorite_color': 'green'}
{'name': 'Toby', 'favorite_number': 7, 'favorite_color': 'brown'}
{'name': 'Gordon', 'favorite_number': 4, 'favorite_color': 'blue'}
{'name': 'Emily', 'favorite_number': -1, 'favorite_color': 'Red'}
{'name': 'Percy', 'favorite_number': 6, 'favorite_color': 'Green'}
{'name': 'Bruce', 'favorite_number': None, 'favorite_color': None}

Issue Priority

Priority: 2 (default / most bugs should be filed as P2)

Issue Components

  • Component: Python SDK
  • Component: Java SDK
  • Component: Go SDK
  • Component: Typescript SDK
  • Component: IO connector
  • Component: Beam YAML
  • Component: Beam examples
  • Component: Beam playground
  • Component: Beam katas
  • Component: Website
  • Component: Infrastructure
  • Component: Spark Runner
  • Component: Flink Runner
  • Component: Samza Runner
  • Component: Twister2 Runner
  • Component: Hazelcast Jet Runner
  • Component: Google Cloud Dataflow Runner

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions