[
https://issues.apache.org/jira/browse/BEAM-7542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16863576#comment-16863576
]
Valentyn Tymofieiev commented on BEAM-7542:
-------------------------------------------
I came across an integration test that exercises BYTES recently:
https://github.com/apache/beam/blob/82bf1ae76288b5c679beb58fa06a85b1dd3127d8/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryToTableIT.java#L92
, not sure if it covers the codepath discussed here. Note that Bigquery IO
expects BYTES to be base64-encoded by the user of the IO.
> java.lang.ClassCastException when writing BYTES to BigQuery
> -----------------------------------------------------------
>
> Key: BEAM-7542
> URL: https://issues.apache.org/jira/browse/BEAM-7542
> Project: Beam
> Issue Type: Bug
> Components: io-java-gcp
> Affects Versions: 2.13.0
> Environment: Running on OS X 10.14.5 (18F132), JRE 1.8.0_152, also in
> GCP DataFlow
> Reporter: Viktor Gerdin
> Assignee: Viktor Gerdin
> Priority: Major
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> When trying to use BigQueryIO.write() with BigQueryUtils.toTableRow() with a
> BYTES field it breaks with
> {noformat}
> java.lang.ClassCastException: [B cannot be cast to java.nio.ByteBuffer at
> org.apache.beam.sdk.io.gcp.bigquery.BigQueryUtils.fromBeamField(BigQueryUtils.java:280){noformat}
> BigQueryUtils.fromBeamField() attempts to cast fieldValue to
> java.nio.ByteBuffer but it is a byte[].
> Unit tests are not covering BYTES field type.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)