Skip to content

[Bug] RemoteTableQuery keySerializer should not include partition keys #8145

@jordepic

Description

@jordepic

Search before asking

  • I searched in the issues and found nothing similar.

Paimon version

When doing a lookup join to the remote query service (for primary key tables), we pass the partition keys, a bucket number, and a row to join to the existing table. Right now, serialization of the row fails because the serializer expected by the remote query service client assumes that the row includes partition fields, but we do not pass them (this is the same in LocalTableQuery, not a bug).

Let's change the key serializer here to avoid looking for partition keys.

Compute Engine

Flink

Minimal reproduce step

Use the remote query service to perform a lookup join from a flink row to a paimon table. The table must be partitioned, and the partitioned key and trimmed key must have different types (e.g. int vs. string). I'll include a test case in the PR that trips it up.

What doesn't meet your expectations?

java.lang.ClassCastException: class org.apache.paimon.data.BinaryString cannot be cast to class java.lang.Integer                                                                                   
        at org.apache.paimon.data.GenericRow.getInt(GenericRow.java:152)
        at org.apache.paimon.data.serializer.InternalRowSerializer.toBinaryRow(InternalRowSerializer.java:123)
        at org.apache.paimon.flink.query.RemoteTableQuery.lookup(RemoteTableQuery.java:73)

Anything else?

No response

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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions