Skip to content

Prism windowed value coder #34830

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

Merged
merged 4 commits into from
May 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"https://github.com/apache/beam/pull/32648": "testing addition of Flink 1.19 support"
"https://github.com/apache/beam/pull/32648": "testing addition of Flink 1.19 support",
"https://github.com/apache/beam/pull/34830": "testing"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"https://github.com/apache/beam/pull/34830": "testing"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"https://github.com/apache/beam/pull/34830": "testing"
}
11 changes: 11 additions & 0 deletions sdks/go/pkg/beam/runners/prism/internal/coders.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,17 @@ func pullDecoderNoAlloc(c *pipepb.Coder, coders map[string]*pipepb.Coder) func(i
kd(r)
vd(r)
}
case urns.CoderWindowedValue:
ccids := c.GetComponentCoderIds()
if len(ccids) != 2 {
panic(fmt.Sprintf("WindowedValue coder with more than 2 components: %s", prototext.Format(c)))
}
ed := pullDecoderNoAlloc(coders[ccids[0]], coders)
wd := pullDecoderNoAlloc(coders[ccids[1]], coders)
return func(r io.Reader) {
ed(r)
wd(r)
}
case urns.CoderRow:
panic(fmt.Sprintf("Runner forgot to LP this Row Coder. %v", prototext.Format(c)))
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,15 @@ def test_reshuffle(self):
assert_that(
p | beam.Create([1, 2, 3]) | beam.Reshuffle(), equal_to([1, 2, 3]))

def test_reshuffle_after_custom_window(self):
with self.create_pipeline() as p:
assert_that(
p | beam.Create([12, 2, 1])
| beam.Map(lambda t: window.TimestampedValue(t, t))
| beam.WindowInto(beam.transforms.window.FixedWindows(2))
| beam.Reshuffle(),
equal_to([12, 2, 1]))

def test_flatten(self, with_transcoding=True):
with self.create_pipeline() as p:
if with_transcoding:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ def test_custom_merging_window(self):
def test_custom_window_type(self):
raise unittest.SkipTest("https://github.com/apache/beam/issues/21049")

def test_reshuffle_after_custom_window(self):
raise unittest.SkipTest("https://github.com/apache/beam/issues/34831")


if __name__ == '__main__':
# Run the tests.
Expand Down
Loading