Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-11417

Parquet and Avro sinks assume bytes types are byte[]

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.2.0
    • Component/s: None
    • Labels:
      None
    • Release Notes:
      Fixed a bug in Parquet and Avro File sinks that would cause them to fail if they received ByteBuffers instead of byte arrays.
    • Rank:
      1|i000zj:

      Description

      The Parquet and Avro sink plugins use a class StructuredToAvroTransformer that incorrectly assumes that fields of type Bytes are always a byte[]. If it is a ByteBuffer, you see:

      Caused by: java.lang.ClassCastException: java.nio.HeapByteBuffer cannot be cast to [B
      	at co.cask.hydrator.plugin.common.StructuredToAvroTransformer.transform(StructuredToAvroTransformer.java:75)
      	at co.cask.hydrator.plugin.common.StructuredToAvroTransformer.transform(StructuredToAvroTransformer.java:52)
      	at co.cask.hydrator.plugin.batch.sink.TimePartitionedFileSetDatasetParquetSink.transform(TimePartitionedFileSetDatasetParquetSink.java:67)
      	at co.cask.hydrator.plugin.batch.sink.TimePartitionedFileSetDatasetParquetSink.transform(TimePartitionedFileSetDatasetParquetSink.java:38)
      	at co.cask.cdap.etl.common.TrackedTransform.transform(TrackedTransform.java:61)
      	at co.cask.cdap.etl.batch.PipeTransformDetail.process(PipeTransformDetail.java:48)
      	... 24 more
      

        Attachments

          Activity

            People

            • Assignee:
              ashau Albert Shau
              Reporter:
              ashau Albert Shau
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: