How to set multiple sources at same time in one task
Hi all: I use seatunnel to fetch data from multiple hive sources and write them to clickhouse. But the result is only the first table in source have been write to clickhouse. And I'm sure all other hive tables have data. My config file is just like below:
env {
spark.app.name = "seatunnel_2023-02-01"
spark.driver.cores = 2
spark.rpc.message.maxSize = 2047
spark.executor.instances = 200
spark.driver.maxResultSize="5g"
spark.driver.memory = "20g"
spark.executor.cores = 5
spark.executor.memory = "10g"
spark.sql.catalogImplementation = "hive"
}
source {
hive {
pre_sql = "select .... from A'"
parallelism = 6
table_name = "A"
metastore_uri = "xxxxx"
result_table_name = "result_table_A"
}
hive {
pre_sql = "select .... from B"
parallelism = 6
table_name = "B"
metastore_uri = "xxxxx"
result_table_name = "result_table_B"
}
transform {}
sink {
clickhouse {
host = "1xxxx"
database = "xx"
table = "sink_table"
fields = [....]
username = "default"
password = "default"
bulk_size = 4000000
clickhouse.socket_timeout = 300000
clickhouse.connection_timeout = 300000
clickhouse.dataTransferTimeout = 300000
retry = 3
}
}
I don't know why. Could someone help me ?
Thx!
Btw, The seatunnel version I used is 2.1.3.
maybe it not supported
maybe it not supported
@laglangyue But, I‘ve read the doc for 2.1.3, it says ' Multiple sources can be defined at the same time'. I'm not sure it can work correctly.
I think your sink part should be:
sink {
clickhouse {
host = "1xxxx"
database = "xx"
table = "sink_table"
fields = [....]
username = "default"
password = "default"
bulk_size = 4000000
clickhouse.socket_timeout = 300000
clickhouse.connection_timeout = 300000
clickhouse.dataTransferTimeout = 300000
retry = 3
source_table_name= result_table_A
}
clickhouse {
host = "1xxxx"
database = "xx"
table = "sink_table"
fields = [....]
username = "default"
password = "default"
bulk_size = 4000000
clickhouse.socket_timeout = 300000
clickhouse.connection_timeout = 300000
clickhouse.dataTransferTimeout = 300000
retry = 3
source_table_name= result_table_B
}
}
as zorrofox said,your source table is result_table_A and result_table_B
@zorrofox @laglangyue ok, I will try. Thanks
It works. Thanks again!