apache / seatunnel

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

[Bug] [Clickhouse] Cannot cast java.net.Inet4Address to java.lang.String #5434

Closed kayleyang closed 10 months ago

kayleyang commented 1 year ago

Search before asking

What happened

When i use seatunnel transfer data,source is clickhouse,but clickhouse have a column type is Array(Ipv4)

SeaTunnel Version

2.3.3

SeaTunnel Config

# Set the basic configuration of the task to be performed
env {
  execution.parallelism = 1
  job.mode = "BATCH"
}

# Create a source to connect to Clickhouse
source {
  Clickhouse {
    host = "xx.xx.xx.xx:8123"
    database = "xxx"
    sql = "select * from xxx order by timestamp desc limit 10"
    username = "default"
    password = "xxx"
    result_table_name = "test"
  }
}

# Console printing of the read Clickhouse data
sink {
  Console {
    parallelism = 1
  }
}

Running Command

$SEATUNNEL_HOME/bin/seatunnel.sh --config ch2console.batch.config

Error Exception

2023-09-06 14:23:25,789 ERROR org.apache.seatunnel.core.starter.SeaTunnel -
===============================================================================

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: org.apache.seatunnel.engine.common.exception.SeaTunnelEngineException: java.lang.ClassCastException: Cannot cast java.net.Inet4Address to java.lang.String
    at java.lang.Class.cast(Class.java:3369)
    at com.clickhouse.client.data.ClickHouseArrayValue.asArray(ClickHouseArrayValue.java:90)
    at org.apache.seatunnel.connectors.seatunnel.clickhouse.util.TypeConvertUtil.valueUnwrap(TypeConvertUtil.java:142)
    at org.apache.seatunnel.connectors.seatunnel.clickhouse.source.ClickhouseSourceReader.lambda$pollNext$0(ClickhouseSourceReader.java:90)
    at java.util.Iterator.forEachRemaining(Iterator.java:116)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
    at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
    at org.apache.seatunnel.connectors.seatunnel.clickhouse.source.ClickhouseSourceReader.pollNext(ClickhouseSourceReader.java:81)
    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:748)

    at org.apache.seatunnel.engine.client.job.ClientJobProxy.waitForJobComplete(ClientJobProxy.java:122)
    at org.apache.seatunnel.core.starter.seatunnel.command.ClientExecuteCommand.execute(ClientExecuteCommand.java:184)
    ... 2 more
2023-09-06 14:23:25,792 INFO  org.apache.seatunnel.core.starter.seatunnel.command.ClientExecuteCommand - run shutdown hook because get close signal

Zeta or Flink or Spark Version

No response

Java or Scala Version

No response

Screenshots

No response

Are you willing to submit PR?

Code of Conduct

EricJoy2048 commented 1 year ago

Thank you for your contribution. How has this issue progressed?

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.