seatunnel icon indicating copy to clipboard operation
seatunnel copied to clipboard

[Bug] [CDC] How to use schema evolution

Open jieerliansan opened this issue 3 years ago • 3 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

What happened

with version 2.3.3, when do ddl on source, Task failed.

SeaTunnel Version

2.3.3

SeaTunnel Config

env {
  # You can set flink configuration here
  execution.parallelism = 2
  job.mode = "STREAMING"
  checkpoint.interval = 10000
  #execution.checkpoint.interval = 10000
  #execution.checkpoint.data-uri = "hdfs://localhost:9000/checkpoint"
}

source {
  # This is a example source plugin **only for test and demonstrate the feature source plugin**
  MySQL-CDC {
        result_table_name = "fake"
        catalog = {
           factory = MySQL
        }
        debezium = {
           include.schema.changes = true
        }
        username = "xxx"
        password = "xxxx"
        database-name = ["d1"]
        table-names = ["d1.t2"]
        base-url = "jdbc:mysql://xxxx:3306/d1"
      }
  # If you would like to get more information about how to configure SeaTunnel and see full list of source plugins,
  # please go to https://seatunnel.apache.org/docs/category/source-v2
}

sink {
  #Console {
  # source_table_name = "fake"
  #}

    jdbc {
        url = "jdbc:mysql://yyyy:3306"
        driver = "com.mysql.cj.jdbc.Driver"
        user = "xxx"
        password = "xxxx"
        database = "d1"
        table = "t1"
        generate_sink_sql= true
        primary_keys = ["id"]
    }
  # If you would like to get more information about how to configure SeaTunnel and see full list of sink plugins,
  # please go to https://seatunnel.apache.org/docs/category/sink-v2
}

Running Command

./bin/seatunnel.sh --config ./config/cdc.conf

Error Exception

2023-09-26 11:46:51,808 INFO  org.apache.seatunnel.engine.server.dag.physical.PhysicalVertex - Job 11042506587776_job (758897160937799681), Pipeline: [(1/1)], task: [pipeline-1 [Source[0]-MySQL-CDC-Table11042387658240]-SourceTask (1/1)] turn to end state FAILED.
2023-09-26 11:46:51,808 ERROR org.apache.seatunnel.engine.server.dag.physical.PhysicalVertex - Job 11042506587776_job (758897160937799681), Pipeline: [(1/1)], task: [pipeline-1 [Source[0]-MySQL-CDC-Table11042387658240]-SourceTask (1/1)] end with state FAILED and Exception: java.lang.NullPointerException
        at org.apache.seatunnel.connectors.cdc.debezium.row.SeaTunnelRowDebeziumDeserializeSchema.deserializeSchemaChangeRecord(SeaTunnelRowDebeziumDeserializeSchema.java:119)
        at org.apache.seatunnel.connectors.cdc.debezium.row.SeaTunnelRowDebeziumDeserializeSchema.deserialize(SeaTunnelRowDebeziumDeserializeSchema.java:105)
        at org.apache.seatunnel.connectors.cdc.base.source.reader.IncrementalSourceRecordEmitter.emitElement(IncrementalSourceRecordEmitter.java:155)
        at org.apache.seatunnel.connectors.cdc.base.source.reader.IncrementalSourceRecordEmitter.processElement(IncrementalSourceRecordEmitter.java:124)
        at org.apache.seatunnel.connectors.cdc.base.source.reader.IncrementalSourceRecordEmitter.emitRecord(IncrementalSourceRecordEmitter.java:89)
        at org.apache.seatunnel.connectors.cdc.base.source.reader.IncrementalSourceRecordEmitter.emitRecord(IncrementalSourceRecordEmitter.java:55)
        at org.apache.seatunnel.connectors.seatunnel.common.source.reader.SourceReaderBase.pollNext(SourceReaderBase.java:108)
        at org.apache.seatunnel.connectors.cdc.base.source.reader.IncrementalSourceReader.pollNext(IncrementalSourceReader.java:98)
        at org.apache.seatunnel.engine.server.task.flow.SourceFlowLifeCycle.collect(SourceFlowLifeCycle.java:150)
        at org.apache.seatunnel.engine.server.task.SourceSeaTunnelTask.collect(SourceSeaTunnelTask.java:95)
        at org.apache.seatunnel.engine.server.task.SeaTunnelTask.stateProcess(SeaTunnelTask.java:168)
        at org.apache.seatunnel.engine.server.task.SourceSeaTunnelTask.call(SourceSeaTunnelTask.java:100)
        at org.apache.seatunnel.engine.server.TaskExecutionService$BlockingWorker.run(TaskExecutionService.java:613)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:750)

Zeta or Flink or Spark Version

zeta

Java or Scala Version

java 1.8.0_362

Screenshots

No response

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

jieerliansan avatar Sep 26 '23 04:09 jieerliansan

This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Nov 03 '23 00:11 github-actions[bot]

This issue has been closed because it has not received response for too long time. You could reopen it if you encountered similar problems in the future.

github-actions[bot] avatar Nov 10 '23 00:11 github-actions[bot]

This problem still exists.I encountered the same problem

pietiaonan avatar Feb 18 '24 07:02 pietiaonan