hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Tatarinov <>
Subject Hive assert()?
Date Thu, 26 May 2011 21:00:10 GMT
I would like to implement some kind of assert functionality in Hive QL.

Here is how I do it in MySQL. I can assert that a given query returns no
(bad) rows by creating a table with one row containing '1' and a unique
index. Then, I try to insert into that table select 1 from (query). If the
query returns something, I have an assert failure. I've found such asserts
very helpful in catching data bugs early.

Can I do something similar in Hive? I suppose I could implement a UDF that
fails if it gets executed. This way I can ensure there is no records
matching a given query.
That doesn't sound too bad but perhaps there is a cleaner solution.


View raw message