Skip to content

[Bug] Hive SELECT on a BLOB column fails with ClassCastException #9076

Description

@thswlsqls

Search before asking

  • I searched in the issues and found nothing similar.

Paimon version
master @ a5e87eb (2.1-SNAPSHOT)

Compute Engine
Hive

Minimal reproduce step

  1. Create a Paimon table with a BLOB column and write one row.
  2. Read it from Hive: SELECT * FROM t;

The query always fails with:

java.lang.ClassCastException: org.apache.paimon.data.BlobData cannot be cast to [B

PaimonObjectInspectorFactory.create() groups case BLOB: with BINARY/VARBINARY and returns Hive's JavaBinaryObjectInspector, whose getPrimitiveJavaObject casts its input to byte[]. The read path hands it a Blob instead: InternalRow.createFieldGetter maps case BLOB: to row.getBlob(pos).

The Spark connector (DataConverter, ((Blob) o).toData()) and the Flink connector (FlinkRowDataWithBlob) already convert at the engine boundary; Hive is the only one missing it.

What doesn't meet your expectations?
Expected: reading a BLOB column from Hive returns its binary content.
Actual: every such query fails with ClassCastException.

Anything else?
Introduced by #8070, whose tests only feed byte[] directly, so the defect was never exercised.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions