hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luke Lovett <luke.lov...@mongodb.com>
Subject Testing a HiveStoragePredicateHandler
Date Wed, 02 Sep 2015 17:26:48 GMT
I'm writing a HiveStoragePredicateHandler, and I'm trying to figure
out the most appropriate way to write unit tests for the
decomposePredicate method. I'm seeking advice for the best way to do
this.

The way I see it, there seem to be two obvious approaches:
1. Write a query as a string. Run it through the parser and optimizer,
then pass it into decomposePredicate. Assert something about the
return value.
2. Run an "explain" on a query and assert that the TableScan
"filterExpr" is what I expect, and that the Filter Operator's
predicate is what I expect.

I don't how to do (1), because I'm not sure what the appropriate
classes/methods are to parse and optimize a query, or how to figure
out this information. (2) sounds a lot easier, but I'm not sure that
this is the right approach, because I'm not completely sure how my
HiveStoragePredicateHandler directly affects the explain output.

Can anyone confirm that (2) is the right/wrong way to test a
HiveStoragePredicateHandler? Any advice on trying to test using method
(1)?

Many thanks in advance.

Mime
View raw message