Skip to content

[Bug] pulsar_sync_table with topic-pattern takes the schema from a topic that does not match #11444

Backlog

Description

@LuciferYang

Search before asking

  • I searched in the issues and found nothing similar.

Paimon version

master (4dc01ac)

Compute Engine

Flink, pulsar_sync_table

Minimal reproduce step

  1. In one Pulsar namespace, create a topic audit_log and a topic orders_1, and write canal-json records with different columns to each.
  2. Start pulsar_sync_table with --pulsar_conf topic-pattern=orders_[0-9]+ so that the table is created from the topic data.

What doesn't meet your expectations?

The table schema is taken from audit_log, a topic that does not match the pattern. With --primary_keys set, the action fails:

IllegalArgumentException: For sink table ..., not all specified primary keys '[pt, _id]' exist in source tables or computed columns '[v0, v1]'.

Without primary keys the table gets audit_log's columns while the job reads orders_1.

PulsarActionUtils.findOneTopic lists the namespace's topics and passes the pattern to the broker only when it ends with .*. It then returns the first topic of the list without matching it against the pattern. The source itself subscribes only to matching topics, as TopicPatternSubscriber filters the same list.

Expected: the schema comes from a topic that matches topic-pattern.

Anything else?

KafkaActionUtils.findOneTopic already matches each topic against the pattern. PulsarDebeziumAvroDeserializationSchema uses the same Pulsar method to pick the schema registry subject.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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