Skip to content

[Bug] select * T$binlog would throw ClassCastException on Spark #4686

@guluo2016

Description

@guluo2016

Search before asking

  • I searched in the issues and found nothing similar.

Paimon version

Paimon 1.0
paimon-spark-3.3-1.0-20241129.002716-51.jar

Compute Engine

Spark 3.3.4

Minimal reproduce step

In Spark, if we create table by the following sql:

use paimon;

CREATE TABLE T (
    id INT,
    name STRING
);

select * from `T$binlog`

we will get the following error:

Caused by: java.lang.ClassCastException: org.apache.paimon.types.IntType cannot be cast to org.apache.paimon.types.ArrayType
        at org.apache.paimon.utils.BulkFormatMapping$BulkFormatMappingBuilder.pruneDataType(BulkFormatMapping.java:189)
        at org.apache.paimon.utils.BulkFormatMapping$BulkFormatMappingBuilder.lambda$readDataFields$1(BulkFormatMapping.java:160)
        at java.util.Optional.ifPresent(Optional.java:159)

But if we create table by the following sql:

use paimon;

CREATE TABLE students (
    name STRING,
    age INT,
    course STRUCT<course_name: STRING, grade: DOUBLE>
)

select * from `students$binlog`

We can obtain the results normally.

I haven't found any similar errors in flink.

This bug may be caused by this change: #4269

What doesn't meet your expectations?

No exception

Anything else?

no

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions