0

RegexSerDe uses regular expression (regex) to deserialize data. It doesn't support data serialization. It can deserialize the data using regex and extracts groups as columns. In deserialization stage, if a row does not match the regex, then all columns in the row will be NULL. If a row matches the regex but has less than expected groups, the missing groups will be NULL. If a row matches the regex but has more than expected groups, the additional groups are just ignored.

How can I prevent insertion of NULL when there is a mismatch in the row and raise an exception?

dtolnay
  • 9,621
  • 5
  • 41
  • 62

1 Answers1

0
select  *

from    mytable

where   assert_true
        (
            mycol1 is not null
        or  mycol2 is not null
        or  mycol3 is not null
        ...
        )    
David דודו Markovitz
  • 42,900
  • 6
  • 64
  • 88