Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 17 tasks
Abacn opened this issue Mar 26, 2025 · 2 comments
Open
1 of 17 tasks

Comments

@Abacn
Copy link
Contributor

Abacn commented Mar 26, 2025

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
@chamikaramj
Copy link
Contributor

@Abacn is this fixed by #34439 or do we need another fix ?

@Abacn
Copy link
Contributor Author

Abacn commented Mar 31, 2025

We need another fix. #34439 just makes the test happy. This bug is always here. In the test "(int32) -1" overflew twice so the test passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants