@@ -255,31 +255,31 @@ trait PredicateHelper extends Logging {
255255 * Convert an expression to conjunctive normal form when pushing predicates through Join,
256256 * when expand predicates, we can group by the qualifier avoiding generate unnecessary
257257 * expression to control the length of final result since there are multiple tables.
258- * @param condition condition need to be convert
259- * @return expression seq in conjunctive normal form of input expression, if length exceeds
260- * the threshold [[SQLConf.MAX_CNF_NODE_COUNT ]] or length != 1, return empty Seq
258+ *
259+ * @param condition condition need to be converted
260+ * @return the CNF result as sequence of disjunctive expressions. If the number of expressions
261+ * exceeds threshold on converting `Or`, `Seq.empty` is returned.
261262 */
262263 def conjunctiveNormalFormAndGroupExpsByQualifier (condition : Expression ): Seq [Expression ] = {
263- conjunctiveNormalForm(condition,
264- (expressions : Seq [Expression ]) =>
264+ conjunctiveNormalForm(condition, (expressions : Seq [Expression ]) =>
265265 expressions.groupBy(_.references.map(_.qualifier)).map(_._2.reduceLeft(And )).toSeq)
266266 }
267267
268268 /**
269- * Convert an expression to conjunctive normal form when pushing predicates for partition pruning,
270- * when expand predicates, we can group by the reference avoiding generate unnecessary expression
271- * to control the length of final result since here we just have one table . In partition pruning
272- * strategies, we split filters by [[splitConjunctivePredicates ]] and partition filters by judging
273- * if it's references is subset of partCols, if we combine expressions group by reference when
274- * expand predicate of [[Or ]], it won't impact final predicate pruning result since
269+ * Convert an expression to conjunctive normal form for predicate pushdown and partition pruning.
270+ * When expanding predicates, this method groups expressions by their references for reducing
271+ * the size of pushed down predicates and corresponding codegen . In partition pruning strategies,
272+ * we split filters by [[splitConjunctivePredicates ]] and partition filters by judging if it's
273+ * references is subset of partCols, if we combine expressions group by reference when expand
274+ * predicate of [[Or ]], it won't impact final predicate pruning result since
275275 * [[splitConjunctivePredicates ]] won't split [[Or ]] expression.
276- * @param condition condition need to be convert
277- * @return expression seq in conjunctive normal form of input expression, if length exceeds
278- * the threshold [[SQLConf.MAX_CNF_NODE_COUNT ]] or length != 1, return empty Seq
276+ *
277+ * @param condition condition need to be converted
278+ * @return the CNF result as sequence of disjunctive expressions. If the number of expressions
279+ * exceeds threshold on converting `Or`, `Seq.empty` is returned.
279280 */
280281 def conjunctiveNormalFormAndGroupExpsByReference (condition : Expression ): Seq [Expression ] = {
281- conjunctiveNormalForm(condition,
282- (expressions : Seq [Expression ]) =>
282+ conjunctiveNormalForm(condition, (expressions : Seq [Expression ]) =>
283283 expressions.groupBy(e => AttributeSet (e.references)).map(_._2.reduceLeft(And )).toSeq)
284284 }
285285
0 commit comments