Skip to content

Spark ReadTask is expensive to serialize #553

Closed

Description

@aokolnychyi

In some Spark jobs, we see a substantial scheduler delay. I assume it happens in TaskSetManager when Spark serializes Iceberg ReadTask. The latter contains a couple of large strings (if you have a lot of columns) and an instance of FileIO (which can contain a full Hadoop conf).

Activity

  1. aokolnychyi commented on Oct 17, 2019

    @aokolnychyi
    ContributorAuthor

    I can confirm the issue is resolved if we avoid serializing FileIO. The main question is how to achieve that with minimum changes.

  2. aokolnychyi commented on Oct 17, 2019

    @aokolnychyi
    ContributorAuthor

    As a short-term solution, we can broadcast EncryptionManager and FileIO in IcebergSource. Then Reader and ReadTask can store references to the broadcasted values and fetch actual ones in createPartitionReader while creating TaskDataReader. This seems to solve the scheduler delay issue.

    @rdblue thoughts?

  3. rdblue commented on Oct 18, 2019

    @rdblue
    Contributor

    Using a broadcast sounds good to me for now.

    Can you open a PR for this?

  4. aokolnychyi commented on Oct 18, 2019

    @aokolnychyi
    ContributorAuthor

    Will open a PR today

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

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