Hi, a small doubt How to accept a null value as we...
# replication-troubleshooting
a
Hi, a small doubt How to accept a null value as well as a valid value for a particular column in dbt models? Eg - a date field can also contain null as well as date/ a double precision field can contain null as well as a number
@kelvin How did you solve it in your case while extracting data from raw json?
I’ve added
Copy code
cast(nullif(customer_delivery_pin_code, 0) as bigint) as customer_delivery_pin_code,
But it doesnt solve the problem
k
what is raw value of customer_delivery_pin_code?
Copy code
coalesce(nullif(customer_delivery_pin_code, '')::bigint,0) as customer_delivery_pin_code,
this is example if is empty string -> cast will be return null  -> coalesce to replace null value
a
gotcha… thanks for helping me out :)