stak...@cloudera.com has uploaded a new patch set (#2).
Change subject: IMPALA-4101: qgen: Hive join predicates should only contains
IMPALA-4101: qgen: Hive join predicates should only contains equality functions
Hive only supports equi-joins in its JOIN clause, while Postgres and Impala
complex functions such as <, <=, >, >=, etc. This change modifies the
QueryGenerator._create_boolean_func_tree methods to only construct equality join
conditions under certain conditions.
The _create_boolean_func_tree method is invoked via
QueryGenerator -> create_query -> _create_from_clause -> _create_join_clause ->
_create_relational_join_condition -> _create_boolean_func_tree. This method is
when constructing the JOIN, WHERE, and HAVING clauses. It creates a tree of
that would typically be found in any of these clauses.
The parameter "signatures" is added to the method _create_boolean_func_tree,
and it lists
out all the allowed signatures the function is allowed to use. Previously, this
signatures was populated by calling _funcs_to_allowed_signatures(FUNCS), and if
"signatures" is not specified, then the code defaults back to the results of
A new method in the DefaultProfile called get_allowed_join_signatures is
returns a list of function signatures that are allowed within a JOIN clause. The
DefaultProfile allows all given signatures, while the HiveProfile only allows
Equals and And functions, as well as any function that operates over only one
The reason for these restrictions is that Hive only allows equality joins, does
OR operators in the join clause, and does not allow any operator that operates
Note that the _create_boolean_func_tree still allows for OR operators due to
around it's "and_or_fill_ratio" variable. The plan is to fix this in a future
specifically focuses on removing OR operators from Hive JOIN clauses.
Minor change to discrepancy_searcher so that the logs print out "Hive" instead
"Impala" when running against Hive.
* Added a new unit test that ensures the HiveProfile only returns equality joins
* Tested against Hive locally
* Tested against Impala via Leopard
* Tested against Impala via the Discrepancy Checker inside an Impala Docker
4 files changed, 110 insertions(+), 8 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/19/4419/2
To view, visit http://gerrit.cloudera.org:8080/4419
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings