MCPcopy Create free account
hub / github.com/apache/impala / _create_having_clause

Method _create_having_clause

tests/comparison/query_generator.py:1317–1332  ·  view source on GitHub ↗
(self, table_exprs, basic_select_item_exprs)

Source from the content-addressed store, hash-verified

1315 return WhereClause(predicate)
1316
1317 def _create_having_clause(self, table_exprs, basic_select_item_exprs):
1318 if self.profile.only_use_aggregates_in_having_clause():
1319 predicate = self._create_agg_func_tree(Boolean)
1320 else:
1321 predicate, _ = self._create_boolean_func_tree()
1322 predicate = self.populate_func_with_vals(
1323 predicate, val_exprs=basic_select_item_exprs)
1324 # IMPALA-1423
1325 # Make sure any cols used have a table identifier. As of this writing the only
1326 # single table FROM clauses don't use table aliases. Setting a table alias
1327 # automatically propagates as a column table identifier ("t1.col" instead of "col").
1328 for arg in predicate.iter_exprs():
1329 if isinstance(arg, ValExpr) and arg.is_col and not arg.owner.alias:
1330 # TODO: Figure out if an alias is really needed.
1331 arg.owner.alias = self.get_next_id()
1332 return HavingClause(predicate)
1333
1334 def _enable_distinct_on_random_agg_items(self, agg_items):
1335 '''For each agg function, set it to be DISTINCT with some probability'''

Callers 1

generate_statementMethod · 0.95

Calls 7

_create_agg_func_treeMethod · 0.95
get_next_idMethod · 0.95
HavingClauseClass · 0.90
iter_exprsMethod · 0.45

Tested by

no test coverage detected