We bulk load data into a table with a not-null constraint on an integer column that stores IPs that have been converted with INET_ATON().
For example:
COPY counters (However, if an invalid IP is reached, which is an occasional issue, INET_ATON() returns NULL and the not-null constraint is breached, and the entire COPY is then rolled back.
slot_id,
ad_id,
date FORMAT 'YYYY.MM.DD HH:MI:SS.MS',
source_ip_name FILLER VARCHAR(15),
source_ip AS INET_ATON(source_ip_name)
) ...
I would like to have these rows rejected as if the data underlying source_ip was the wrong data-type - that way, Vertica rejects the invalid row, but imports all the other valid rows.
Currently we have to pre-validate the records. Are there any directives that can change this behaviour?
Alternatively, if anyone can think of a way to somehow pass a wrong data type to source_ip. e.g., a char instead of an integer, this would then trigger the desired row rejection behaviour. I've given it my best shot, but no joy.
Cheers,
Liam Clarke