zechenj18 commented on code in PR #29590:
URL: https://github.com/apache/beam/pull/29590#discussion_r1419648267


##########
sdks/go/pkg/beam/core/runtime/exec/translate.go:
##########
@@ -411,11 +413,11 @@ func (b *builder) makePCollection(id string) 
(*PCollection, error) {
 }
 
 func (b *builder) newPCollectionNode(id string, out Node) (*PCollection, 
error) {
-       ec, _, err := b.makeCoderForPCollection(id)
+       ec, wc, err := b.makeCoderForPCollection(id)
        if err != nil {
                return nil, err
        }
-       u := &PCollection{UID: b.idgen.New(), Out: out, PColID: id, Coder: ec, 
Seed: rand.Int63()}
+       u := &PCollection{UID: b.idgen.New(), Out: out, PColID: id, Coder: ec, 
WindowCoder: wc, Seed: rand.Int63(), dataSampler: b.dataSampler}

Review Comment:
   I've added a TODO around there.
   If I'm understanding correctly, there are multiple times of decoding and 
encoding.
   (encoded)Data source ->(decode) FullValue ->(encode)Pcollection DataSampling 
-> runner -> (decode)ToString -> runner
   When talking about copy the bytes "raw" rather than decoding and 
re-encoding, may I ask which part you're referring to? My understanding is that 
we can
   1. copy the bytes "raw" for a sampled windowed value element in datasource.go
   2. maybe also extend 1 inside PCollection sampling logic



-- 
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]

Reply via email to