Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix comments about naming
  • Loading branch information
wangzhenhua committed May 12, 2017
commit eee74e7b95caac4c577333c0f884098fe7a43b75
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,10 @@ object QueryPlan extends PredicateHelper {
}

/** Normalize and reorder the expressions in the given sequence. */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do we reorder the predicates?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It links predicates with AND and pass it to def normalizeExprId, in which Canonicalize.execute is called. That's where we do the reordering.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Could you update the above comment, since this is a little bit confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I'll update the comments.

def canonicalizeExprSeq(exprSeq: Seq[Expression], output: AttributeSeq): Seq[Expression] = {
if (exprSeq.nonEmpty) {
val normalizedExprs = QueryPlan.normalizeExprId(exprSeq.reduce(And), output)
splitConjunctivePredicates(normalizedExprs)
def normalizePredicates(predicates: Seq[Expression], output: AttributeSeq): Seq[Expression] = {
if (predicates.nonEmpty) {
val normalized = normalizeExprId(predicates.reduce(And), output)
splitConjunctivePredicates(normalized)
} else {
Nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,8 @@ case class FileSourceScanExec(
relation,
output.map(QueryPlan.normalizeExprId(_, output)),
requiredSchema,
QueryPlan.canonicalizeExprSeq(partitionFilters, output),
QueryPlan.canonicalizeExprSeq(dataFilters, output),
QueryPlan.normalizePredicates(partitionFilters, output),
QueryPlan.normalizePredicates(dataFilters, output),
None)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ case class HiveTableScanExec(
HiveTableScanExec(
requestedAttributes.map(QueryPlan.normalizeExprId(_, input)),
relation.canonicalized.asInstanceOf[CatalogRelation],
QueryPlan.canonicalizeExprSeq(partitionPruningPred, input))(sparkSession)
QueryPlan.normalizePredicates(partitionPruningPred, input))(sparkSession)
}

override def otherCopyArgs: Seq[AnyRef] = Seq(sparkSession)
Expand Down