Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-7542

java.lang.ClassCastException when writing BYTES to BigQuery

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 2.13.0
    • Fix Version/s: 2.14.0
    • Component/s: io-java-gcp
    • Labels:
      None
    • Environment:
      Running on OS X 10.14.5 (18F132), JRE 1.8.0_152, also in GCP DataFlow

      Description

      When trying to use BigQueryIO.write() with BigQueryUtils.toTableRow() with a BYTES field it breaks with

      java.lang.ClassCastException: [B cannot be cast to java.nio.ByteBuffer at org.apache.beam.sdk.io.gcp.bigquery.BigQueryUtils.fromBeamField(BigQueryUtils.java:280)

      BigQueryUtils.fromBeamField() attempts to cast fieldValue to java.nio.ByteBuffer but it is a byte[].

      Unit tests are not covering BYTES field type.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                viktor.gerdin Viktor Gerdin
                Reporter:
                viktor.gerdin Viktor Gerdin
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 24h
                  24h
                  Remaining:
                  Time Spent - 1h Remaining Estimate - 23h
                  23h
                  Logged:
                  Time Spent - 1h Remaining Estimate - 23h
                  1h