hoangvu-ct commented on issue #26836:
URL: https://github.com/apache/beam/issues/26836#issuecomment-1567754693
@liferoad It seems like `beam.Create` does not reproduce the issue.
`beam.ReadFromTextFile` does:
```python
import apache_beam as beam
with beam.Pipeline() as pipeline:
batches_with_keys = (
pipeline
| "Create produce" >> beam.io.ReadFromText(file_pattern='test.jsonl')
| "Key by season" >> beam.Map(lambda e: (e["key"], e))
| "Group key" >> beam.GroupIntoBatches(2, 1)
| beam.Map(print)
)
```
The `test.jsonl` file:
```jsonl
{"key": "spring", "value": "🍓"}
{"key": "spring", "value": "🥕"}
{"key": "spring", "value": "🍆"}
{"key": "summer", "value": "🥕"}
{"key": "summer", "value": "🍅"}
{"key": "spring", "value": "🍅"}
{"key": "summer", "value": "🌽"}
{"key": "summer", "value": "🌽"}
{"key": "fall", "value": "🥕"}
{"key": "fall", "value": "🍅"}
{"key": "winter", "value": "🍆"}
```
--
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]