apache / seatunnel

SeaTunnel is a next-generation super high-performance, distributed, massive data integration tool.
https://seatunnel.apache.org/
Apache License 2.0
7.81k stars 1.76k forks source link

[Bug] [SqlserverCDC Source] Sqlserver CDC Don't support SqlSever type 'varbinary' yet, jdbcType:'-3'. #5544

Closed matianhe3 closed 10 months ago

matianhe3 commented 11 months ago

Search before asking

What happened

how to use cdc in the table contains varbinary type column.

SeaTunnel Version

2.3.3

SeaTunnel Config

source {
  SqlServer-CDC {
    result_table_name = source
    base-url = "jdbc:sqlserver://192.168.1.1:1433"
    database-names = ["testdb"]
    table-names = ["testdb.dbo.test"]
    username = sa
    password = ""
  }
}

Running Command

seatunnel.sh -c test.conf

Error Exception

Exception in thread "main" org.apache.seatunnel.core.starter.exception.CommandExecuteException: SeaTunnel job executed failed
    at org.apache.seatunnel.core.starter.seatunnel.command.ClientExecuteCommand.execute(ClientExecuteCommand.java:191)
    at org.apache.seatunnel.core.starter.SeaTunnel.run(SeaTunnel.java:40)
    at org.apache.seatunnel.core.starter.seatunnel.SeaTunnelClient.main(SeaTunnelClient.java:34)
Caused by: java.lang.UnsupportedOperationException: Don't support SqlSever type 'varbinary' yet, jdbcType:'-3'.
    at org.apache.seatunnel.connectors.seatunnel.cdc.sqlserver.source.utils.SqlServerTypeUtils.convertFromColumn(SqlServerTypeUtils.java:74)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
    at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
    at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
    at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
    at org.apache.seatunnel.connectors.seatunnel.cdc.sqlserver.source.utils.SqlServerTypeUtils.convertFromTable(SqlServerTypeUtils.java:88)
    at org.apache.seatunnel.connectors.seatunnel.cdc.sqlserver.source.source.SqlServerIncrementalSource.createDebeziumDeserializationSchema(SqlServerIncrementalSource.java:125)
    at org.apache.seatunnel.connectors.cdc.base.source.IncrementalSource.prepare(IncrementalSource.java:119)
    at org.apache.seatunnel.engine.core.parse.JobConfigParser.parseSource(JobConfigParser.java:85)
    at org.apache.seatunnel.engine.core.parse.MultipleTableJobConfigParser.parseSource(MultipleTableJobConfigParser.java:317)
    at org.apache.seatunnel.engine.core.parse.MultipleTableJobConfigParser.parse(MultipleTableJobConfigParser.java:179)
    at org.apache.seatunnel.engine.core.job.AbstractJobEnvironment.getLogicalDag(AbstractJobEnvironment.java:109)
    at org.apache.seatunnel.engine.client.job.JobExecutionEnvironment.execute(JobExecutionEnvironment.java:73)
    at org.apache.seatunnel.core.starter.seatunnel.command.ClientExecuteCommand.execute(ClientExecuteCommand.java:143)
    ... 2 more

Zeta or Flink or Spark Version

zeta 2.3.3

Java or Scala Version

No response

Screenshots

No response

Are you willing to submit PR?

Code of Conduct

Carl-Zhou-CN commented 11 months ago

link #5454

Carl-Zhou-CN commented 11 months ago

@matianhe3 Can you provide the corresponding ddl

matianhe3 commented 11 months ago

@matianhe3 Can you provide the corresponding ddl

CREATE TABLE testdb.dbo.test (
id int IDENTITY(0,1) NOT NULL,
test1 varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
test2 varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
test3 datetime NULL,
test4 varbinary(100) NULL,
CONSTRAINT test_PK PRIMARY KEY (id)
);
Carl-Zhou-CN commented 11 months ago

@matianhe3 Can you provide the corresponding ddl

CREATE TABLE testdb.dbo.test (
  id int IDENTITY(0,1) NOT NULL,
  test1 varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
  test2 varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
  test3 datetime NULL,
  test4 varbinary(100) NULL,
  CONSTRAINT test_PK PRIMARY KEY (id)
);

Thank you very much

github-actions[bot] commented 10 months ago

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] commented 10 months ago

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.