apache / seatunnel

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

[Bug] [Zeta] A field type is Float64 and Nullable in Clickhouse, if the data value is NULL that seatunnel reads it as 0 #5055

Closed Henry75m39 closed 1 year ago

Henry75m39 commented 1 year ago

Search before asking

What happened

My clickhouse version is 22.2.3.1, Seatunnle is 2.3.1/2.3.2

A field type Float64 and Nullable we have declared in Clickhouse. When the data value is NULL, we found seatunnel read and sink it as '0' into a destination field of MySQL .

We monitor the console and see that all source values are 0 instead of NULL original values.

SeaTunnel Version

Seatunnle is 2.3.1/2.3.2

SeaTunnel Config

env {
  execution.parallelism = 1
  job.mode = "BATCH"
}

source {
  Clickhouse {
    host = "xxxxx:xxxx"
    database = "ods"
    sql = """
SELECT id,
           b.STRBAKCODE as code,
           a.ifundid,
           a.STRSCODE as strscode ,
           std_date,
           net_value,
           adj_net_value,
           cum_net_value,
           adj_cum_net_value,
           ten_thousand_income,
           seven_day_annualized_return          
    from
      (select
           INOFUNDSHARE  as   id,
           STRSCODE     ,
           IFUNDID         as ifundid,
           substring(SDTPERIOD,1,10)  as std_date,
           DDANWEIFENE     as net_value,
           DTIAOZHENGDWFE  as adj_net_value,
           DLEIJIFENE      as cum_net_value,
           DWFERATE_LJ  as adj_cum_net_value ,
           DWANFENSHOUYI   as ten_thousand_income,
           DNIANHUASHOUYI  as seven_day_annualized_return
      from ods.ods_jn_tbfundshareportion where toDate(SDTPERIOD) >= '2023-07-07') a
    left join(
             select distinct STRBAKCODE,STRSCODE
             from ods.ods_jn_tbcode
    ) b on upper(a.STRSCODE)=upper(b.STRSCODE) where code is not NULL
""" 
    username = "xxxxx"
    password = "xxxx"
    result_table_name = "test"
  }
}

sink {
Console {}}

Running Command

./bin/seatunnel.sh --config ./config/work/nav.conf -e local

Error Exception

No error message comes and exception occurred. program runs succeed.

Flink or Spark Version

No Flink, or Spark

Java or Scala Version

No response

Screenshots

image image

Are you willing to submit PR?

Code of Conduct

Henry75m39 commented 1 year ago

is there anybody look at this issue? it is blocker of our deployment in PRD env

jackyyyyyssss commented 1 year ago

you can see pr [Fix][Connector-V2][Clickhouse] fix clickhouse source connector read Nullable() type is not null,exam…

github-actions[bot] commented 1 year 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 1 year 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.