apache / apache/seatunnel

[Bug] [seatunnel-engine-examples] java.lang.ClassCastException: io.debezium.relational.TableId cannot be cast to io.debezium.relational.TableId

Open
#9,495 5 comments 0 reactions 0 assignees View on GitHub
bug FAQ
Dominant language
Java
Stars
9.7k
Forks
2.4k
Avg merge
3d 9h
Merged PRs (30d)
204

Description

### Search before asking

- [x] I had searched in the [issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22) and found no similar issues.

### What happened

An error occurred while executing org.apache.seatunnel.example.engine.SeaTunnelEngineLocalExample. This issue was previously raised and closed, but it has reappeared in the new version.

### SeaTunnel Version

2.3.11

### SeaTunnel Config

```conf
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
######
###### This config file is a demonstration of streaming processing in seatunnel config
######

env {
parallelism = 1
job.mode = "STREAMING"
checkpoint.interval = 10000
}

source{
MySQL-CDC {
base-url = "jdbc:mysql://192.168.2.23:3306/seatunnel_source?serverTimezone=GMT%2b8&useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true"
username = "root"
password = "123456"
table-names = ["seatunnel_source.emr_registered_patient_record"]
startup.mode = "initial"
}
}

transform {
}

sink {
Dhp {
url = "http://192.168.2.109:6018/restentrance/receive"
org_code = "210103"
domain_code = "xxhospital"
standardcode = "EMR_REGISTERED_PATIENT_RECORD"
headers {
sourceorgan = "210103"
sourcedomain = "xxhospital"
dhp-auth-type = "2"
dhp-license = "e8098acaf557412ea4ab9107cae61a5e"
dhp-test-marker = "0"
Content-Type = "application/json"
}
batch_size = 50
request_interval_ms = 500
}
}
```

### Running Command

```shell
使用idea执行org.apache.seatunnel.example.engine.SeaTunnelEngineLocalExample
```

### Error Exception

```log
java.lang.ClassCastException: io.debezium.relational.TableId cannot be cast to io.debezium.relational.TableId
at org.apache.seatunnel.connectors.seatunnel.cdc.mysql.utils.MySqlSchema.parseSnapshotDdl(MySqlSchema.java:166) ~[classes/:?]
at org.apache.seatunnel.connectors.seatunnel.cdc.mysql.utils.MySqlSchema.getTableSchemaByShowCreateTable(MySqlSchema.java:129) ~[classes/:?]
at org.apache.seatunnel.connectors.seatunnel.cdc.mysql.utils.MySqlSchema.readTableSchema(MySqlSchema.java:86) ~[classes/:?]
at org.apache.seatunnel.connectors.seatunnel.cdc.mysql.utils.MySqlSchema.getTableSchema(MySqlSchema.java:77) ~[classes/:?]
at org.apache.seatunnel.connectors.seatunnel.cdc.mysql.source.MySqlDialect.queryTableSchema(MySqlDialect.java:110) ~[classes/:?]
at org.apache.seatunnel.connectors.cdc.base.source.enumerator.splitter.AbstractJdbcSourceChunkSplitter.getSplitColumn(AbstractJdbcSourceChunkSplitter.java:388) ~[classes/:?]
at org.apache.seatunnel.connectors.cdc.base.source.enumerator.splitter.AbstractJdbcSourceChunkSplitter.generateSplits(AbstractJdbcSourceChunkSplitter.java:69) ~[classes/:?]
at org.apache.seatunnel.connectors.cdc.base.source.enumerator.SnapshotSplitAssigner.getNext(SnapshotSplitAssigner.java:185) ~[classes/:?]
at org.apache.seatunnel.connectors.cdc.base.source.enumerator.HybridSplitAssigner.getNext(HybridSplitAssigner.java:98) ~[classes/:?]
at org.apache.seatunnel.connectors.cdc.base.source.enumerator.IncrementalSourceEnumerator.assignSplits(IncrementalSourceEnumerator.java:172) ~[classes/:?]
at org.apache.seatunnel.connectors.cdc.base.source.enumerator.IncrementalSourceEnumerator.handleSplitRequest(IncrementalSourceEnumerator.java:82) ~[classes/:?]
at org.apache.seatunnel.engine.server.task.SourceSplitEnumeratorTask.requestSplit(SourceSplitEnumeratorTask.java:241) ~[classes/:?]
at org.apache.seatunnel.engine.server.task.operation.source.RequestSplitOperation.lambda$runInternal$0(RequestSplitOperation.java:62) ~[classes/:?]
at org.apache.seatunnel.common.utils.RetryUtils.retryWithException(RetryUtils.java:48) [classes/:?]
at org.apache.seatunnel.engine.server.task.operation.source.RequestSplitOperation.runInternal(RequestSplitOperation.java:52) [classes/:?]
at org.apache.seatunnel.engine.server.task.operation.TracingOperation.run(TracingOperation.java:42) [classes/:?]
at com.hazelcast.spi.impl.operationservice.Operation.call(Operation.java:189) [seatunnel-hazelcast-shade-2.3.12-SNAPSHOT.jar:2.3.12-SNAPSHOT]
at com.hazelcast.spi.impl.operationservice.impl.OperationRunnerImpl.call(OperationRunnerImpl.java:273) [seatunnel-hazelcast-shade-2.3.12-SNAPSHOT.jar:2.3.12-SNAPSHOT]
at com.hazelcast.spi.impl.operationservice.impl.OperationRunnerImpl.run(OperationRunnerImpl.java:248) [seatunnel-hazelcast-shade-2.3.12-SNAPSHOT.jar:2.3.12-SNAPSHOT]
at com.hazelcast.spi.impl.operationservice.impl.OperationRunnerImpl.run(OperationRunnerImpl.java:213) [seatunnel-hazelcast-shade-2.3.12-SNAPSHOT.jar:2.3.12-SNAPSHOT]
at com.hazelcast.spi.impl.operationexecutor.impl.OperationThread.process(OperationThread.java:175) [seatunnel-hazelcast-shade-2.3.12-SNAPSHOT.jar:2.3.12-SNAPSHOT]
at com.hazelcast.spi.impl.operationexecutor.impl.OperationThread.process(OperationThread.java:139) [seatunnel-hazelcast-shade-2.3.12-SNAPSHOT.jar:2.3.12-SNAPSHOT]
at com.hazelcast.spi.impl.operationexecutor.impl.OperationThread.executeRun(OperationThread.java:123) [seatunnel-hazelcast-shade-2.3.12-SNAPSHOT.jar:2.3.12-SNAPSHOT]
at com.hazelcast.internal.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:102) [seatunnel-hazelcast-shade-2.3.12-SNAPSHOT.jar:2.3.12-SNAPSHOT]
```

### Zeta or Flink or Spark Version

_No response_

### Java or Scala Version

_No response_

### Screenshots

_No response_

### Are you willing to submit PR?

- [x] Yes I am willing to submit a PR!

### Code of Conduct

- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with MySqlSchema.java, especially parseSnapshotDdl at line 166, and follow the MySQL-CDC schema path shown in the stack trace. Reproduce the failure by running org.apache.seatunnel.example.engine.SeaTunnelEngineLocalExample with the supplied configuration. Done means the example can process the snapshot without the ClassCastException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, mysql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.