(self, table_exprs, basic_select_item_exprs)
| 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''' |
no test coverage detected