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

java.lang.ClassCastException when writing BYTES to BigQuery

Details

    • Bug
    • Status: Resolved
    • P2
    • Resolution: Fixed
    • 2.13.0
    • 2.14.0
    • io-java-gcp
    • None
    • 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

              viktor.gerdin Viktor Gerdin
              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