Skip to content

rowexec: implement deep copies for EncDatumRow #43182

@asubiotto

Description

@asubiotto

Throughout the row execution engine, there are interfaces that specify that a row may only be reused until the next call to a specific interface method. For example Next in RowSource or Row in RowIterator. Callers that want to buffer rows call CopyRow with the returned row for reuse.

CopyRow only performs a shallow copy. This is fine most of the time because processors tend to only reuse the EncDatum object, rather than any of its fields. However, #43145 ran into problems when trying to reuse the encoded field since the slice is not copied in CopyRow. This is dangerous because this could result in a row changing under the caller even after a CopyRow. To satisfy the interface contract, we need to implement deep copies for EncDatumRows.

To provide deep copies of EncDatum, we need to also add a Copy method to the Datum interface with implementations for each type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions