Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] [Connector-V2] 'KingBase' unsupported convert type 'float' of 'xxx' to SeaTunnel data type. #8381

Open
2 of 3 tasks
labilixin opened this issue Dec 25, 2024 · 0 comments
Labels

Comments

@labilixin
Copy link

Search before asking

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

What happened

When using kingbase as a source, one of my tables contains a field of type float4. When getting the field type, it seems that only float is left. The length information is lost, resulting in a mismatch in the field type.

kingbase作为source时,我一个表中包含字段float4类型。在获取字段类型时好像只留下了float。长度信息丢失了。导致字段类型匹配不上。

SeaTunnel Version

2.3.8

SeaTunnel Config

env {
  parallelism = 1
  job.mode = "BATCH"
}
source{
    jdbc {
	driver = "com.kingbase8.Driver"
	url = "jdbc:kingbase8://xxxx:54321/xxxx"
	user = "xxx"
        database = "public"
	password = "xxxx"
	query = "select * from xxxx"
    }
}

transform {
}
sink {
    Console {}
}

Running Command

bin/seatunnel.sh --config job/test2.config -m local

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:213)
	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: org.apache.seatunnel.api.table.factory.FactoryException: ErrorCode:[API-06], ErrorDescription:[Factory initialize failed] - Unable to create a source for identifier 'jdbc'.
	at org.apache.seatunnel.api.table.factory.FactoryUtil.createAndPrepareSource(FactoryUtil.java:101)
	at org.apache.seatunnel.engine.core.parse.MultipleTableJobConfigParser.parseSource(MultipleTableJobConfigParser.java:375)
	at org.apache.seatunnel.engine.core.parse.MultipleTableJobConfigParser.parse(MultipleTableJobConfigParser.java:209)
	at org.apache.seatunnel.engine.client.job.ClientJobExecutionEnvironment.getLogicalDag(ClientJobExecutionEnvironment.java:114)
	at org.apache.seatunnel.engine.client.job.ClientJobExecutionEnvironment.execute(ClientJobExecutionEnvironment.java:182)
	at org.apache.seatunnel.core.starter.seatunnel.command.ClientExecuteCommand.execute(ClientExecuteCommand.java:160)
	... 2 more
Caused by: org.apache.seatunnel.common.exception.SeaTunnelRuntimeException: ErrorCode:[COMMON-17], ErrorDescription:['KingBase' unsupported convert type 'float' of 'problem_discovery_rate' to SeaTunnel data type.]
	at org.apache.seatunnel.common.exception.CommonError.convertToSeaTunnelTypeError(CommonError.java:134)
	at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.dialect.kingbase.KingbaseTypeConverter.convert(KingbaseTypeConverter.java:92)
	at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.dialect.kingbase.KingbaseTypeMapper.mappingColumn(KingbaseTypeMapper.java:31)
	at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.dialect.JdbcDialectTypeMapper.mappingColumn(JdbcDialectTypeMapper.java:110)
	at org.apache.seatunnel.connectors.seatunnel.jdbc.catalog.utils.CatalogUtils.getTableSchema(CatalogUtils.java:202)
	at org.apache.seatunnel.connectors.seatunnel.jdbc.catalog.utils.CatalogUtils.getCatalogTable(CatalogUtils.java:222)
	at org.apache.seatunnel.connectors.seatunnel.jdbc.utils.JdbcCatalogUtils.getCatalogTable(JdbcCatalogUtils.java:362)
	at org.apache.seatunnel.connectors.seatunnel.jdbc.utils.JdbcCatalogUtils.getTables(JdbcCatalogUtils.java:133)
	at org.apache.seatunnel.connectors.seatunnel.jdbc.source.JdbcSource.<init>(JdbcSource.java:57)
	at org.apache.seatunnel.connectors.seatunnel.jdbc.source.JdbcSourceFactory.lambda$createSource$0(JdbcSourceFactory.java:80)
	at org.apache.seatunnel.api.table.factory.FactoryUtil.createAndPrepareSource(FactoryUtil.java:113)
	at org.apache.seatunnel.api.table.factory.FactoryUtil.createAndPrepareSource(FactoryUtil.java:74)

Zeta or Flink or Spark Version

No response

Java or Scala Version

No response

Screenshots

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@labilixin labilixin added the bug label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant