Skip to content

Commit 1b8466e

Browse files
committed
follow comment
1 parent 3df019a commit 1b8466e

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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

sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/PruneHiveTablePartitionsSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class PruneHiveTablePartitionsSuite extends PrunePartitionSuiteBase {
3232
EliminateSubqueryAliases, new PruneHiveTablePartitions(spark)) :: Nil
3333
}
3434

35-
test("SPARK-15616 statistics pruned after going through PruneHiveTablePartitions") {
35+
test("SPARK-15616: statistics pruned after going through PruneHiveTablePartitions") {
3636
withTable("test", "temp") {
3737
sql(
3838
s"""

0 commit comments

Comments
 (0)