beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oscar Korz (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (BEAM-3569) SpannerIO.write throws on delete mutations
Date Tue, 30 Jan 2018 18:53:00 GMT

     [ https://issues.apache.org/jira/browse/BEAM-3569?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oscar Korz updated BEAM-3569:
-----------------------------
    Component/s:     (was: runner-core)
                 sdk-java-gcp

> SpannerIO.write throws on delete mutations
> ------------------------------------------
>
>                 Key: BEAM-3569
>                 URL: https://issues.apache.org/jira/browse/BEAM-3569
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-gcp
>    Affects Versions: 2.2.0
>            Reporter: Oscar Korz
>            Assignee: Kenneth Knowles
>            Priority: Major
>         Attachments: beam-spanner-io-delete.tar.gz
>
>
> It is currently impossible to delete a Spanner row in Beam with SpannerIO. The exception
is generated by trying to guess the size of a delete mutation which cannot contain any values
(deletes are simply by key).
> The root exception stack trace:
> {code:java}
>  Caused by: java.lang.IllegalStateException: values() cannot be called for a DELETE
mutation
>   at com.google.common.base.Preconditions.checkState(Preconditions.java:456)
>   at com.google.cloud.spanner.Mutation.getValues(Mutation.java:233)
>   at org.apache.beam.sdk.io.gcp.spanner.MutationSizeEstimator.sizeOf(MutationSizeEstimator.java:33)
>   at org.apache.beam.sdk.io.gcp.spanner.MutationSizeEstimator.sizeOf(MutationSizeEstimator.java:51)
> {code}
> I believe this can be fixed by special casing MutationSizeEstimator.sizeOf to either
0 or 1 for Mutations with getOperation() = Op.DELETE.
> The workaround is to avoid using SpannerIO and use Spanner client API directly in a custom
DoFn, but this forces users to either reimplement all the intelligent batching that SpannerIO
does or suffer poor performance.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message