peter-toth commented on code in PR #58635:
URL: https://github.com/apache/spark/pull/58635#discussion_r4536840958
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/InjectRuntimeFilter.scala:
##########
@@ -533,71 +673,297 @@ object InjectRuntimeFilter extends Rule[LogicalPlan]
with PredicateHelper with J
cannotFail(leafKey) && !reused.exists(_.exists(_.fastEquals(leaf)))
}
}
+ val bloomFilterEnabled = conf.runtimeFilterBloomFilterEnabled
+ lazy val cteDefs = cteDefinitions(plan)
plan transformUp {
+ case join: Join if isRuntimeFilterHintDecided(join.hint) => join
+ // Only a hinted join has anything to do with Bloom filters disabled or
once the number of
+ // filters is reached.
+ case join: Join if !hasRuntimeFilterHint(join.hint) &&
+ (!bloomFilterEnabled || filterCounter >= numFilterThreshold) => join
case join @ ExtractEquiJoinKeys(joinType, leftKeys, rightKeys, _, _,
left, right, hint) =>
var newLeft = left
var newRight = right
- leftKeys.lazyZip(rightKeys).foreach((l, r) => {
- lazy val keyDpps = dynamicPruningSubqueries(left, l) ++
dynamicPruningSubqueries(right, r)
- // Check if:
- // 1. The keys are simple cheap expressions
- // 2. There is no DPP filter on the key that physical planning may
keep
- if (filterCounter < numFilterThreshold &&
- isSimpleExpression(l) && isSimpleExpression(r) &&
!keyDpps.exists(isKept)) {
- val oldLeft = newLeft
- val oldRight = newRight
- // The creation side for a bloom filter on `key` of `side`. It
leaves out the key's own
- // DPP filters, which physical planning drops. An expression such
as a UDF or a `LIKE`
- // in their build plan would also stop the search for the creation
side, since
- // `isSimpleExpression` sees the plan of a subquery too. If the
key has DPP filters,
- // they are all dropped, so step 3 above applies. The bloom filter
evaluates its
- // creation side again, apart from the join. Its subquery can also
read more of that
- // side than the join does, since filters on other keys, DPP
filters or bloom filters,
- // can narrow only the join's side. And the bloom filter hashes
the bytes of the key, so
- // its type must compare by its bytes, which a collated string
does not.
- def creationSide(
- side: LogicalPlan,
- key: Expression,
- other: LogicalPlan,
- otherKey: Expression): Option[FilterCreationSide] =
- extractBeneficialFilterCreatePlan(
- side, withoutDppFilters(other, keyDpps.contains), key,
otherKey).filter { c =>
- keyDpps.isEmpty ||
(UnsafeRowUtils.isBinaryStable(key.dataType) &&
- canPushDown(key, side) && canEvaluateAgain(c))
+ if (isRuntimeFilterHintAmbiguous(hint)) {
+ reportHintNotApplied(join,
+ "the runtime filter source is ambiguous as both join sides are
hinted")
+ }
+ // A side hinted as the runtime filter source is the creation side, so
the filter is
+ // applied to the other side. An ambiguous hint is ignored, leaving
the heuristics to
+ // decide, and so is a hinted side that cannot be a runtime filter
source on any join key.
+ val hintedSource = runtimeFilterSourceSide(hint)
+ lazy val hintCheck = hintedSource.map { side =>
+ runtimeFilterHintCheck(if (side == BuildLeft) left else right,
cteDefs)
+ }
+ // Why the hinted side cannot prune the other side on the key pair `l`
and `r`.
+ def hintRejection(l: Expression, r: Expression, checkFunctions:
Boolean): Option[String] =
+ hintCheck.flatMap { check =>
+ if (hintedSource.contains(BuildRight)) check.rejection(l, r,
checkFunctions)
+ else check.rejection(r, l, checkFunctions)
+ }
+ // The DPP filters on each key pair that prune the left side and the
right side.
+ val keyFilters = leftKeys.lazyZip(rightKeys).map { (l, r) =>
+ (l, r, dynamicPruningFilters(left, l, r),
dynamicPruningFilters(right, r, l))
+ }
+ def honorHint(filters: Seq[DynamicPruningSubquery]): Boolean =
+
filters.exists(_.getTagValue(DynamicPruning.HONORS_RUNTIME_FILTER_HINT).isDefined)
+ // Why the hinted side cannot prune the other side on each key pair. A
key whose DPP
+ // filter honors the hint was accepted by [[PartitionPruning]], before
a filter pushed into
+ // the hinted side could change its analysis. A Bloom filter's
subquery is checked for the
+ // functions it calls once it is built.
+ val keyRejections = hintedSource.map { side =>
+ keyFilters.map { case (l, r, leftFilters, rightFilters) =>
+ if (honorHint(if (side == BuildRight) leftFilters else
rightFilters)) None
+ else hintRejection(l, r, checkFunctions = false)
+ }
+ }
+ val declinedReason =
+ keyRejections.flatMap(reasons => if (reasons.forall(_.isDefined))
reasons.head else None)
+ // A subquery cannot check a hinted side that reads a CTE of the outer
query, whose
+ // definition it does not have. An uncorrelated IN subquery is joined
with the rest of the
+ // query later, where the definition is visible, so the hint is
neither reported nor marked
+ // as decided here, and that pass decides it. A subquery that is
planned on its own, such
+ // as a scalar subquery, is not visited again, and its join stays as
without the hint.
+ val leftToOuterQuery = inSubquery &&
Review Comment:
**Finding 26.** This follows the change I suggested in 24, and I missed a
side effect. While the hint is deferred, `declinedReason` is set, so `hinted`
is false, and the subquery pass runs the heuristics on this join as if it were
unhinted. Once the join is in the outer query, that pass applies the hint.
`injectHintedFilter` then adds the hinted filter next to the heuristic one: its
one-filter-per-key check finds the heuristic filter in `applicationSide` too.
What I ran, with `applicationSideScanSizeThreshold=3000` and broadcast off:
```sql
WITH x AS MATERIALIZED (SELECT b1 AS k FROM bf1)
SELECT * FROM bf4 WHERE bf4.c4 IN (
SELECT /*+ RUNTIME_FILTER(d) */ bf3.c3 FROM bf3 JOIN
(SELECT bf2.c2 FROM bf2 JOIN x ON bf2.b2 = x.k WHERE bf2.a2 = 62) d
ON bf3.c3 = d.c2)
```
- With the hint, there are three Bloom filters, two of them on `bf3.c3`,
each with its own subquery over `d`.
- Without the hint, there are two, one of them on `bf3.c3`.
- The same hinted join at the top level gets one.
Leaving this join's filters to the outer pass while the hint is deferred
brings it down to two, and `InjectRuntimeFilterSuite` passes
(`InjectRuntimeFilter.scala:869`):
```scala
prunedKeys.filter(_ => !leftToOuterQuery).foreach { case (l, r,
keyDpps, honorsHint) =>
```
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/InjectRuntimeFilter.scala:
##########
@@ -533,71 +673,297 @@ object InjectRuntimeFilter extends Rule[LogicalPlan]
with PredicateHelper with J
cannotFail(leafKey) && !reused.exists(_.exists(_.fastEquals(leaf)))
}
}
+ val bloomFilterEnabled = conf.runtimeFilterBloomFilterEnabled
+ lazy val cteDefs = cteDefinitions(plan)
plan transformUp {
+ case join: Join if isRuntimeFilterHintDecided(join.hint) => join
+ // Only a hinted join has anything to do with Bloom filters disabled or
once the number of
+ // filters is reached.
+ case join: Join if !hasRuntimeFilterHint(join.hint) &&
+ (!bloomFilterEnabled || filterCounter >= numFilterThreshold) => join
case join @ ExtractEquiJoinKeys(joinType, leftKeys, rightKeys, _, _,
left, right, hint) =>
var newLeft = left
var newRight = right
- leftKeys.lazyZip(rightKeys).foreach((l, r) => {
- lazy val keyDpps = dynamicPruningSubqueries(left, l) ++
dynamicPruningSubqueries(right, r)
- // Check if:
- // 1. The keys are simple cheap expressions
- // 2. There is no DPP filter on the key that physical planning may
keep
- if (filterCounter < numFilterThreshold &&
- isSimpleExpression(l) && isSimpleExpression(r) &&
!keyDpps.exists(isKept)) {
- val oldLeft = newLeft
- val oldRight = newRight
- // The creation side for a bloom filter on `key` of `side`. It
leaves out the key's own
- // DPP filters, which physical planning drops. An expression such
as a UDF or a `LIKE`
- // in their build plan would also stop the search for the creation
side, since
- // `isSimpleExpression` sees the plan of a subquery too. If the
key has DPP filters,
- // they are all dropped, so step 3 above applies. The bloom filter
evaluates its
- // creation side again, apart from the join. Its subquery can also
read more of that
- // side than the join does, since filters on other keys, DPP
filters or bloom filters,
- // can narrow only the join's side. And the bloom filter hashes
the bytes of the key, so
- // its type must compare by its bytes, which a collated string
does not.
- def creationSide(
- side: LogicalPlan,
- key: Expression,
- other: LogicalPlan,
- otherKey: Expression): Option[FilterCreationSide] =
- extractBeneficialFilterCreatePlan(
- side, withoutDppFilters(other, keyDpps.contains), key,
otherKey).filter { c =>
- keyDpps.isEmpty ||
(UnsafeRowUtils.isBinaryStable(key.dataType) &&
- canPushDown(key, side) && canEvaluateAgain(c))
+ if (isRuntimeFilterHintAmbiguous(hint)) {
+ reportHintNotApplied(join,
+ "the runtime filter source is ambiguous as both join sides are
hinted")
+ }
+ // A side hinted as the runtime filter source is the creation side, so
the filter is
+ // applied to the other side. An ambiguous hint is ignored, leaving
the heuristics to
+ // decide, and so is a hinted side that cannot be a runtime filter
source on any join key.
+ val hintedSource = runtimeFilterSourceSide(hint)
+ lazy val hintCheck = hintedSource.map { side =>
+ runtimeFilterHintCheck(if (side == BuildLeft) left else right,
cteDefs)
+ }
+ // Why the hinted side cannot prune the other side on the key pair `l`
and `r`.
+ def hintRejection(l: Expression, r: Expression, checkFunctions:
Boolean): Option[String] =
+ hintCheck.flatMap { check =>
+ if (hintedSource.contains(BuildRight)) check.rejection(l, r,
checkFunctions)
+ else check.rejection(r, l, checkFunctions)
+ }
+ // The DPP filters on each key pair that prune the left side and the
right side.
+ val keyFilters = leftKeys.lazyZip(rightKeys).map { (l, r) =>
+ (l, r, dynamicPruningFilters(left, l, r),
dynamicPruningFilters(right, r, l))
+ }
+ def honorHint(filters: Seq[DynamicPruningSubquery]): Boolean =
+
filters.exists(_.getTagValue(DynamicPruning.HONORS_RUNTIME_FILTER_HINT).isDefined)
+ // Why the hinted side cannot prune the other side on each key pair. A
key whose DPP
+ // filter honors the hint was accepted by [[PartitionPruning]], before
a filter pushed into
+ // the hinted side could change its analysis. A Bloom filter's
subquery is checked for the
+ // functions it calls once it is built.
+ val keyRejections = hintedSource.map { side =>
+ keyFilters.map { case (l, r, leftFilters, rightFilters) =>
+ if (honorHint(if (side == BuildRight) leftFilters else
rightFilters)) None
+ else hintRejection(l, r, checkFunctions = false)
+ }
+ }
+ val declinedReason =
+ keyRejections.flatMap(reasons => if (reasons.forall(_.isDefined))
reasons.head else None)
+ // A subquery cannot check a hinted side that reads a CTE of the outer
query, whose
+ // definition it does not have. An uncorrelated IN subquery is joined
with the rest of the
+ // query later, where the definition is visible, so the hint is
neither reported nor marked
+ // as decided here, and that pass decides it. A subquery that is
planned on its own, such
+ // as a scalar subquery, is not visited again, and its join stays as
without the hint.
+ val leftToOuterQuery = inSubquery &&
+
keyRejections.exists(_.contains(Some(RuntimeFilterSourceAnalysis.OuterCte)))
+ if (!leftToOuterQuery)
declinedReason.foreach(reportHintNotApplied(join, _))
+ val hinted = hintedSource.isDefined && declinedReason.isEmpty
+ val injectLeftHinted = hinted && hintedSource.contains(BuildRight)
+ val injectRightHinted = hinted && hintedSource.contains(BuildLeft)
+ // The first reason the hint could not be applied on a key. The hinted
side is the same
+ // for every key, so the first reason is as representative as any.
+ var notAppliedReason: Option[String] = None
+ def hintBlocked(reason: => String): Unit = {
+ if (notAppliedReason.isEmpty) notAppliedReason = Some(reason)
+ }
+ lazy val hasShuffle = isProbablyShuffleJoin(left, right, hint)
+ // Tries to filter `applicationSide` with a filter built from
`creationSide`. Returns the
+ // filtered side, or `currentApplicationSide` when no filter was
added, recording the
+ // reason when this direction is the hinted one (`isHintedDirection`).
Requirements:
+ // 1. The application side is not a stream with a stateful operator
(`isStatefulStream`)
+ // 2. The join type supports pruning the application side
+ // 3. The application side is not the hinted source
(`isHintedSource`), which is never
+ // itself filtered
+ // 4. The join is a shuffle join, or a broadcast join with a shuffle
below it -- an
+ // estimate of whether the filter pays off, so a hint waives it
+ // 5. There is no Bloom filter on the application side's key yet,
unless the creation side
+ // is hinted and the filter on the key was built from another
creation side
+ def tryInject(
+ applicationSide: LogicalPlan,
+ currentApplicationSide: LogicalPlan,
+ applicationSideKey: Expression,
+ creationSide: LogicalPlan,
+ creationSideKey: Expression,
+ canPrune: Boolean,
+ isHintedDirection: Boolean,
+ isHintedSource: Boolean,
+ sideName: String,
+ keyDpps: Seq[DynamicPruningSubquery]): LogicalPlan = {
+ if (isStatefulStream(applicationSide)) {
+ if (isHintedDirection) {
+ hintBlocked(s"the $sideName side is a stream with a stateful
operator")
+ }
+ currentApplicationSide
+ } else if (!canPrune) {
+ if (isHintedDirection) {
+ // `ExistenceJoin.sql` throws, as the type never appears in SQL.
+ val joinDescription = joinType match {
+ case _: ExistenceJoin => "an existence"
+ case _ => s"a ${joinType.sql.toLowerCase(Locale.ROOT)}"
}
- // Check if:
- // 1. The current join type supports prune the left side with
runtime filter
- // 2. The current join is a shuffle join or a broadcast join that
- // has a shuffle below it
- // 3. There is no bloom filter on the left key yet
- val hasShuffle = isProbablyShuffleJoin(left, right, hint)
- if (canPruneLeft(joinType) && (hasShuffle ||
probablyHasShuffle(left)) &&
- !hasBloomFilter(newLeft, l)) {
- creationSide(left, l, right, r).foreach(c => newLeft =
injectFilter(l, newLeft, c))
+ hintBlocked(s"the $sideName side of $joinDescription join cannot
be pruned")
+ }
+ currentApplicationSide
+ } else if (isHintedDirection) {
+ injectHintedFilter(applicationSide, currentApplicationSide,
applicationSideKey,
+ creationSide, creationSideKey, keyDpps)
+ } else if (isHintedSource || !(hasShuffle ||
probablyHasShuffle(applicationSide)) ||
+ hasBloomFilter(currentApplicationSide, applicationSideKey)) {
+ currentApplicationSide
+ } else {
+ // The creation side leaves out the key's own DPP filters, which
physical planning
+ // drops, and every `onlyInBroadcast` DPP filter, e.g. one a join
above pushed into it:
+ // it finds no broadcast in the bloom filter's subquery and is
`true` there. An
+ // expression such as a UDF or a `LIKE` in their build plan would
also stop the search
+ // for the creation side, since `isSimpleExpression` sees the plan
of a subquery too.
+ // If the key has DPP filters, they are all dropped, so step 3
above applies. The
+ // bloom filter evaluates its creation side again, apart from the
join. Its subquery
+ // can also read more of that side than the join does, since
filters on other keys, DPP
+ // filters or bloom filters, can narrow only the join's side. And
the bloom filter
+ // hashes the bytes of the key, so its type must compare by its
bytes, which a collated
+ // string does not.
+ val creationPlan =
+ withoutDppFilters(creationSide, dpp => dpp.onlyInBroadcast ||
keyDpps.contains(dpp))
+ extractBeneficialFilterCreatePlan(
+ applicationSide, creationPlan, applicationSideKey,
creationSideKey)
+ .filter(c => keyDpps.isEmpty ||
+ (UnsafeRowUtils.isBinaryStable(applicationSideKey.dataType) &&
+ canPushDown(applicationSideKey, applicationSide) &&
canEvaluateAgain(c)))
+ .map(injectFilter(applicationSideKey, currentApplicationSide, _))
+ .getOrElse(currentApplicationSide)
+ }
+ }
+ // Filters `applicationSide` with a Bloom filter built from the hinted
`creationSide`.
+ def injectHintedFilter(
+ applicationSide: LogicalPlan,
+ currentApplicationSide: LogicalPlan,
+ applicationSideKey: Expression,
+ creationSide: LogicalPlan,
+ creationSideKey: Expression,
+ keyDpps: Seq[DynamicPruningSubquery]): LogicalPlan = {
+ lazy val creation = FilterCreationSide(
+ creationSideKey, creationSide, useMaterializedThreshold = false,
hinted = true)
+ if (!UnsafeRowUtils.isBinaryStable(applicationSideKey.dataType) ||
+ !UnsafeRowUtils.isBinaryStable(creationSideKey.dataType)) {
+ // The Bloom filter hashes the bytes of a key, which a collation
can compare as equal
+ // to other bytes (SPARK-58486).
+ hintBlocked("the join key has a collation the Bloom filter hash
does not follow")
+ currentApplicationSide
+ } else if (hasBloomFilter(currentApplicationSide,
applicationSideKey) &&
+ !hasBloomFilter(applicationSide, applicationSideKey)) {
+ // Unlike the heuristics, a hinted side adds its own filter even
on a key that already
+ // has one, but only one: this key got it on another key pair of
this join.
+ currentApplicationSide
+ } else if (keyDpps.nonEmpty && !canPushDown(applicationSideKey,
applicationSide)) {
+ // The key's DPP filters, which [[PartitionPruning]] added without
the hint, are all
+ // dropped, so step 3 above applies to the Bloom filter as without
the hint.
+ hintBlocked("a Bloom filter pushed down on the join key could fail
or change a " +
+ "broadcast that a DPP filter reuses")
+ currentApplicationSide
+ } else if (!hintedKeyCannotFail(applicationSideKey,
applicationSide)) {
Review Comment:
**Finding 25.** This checks the key on the side being pruned. The key on the
hinted side has the same problem by another path. The filter's subquery
evaluates the hinted side without the runtime filters that other joins push
into it, so it reads rows the join never reads:
- On the Bloom filter path, an `onlyInBroadcast` DPP filter that another
join pushed into the hinted side finds no broadcast in the subquery, so it is
`true` there.
- On the DPP path, `PartitionPruning` builds this join's filter bottom-up,
before the join above adds its own DPP filter to the hinted side
(`PartitionPruning.scala:366`).
What I ran, with ANSI on and broadcast off. `wd` is partitioned by `p`, with
`s = 'abc'` only in `p = 2`, and `wd2` has `x = 1` only for `p = 1`:
```sql
SELECT /*+ RUNTIME_FILTER(d), BROADCAST(wd2), MERGE(d) */ f.v
FROM wf f JOIN (SELECT CAST(s AS INT) AS k, p FROM wd) d ON f.part = d.k
JOIN wd2 ON d.p = wd2.p WHERE wd2.x = 1
```
| join key | hinted, AQE on | hinted, AQE off | without the hint |
|---|---|---|---|
| `f.part` (DPP filter) | `CAST_INVALID_INPUT` | `CAST_INVALID_INPUT` | 2000
rows |
| `f.k` (Bloom filter) | `CAST_INVALID_INPUT` | `CAST_INVALID_INPUT` | 2000
rows |
On master, all eight return 2000 rows.
I tried the same check on the hinted key:
`hintedKeyCannotFail(creationSideKey, creationSide)` here, in the kept-DPP
branch below, and in `honorsHint`. With it, the query returns its 2000 rows in
all four cases, but two tests fail:
- "accepts a creation side whose unstable values do not reach the key": the
check walks into the scalar subquery in `(SELECT max(c2) FROM bf2) AS c2` and
into the `sum(c2)` key, and refuses both.
- "takes local data, a range, literal rows and a command result": it refuses
`CAST(id AS INT)`, a narrowing cast that can fail, like the pruned keys that
55be0d6 moved to `TRY_CAST`.
So the hinted side probably needs its own form of the check, one that takes
an aggregate's or a subquery's result as a value instead of walking into it. A
filter of the hinted side that can fail is exposed the same way as its key.
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/joins.scala:
##########
@@ -653,3 +718,346 @@ trait JoinSelectionHelper extends Logging {
conf.getConfString("spark.sql.join.forceApplyShuffledHashJoin", "false")
== "true"
}
}
+
+/**
+ * Checks a join side as the source of hinted runtime filters, see
[[RuntimeFilterSourceAnalysis]].
+ */
+private[sql] trait RuntimeFilterHintCheck {
+
+ /**
+ * Why a runtime filter built from the side on `creationKey` cannot prune on
`applicationKey`, or
+ * None when it can. The filter evaluates the side and both keys separately
from the join, so all
+ * of them have to be repeatable. With `checkFunctions`, the side may call
no function the
+ * filter's subquery cannot evaluate, wherever it calls it: a DPP filter's
subquery runs the side
+ * as it is, while a Bloom filter's is column-pruned first and checked again.
+ */
+ def rejection(
+ applicationKey: Expression,
+ creationKey: Expression,
+ checkFunctions: Boolean = true): Option[String]
+}
+
+/**
+ * Decides whether a plan can serve as the source of a runtime filter on a
join key. A runtime
+ * filter evaluates its source separately from the join, so the rows the
source produces and the
+ * key values they carry must be the same in both evaluations, or the filter
could prune rows the
+ * join itself matches. `deterministic` is not enough for that: Spark flags
order-dependent
+ * computations such as first, last, row_number or an unordered LIMIT as
deterministic, and a leaf
+ * such as an RDD that is not checkpointed may return different rows on each
computation.
+ *
+ * The plan is walked bottom-up, tracking:
+ * 1. output attributes whose values are unstable: they come from a
non-deterministic expression,
+ * an order-dependent aggregate or window function, a subquery whose plan
fails this same
+ * analysis, a file metadata column, some of whose fields depend on how a
scan splits its
+ * files, or an expression over such an attribute;
+ * 2. whether the row multiplicity is unstable, i.e. every row is still
present but may be
+ * repeated a different number of times, which an outer generate with an
unstable generator,
+ * or an aggregate grouping on an unstable value, causes and which makes
every aggregate over
+ * the rows unstable.
+ *
+ * The plan is rejected outright when its row set is unstable (a filter or
join condition consumes
+ * an unstable attribute, an inner generate uses an unstable generator, any
limit, offset or
+ * sample), when a leaf cannot promise the same rows again, and, each with its
own reason, when it
+ * calls a function the filter subquery cannot evaluate, when an operator
would duplicate an
+ * observation or is not analyzed. The source qualifies when the key references
+ * no unstable attribute. Values that are unstable but only carried to the
output (a `first(name)`
+ * next to a `GROUP BY id`, a row number next to the key) do not disqualify
it. A CTE that is not
+ * inlined is evaluated from its definition wherever it is read, unless
exchange reuse shares one
+ * evaluation, so it is analyzed through its definition in `cteDefs`.
+ */
+private[optimizer] class RuntimeFilterSourceAnalysis(
+ side: LogicalPlan,
+ cteDefs: Map[Long, CTERelationDef]) extends RuntimeFilterHintCheck {
+ import RuntimeFilterSourceAnalysis._
+
+ private lazy val sideCallsExtractedFunction = containsExtractedFunction(side)
+
+ private lazy val sideTaint = analyze(side)
+
+ override def rejection(
+ applicationKey: Expression,
+ creationKey: Expression,
+ checkFunctions: Boolean): Option[String] = {
+ if (!isStable(applicationKey, AttributeSet.empty)) {
+ Some("the join key may take different values when evaluated again")
+ } else if (side.isStreaming) {
+ Some("the hinted side is a stream")
+ } else if ((checkFunctions && sideCallsExtractedFunction) ||
+ // A DPP filter evaluates the key in its own subquery, which no UDF
extraction rewrites.
+ creationKey.containsAnyPattern(PYTHON_UDF, EXTERNAL_UDF)) {
+ Some(ExtractedFunction)
+ } else {
+ sideTaint match {
+ case Left(reason) => Some(reason)
+ case Right(t) if !isStable(creationKey, t.unstable) =>
Some(NotRepeatable)
+ case _ => None
+ }
+ }
+ }
+
+ /**
+ * Whether `e` yields the same value on every evaluation. A subquery counts
as deterministic
+ * when its plan is, which is the very check this analysis replaces, so its
plan is analyzed
+ * too.
+ */
+ private def isStable(e: Expression, unstable: AttributeSet): Boolean = {
+ e.deterministic && e.references.intersect(unstable).isEmpty && !e.exists {
+ case s: SubqueryExpression => !isRepeatableSubquery(s)
+ case _ => false
+ }
+ }
+
+ /**
+ * A subquery is repeatable when its row set is, and so is whatever of its
output the subquery
+ * exposes: the build keys of a DPP filter, nothing but existence for
EXISTS, the output columns
+ * otherwise. A scalar subquery fails on more than one row, so its
multiplicity counts too.
+ */
+ private def isRepeatableSubquery(s: SubqueryExpression): Boolean = {
+ !s.plan.isStreaming && analyze(s.plan).exists { t =>
+ s match {
+ case d: DynamicPruningSubquery =>
+ d.broadcastKeyIndices.forall(i => isStable(d.buildKeys(i),
t.unstable))
+ case _: Exists => true
+ case _: ScalarSubquery =>
+ !t.unstableMultiplicity &&
s.plan.outputSet.intersect(t.unstable).isEmpty
+ case _ => s.plan.outputSet.intersect(t.unstable).isEmpty
+ }
+ }
+ }
+
+ /** Returns the taint of `plan`'s output, or the reason its row set is not
repeatable. */
+ private def analyze(plan: LogicalPlan): Either[String, Taint] = plan match {
+ // Whether a materialized leaf returns the same rows is known only once it
is materialized.
+ case m: MaterializedLeafNode if m.materializedMetadata.isEmpty =>
+ Left(s"the hinted side reads ${m.nodeName}, which is not materialized
yet")
+
+ // `V2ScanRelationPushDown` marks a scan repeatable unless the source
absorbed an operator from
+ // the hinted side that picks its rows, which the reason names as the
likely cause. A scan built
+ // elsewhere, such as the target scan of a copy-on-write DELETE, UPDATE or
MERGE, is not marked.
+ case s: DataSourceV2ScanRelation if !s.isOutputRepeatable =>
+ Left(s"the hinted side reads ${s.name}, which may return different rows
when evaluated " +
+ "again, e.g. with an aggregate, limit, offset, top-N or sample pushed
into the source")
+
+ case r: CTERelationRef if r.recursive =>
+ Left("the hinted side reads a recursive CTE, which cannot be checked for
repeatability")
+
+ case r: CTERelationRef => cteDefs.get(r.cteId) match {
+ case Some(cteDef) => analyze(cteDef.child).map { t =>
+ val unstable = r.output.zip(cteDef.child.output).collect {
+ case (attr, defAttr) if t.unstable.contains(defAttr) => attr
+ }
+ Taint(AttributeSet(unstable), t.unstableMultiplicity)
+ }
+ case None => Left(OuterCte)
+ }
+
+ case l: LeafNode =>
+ if (l.isOutputRepeatable) {
+ // A file metadata column has fields, such as
`_metadata.file_block_start`, that depend on
+ // how the scan splits its files, which the filter's own scan of the
side can do
+ // differently.
+ Right(Taint(AttributeSet(
+ l.output.filter(a =>
FileSourceMetadataAttribute.isValid(a.metadata)))))
+ } else {
+ Left(s"the hinted side reads ${l.nodeName}, which may return different
rows when " +
+ "evaluated again")
+ }
+
+ case p: Project => analyze(p.child).map { t =>
+ t.copy(unstable =
+ AttributeSet(p.projectList.filterNot(isStable(_,
t.unstable)).map(_.toAttribute)))
+ }
+
+ case f: Filter => analyze(f.child).flatMap { t =>
+ if (isStable(f.condition, t.unstable)) Right(t) else Left(NotRepeatable)
+ }
+
+ case j: Join => analyze(j.left).flatMap { l =>
+ analyze(j.right).flatMap { r =>
+ val unstable = l.unstable ++ r.unstable
+ if (j.condition.forall(isStable(_, unstable))) {
+ Right(Taint(unstable, l.unstableMultiplicity ||
r.unstableMultiplicity))
+ } else {
+ Left(NotRepeatable)
+ }
+ }
+ }
+
+ case a: Aggregate => analyze(a.child).map { t =>
+ // Grouping on an unstable value changes which rows form a group, and
unstable multiplicity
+ // changes how many rows each group has, so every aggregate result then
depends on them; a
+ // grouping expression's own value is as stable as its input. With
stable grouping the
+ // groups occur once each, whatever the input multiplicity; with
unstable grouping, the
+ // number of groups that share the stable grouping values varies.
+ val stableGroups = a.groupingExpressions.forall(isStable(_, t.unstable))
+ // A group of values that are equal but not identical, e.g. under a
case-insensitive
+ // collation, outputs whichever of them arrives first.
+ val representatives = AttributeSet(a.groupingExpressions
Review Comment:
**Finding 29.** `representatives` marks a column grouped on a collated
string as unstable, which is right for the column itself. But a join on it
compares `collationkey(k)`, which is the same for every representative of a
group. So the key is stable, and the hint is refused for a reason that does not
hold.
Hinted side, joined on a `UTF8_LCASE` column:
| hinted side | result |
|---|---|
| `cd` | Bloom filter |
| `SELECT DISTINCT k FROM cd` | refused: "the hinted side may produce
different rows or join keys when evaluated again" |
| `SELECT k, count(*) FROM cd GROUP BY k` | refused, same reason |
The hints page says a collated column qualifies. One way out: keep these
columns apart from the other unstable ones, and accept a key that reads them
only through `CollationKey`.
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/InjectRuntimeFilter.scala:
##########
@@ -533,71 +673,297 @@ object InjectRuntimeFilter extends Rule[LogicalPlan]
with PredicateHelper with J
cannotFail(leafKey) && !reused.exists(_.exists(_.fastEquals(leaf)))
}
}
+ val bloomFilterEnabled = conf.runtimeFilterBloomFilterEnabled
+ lazy val cteDefs = cteDefinitions(plan)
plan transformUp {
+ case join: Join if isRuntimeFilterHintDecided(join.hint) => join
+ // Only a hinted join has anything to do with Bloom filters disabled or
once the number of
+ // filters is reached.
+ case join: Join if !hasRuntimeFilterHint(join.hint) &&
+ (!bloomFilterEnabled || filterCounter >= numFilterThreshold) => join
case join @ ExtractEquiJoinKeys(joinType, leftKeys, rightKeys, _, _,
left, right, hint) =>
var newLeft = left
var newRight = right
- leftKeys.lazyZip(rightKeys).foreach((l, r) => {
- lazy val keyDpps = dynamicPruningSubqueries(left, l) ++
dynamicPruningSubqueries(right, r)
- // Check if:
- // 1. The keys are simple cheap expressions
- // 2. There is no DPP filter on the key that physical planning may
keep
- if (filterCounter < numFilterThreshold &&
- isSimpleExpression(l) && isSimpleExpression(r) &&
!keyDpps.exists(isKept)) {
- val oldLeft = newLeft
- val oldRight = newRight
- // The creation side for a bloom filter on `key` of `side`. It
leaves out the key's own
- // DPP filters, which physical planning drops. An expression such
as a UDF or a `LIKE`
- // in their build plan would also stop the search for the creation
side, since
- // `isSimpleExpression` sees the plan of a subquery too. If the
key has DPP filters,
- // they are all dropped, so step 3 above applies. The bloom filter
evaluates its
- // creation side again, apart from the join. Its subquery can also
read more of that
- // side than the join does, since filters on other keys, DPP
filters or bloom filters,
- // can narrow only the join's side. And the bloom filter hashes
the bytes of the key, so
- // its type must compare by its bytes, which a collated string
does not.
- def creationSide(
- side: LogicalPlan,
- key: Expression,
- other: LogicalPlan,
- otherKey: Expression): Option[FilterCreationSide] =
- extractBeneficialFilterCreatePlan(
- side, withoutDppFilters(other, keyDpps.contains), key,
otherKey).filter { c =>
- keyDpps.isEmpty ||
(UnsafeRowUtils.isBinaryStable(key.dataType) &&
- canPushDown(key, side) && canEvaluateAgain(c))
+ if (isRuntimeFilterHintAmbiguous(hint)) {
+ reportHintNotApplied(join,
+ "the runtime filter source is ambiguous as both join sides are
hinted")
+ }
+ // A side hinted as the runtime filter source is the creation side, so
the filter is
+ // applied to the other side. An ambiguous hint is ignored, leaving
the heuristics to
+ // decide, and so is a hinted side that cannot be a runtime filter
source on any join key.
+ val hintedSource = runtimeFilterSourceSide(hint)
+ lazy val hintCheck = hintedSource.map { side =>
+ runtimeFilterHintCheck(if (side == BuildLeft) left else right,
cteDefs)
+ }
+ // Why the hinted side cannot prune the other side on the key pair `l`
and `r`.
+ def hintRejection(l: Expression, r: Expression, checkFunctions:
Boolean): Option[String] =
+ hintCheck.flatMap { check =>
+ if (hintedSource.contains(BuildRight)) check.rejection(l, r,
checkFunctions)
+ else check.rejection(r, l, checkFunctions)
+ }
+ // The DPP filters on each key pair that prune the left side and the
right side.
+ val keyFilters = leftKeys.lazyZip(rightKeys).map { (l, r) =>
+ (l, r, dynamicPruningFilters(left, l, r),
dynamicPruningFilters(right, r, l))
+ }
+ def honorHint(filters: Seq[DynamicPruningSubquery]): Boolean =
+
filters.exists(_.getTagValue(DynamicPruning.HONORS_RUNTIME_FILTER_HINT).isDefined)
+ // Why the hinted side cannot prune the other side on each key pair. A
key whose DPP
+ // filter honors the hint was accepted by [[PartitionPruning]], before
a filter pushed into
+ // the hinted side could change its analysis. A Bloom filter's
subquery is checked for the
+ // functions it calls once it is built.
+ val keyRejections = hintedSource.map { side =>
+ keyFilters.map { case (l, r, leftFilters, rightFilters) =>
+ if (honorHint(if (side == BuildRight) leftFilters else
rightFilters)) None
+ else hintRejection(l, r, checkFunctions = false)
+ }
+ }
+ val declinedReason =
+ keyRejections.flatMap(reasons => if (reasons.forall(_.isDefined))
reasons.head else None)
+ // A subquery cannot check a hinted side that reads a CTE of the outer
query, whose
+ // definition it does not have. An uncorrelated IN subquery is joined
with the rest of the
+ // query later, where the definition is visible, so the hint is
neither reported nor marked
+ // as decided here, and that pass decides it. A subquery that is
planned on its own, such
+ // as a scalar subquery, is not visited again, and its join stays as
without the hint.
+ val leftToOuterQuery = inSubquery &&
+
keyRejections.exists(_.contains(Some(RuntimeFilterSourceAnalysis.OuterCte)))
+ if (!leftToOuterQuery)
declinedReason.foreach(reportHintNotApplied(join, _))
+ val hinted = hintedSource.isDefined && declinedReason.isEmpty
+ val injectLeftHinted = hinted && hintedSource.contains(BuildRight)
+ val injectRightHinted = hinted && hintedSource.contains(BuildLeft)
+ // The first reason the hint could not be applied on a key. The hinted
side is the same
+ // for every key, so the first reason is as representative as any.
+ var notAppliedReason: Option[String] = None
+ def hintBlocked(reason: => String): Unit = {
+ if (notAppliedReason.isEmpty) notAppliedReason = Some(reason)
+ }
+ lazy val hasShuffle = isProbablyShuffleJoin(left, right, hint)
+ // Tries to filter `applicationSide` with a filter built from
`creationSide`. Returns the
+ // filtered side, or `currentApplicationSide` when no filter was
added, recording the
+ // reason when this direction is the hinted one (`isHintedDirection`).
Requirements:
+ // 1. The application side is not a stream with a stateful operator
(`isStatefulStream`)
+ // 2. The join type supports pruning the application side
+ // 3. The application side is not the hinted source
(`isHintedSource`), which is never
+ // itself filtered
+ // 4. The join is a shuffle join, or a broadcast join with a shuffle
below it -- an
+ // estimate of whether the filter pays off, so a hint waives it
+ // 5. There is no Bloom filter on the application side's key yet,
unless the creation side
+ // is hinted and the filter on the key was built from another
creation side
+ def tryInject(
+ applicationSide: LogicalPlan,
+ currentApplicationSide: LogicalPlan,
+ applicationSideKey: Expression,
+ creationSide: LogicalPlan,
+ creationSideKey: Expression,
+ canPrune: Boolean,
+ isHintedDirection: Boolean,
+ isHintedSource: Boolean,
+ sideName: String,
+ keyDpps: Seq[DynamicPruningSubquery]): LogicalPlan = {
+ if (isStatefulStream(applicationSide)) {
+ if (isHintedDirection) {
+ hintBlocked(s"the $sideName side is a stream with a stateful
operator")
+ }
+ currentApplicationSide
+ } else if (!canPrune) {
+ if (isHintedDirection) {
+ // `ExistenceJoin.sql` throws, as the type never appears in SQL.
+ val joinDescription = joinType match {
+ case _: ExistenceJoin => "an existence"
+ case _ => s"a ${joinType.sql.toLowerCase(Locale.ROOT)}"
}
- // Check if:
- // 1. The current join type supports prune the left side with
runtime filter
- // 2. The current join is a shuffle join or a broadcast join that
- // has a shuffle below it
- // 3. There is no bloom filter on the left key yet
- val hasShuffle = isProbablyShuffleJoin(left, right, hint)
- if (canPruneLeft(joinType) && (hasShuffle ||
probablyHasShuffle(left)) &&
- !hasBloomFilter(newLeft, l)) {
- creationSide(left, l, right, r).foreach(c => newLeft =
injectFilter(l, newLeft, c))
+ hintBlocked(s"the $sideName side of $joinDescription join cannot
be pruned")
+ }
+ currentApplicationSide
+ } else if (isHintedDirection) {
+ injectHintedFilter(applicationSide, currentApplicationSide,
applicationSideKey,
+ creationSide, creationSideKey, keyDpps)
+ } else if (isHintedSource || !(hasShuffle ||
probablyHasShuffle(applicationSide)) ||
+ hasBloomFilter(currentApplicationSide, applicationSideKey)) {
+ currentApplicationSide
+ } else {
+ // The creation side leaves out the key's own DPP filters, which
physical planning
+ // drops, and every `onlyInBroadcast` DPP filter, e.g. one a join
above pushed into it:
+ // it finds no broadcast in the bloom filter's subquery and is
`true` there. An
+ // expression such as a UDF or a `LIKE` in their build plan would
also stop the search
+ // for the creation side, since `isSimpleExpression` sees the plan
of a subquery too.
+ // If the key has DPP filters, they are all dropped, so step 3
above applies. The
+ // bloom filter evaluates its creation side again, apart from the
join. Its subquery
+ // can also read more of that side than the join does, since
filters on other keys, DPP
+ // filters or bloom filters, can narrow only the join's side. And
the bloom filter
+ // hashes the bytes of the key, so its type must compare by its
bytes, which a collated
+ // string does not.
+ val creationPlan =
+ withoutDppFilters(creationSide, dpp => dpp.onlyInBroadcast ||
keyDpps.contains(dpp))
Review Comment:
**Finding 27.** This line leaves out only the `onlyInBroadcast` DPP filters.
A DPP filter that runs as its own subquery stays in the creation side. Now that
this rule runs after pushdown, that filter can be one that a join above pushed
down into this creation side.
`extractSelectiveFilterOverScan` then checks the whole filter condition with
`isSimpleExpression`, which sees that DPP filter's build plan, as the comment
above says. So any of these in the build plan stops the search, and the join
gets no Bloom filter:
- a `LIKE` that `LikeSimplification` cannot rewrite;
- a regex;
- a UDF.
What I ran, without the hint, with `reuseBroadcastOnly` off and broadcast
off. `zb` is partitioned by `part`:
```sql
SELECT za.v, zc.name FROM za JOIN zb ON za.k = zb.k JOIN zc ON zb.part = zc.p
WHERE zb.x = 5 AND zc.name LIKE '_1'
```
- On master, `za.k` gets its Bloom filter.
- Here, with DPP on, it gets none.
- With DPP off, or with `reuseBroadcastOnly` on, it gets the filter.
- The rows are the same in all cases.
Leaving DPP conjuncts out of that check restores the filter, and
`InjectRuntimeFilterSuite` passes (`InjectRuntimeFilter.scala:223`):
```scala
case Filter(condition, child) if splitConjunctivePredicates(condition)
.filterNot(_.isInstanceOf[DynamicPruningSubquery]).forall(isSimpleExpression) =>
```
The DPP filter stays in the Bloom filter's subquery. That should be
consistent: this rule now runs after cleanup, and physical planning keeps a DPP
filter that is not `onlyInBroadcast`, in the join and in the subquery alike.
Stripping every DPP filter at this line also restores the Bloom filter. But
it fails "SPARK-60702: do not add bloom filter whose creation side keeps a dpp
filter that runs as its own subquery", which pins the refusal on a key with DPP
filters. The comment above this line would need updating either way.
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/InjectRuntimeFilter.scala:
##########
@@ -533,71 +673,297 @@ object InjectRuntimeFilter extends Rule[LogicalPlan]
with PredicateHelper with J
cannotFail(leafKey) && !reused.exists(_.exists(_.fastEquals(leaf)))
}
}
+ val bloomFilterEnabled = conf.runtimeFilterBloomFilterEnabled
+ lazy val cteDefs = cteDefinitions(plan)
plan transformUp {
+ case join: Join if isRuntimeFilterHintDecided(join.hint) => join
+ // Only a hinted join has anything to do with Bloom filters disabled or
once the number of
+ // filters is reached.
+ case join: Join if !hasRuntimeFilterHint(join.hint) &&
+ (!bloomFilterEnabled || filterCounter >= numFilterThreshold) => join
case join @ ExtractEquiJoinKeys(joinType, leftKeys, rightKeys, _, _,
left, right, hint) =>
var newLeft = left
var newRight = right
- leftKeys.lazyZip(rightKeys).foreach((l, r) => {
- lazy val keyDpps = dynamicPruningSubqueries(left, l) ++
dynamicPruningSubqueries(right, r)
- // Check if:
- // 1. The keys are simple cheap expressions
- // 2. There is no DPP filter on the key that physical planning may
keep
- if (filterCounter < numFilterThreshold &&
- isSimpleExpression(l) && isSimpleExpression(r) &&
!keyDpps.exists(isKept)) {
- val oldLeft = newLeft
- val oldRight = newRight
- // The creation side for a bloom filter on `key` of `side`. It
leaves out the key's own
- // DPP filters, which physical planning drops. An expression such
as a UDF or a `LIKE`
- // in their build plan would also stop the search for the creation
side, since
- // `isSimpleExpression` sees the plan of a subquery too. If the
key has DPP filters,
- // they are all dropped, so step 3 above applies. The bloom filter
evaluates its
- // creation side again, apart from the join. Its subquery can also
read more of that
- // side than the join does, since filters on other keys, DPP
filters or bloom filters,
- // can narrow only the join's side. And the bloom filter hashes
the bytes of the key, so
- // its type must compare by its bytes, which a collated string
does not.
- def creationSide(
- side: LogicalPlan,
- key: Expression,
- other: LogicalPlan,
- otherKey: Expression): Option[FilterCreationSide] =
- extractBeneficialFilterCreatePlan(
- side, withoutDppFilters(other, keyDpps.contains), key,
otherKey).filter { c =>
- keyDpps.isEmpty ||
(UnsafeRowUtils.isBinaryStable(key.dataType) &&
- canPushDown(key, side) && canEvaluateAgain(c))
+ if (isRuntimeFilterHintAmbiguous(hint)) {
+ reportHintNotApplied(join,
+ "the runtime filter source is ambiguous as both join sides are
hinted")
+ }
+ // A side hinted as the runtime filter source is the creation side, so
the filter is
+ // applied to the other side. An ambiguous hint is ignored, leaving
the heuristics to
+ // decide, and so is a hinted side that cannot be a runtime filter
source on any join key.
+ val hintedSource = runtimeFilterSourceSide(hint)
+ lazy val hintCheck = hintedSource.map { side =>
+ runtimeFilterHintCheck(if (side == BuildLeft) left else right,
cteDefs)
+ }
+ // Why the hinted side cannot prune the other side on the key pair `l`
and `r`.
+ def hintRejection(l: Expression, r: Expression, checkFunctions:
Boolean): Option[String] =
+ hintCheck.flatMap { check =>
+ if (hintedSource.contains(BuildRight)) check.rejection(l, r,
checkFunctions)
+ else check.rejection(r, l, checkFunctions)
+ }
+ // The DPP filters on each key pair that prune the left side and the
right side.
+ val keyFilters = leftKeys.lazyZip(rightKeys).map { (l, r) =>
+ (l, r, dynamicPruningFilters(left, l, r),
dynamicPruningFilters(right, r, l))
+ }
+ def honorHint(filters: Seq[DynamicPruningSubquery]): Boolean =
+
filters.exists(_.getTagValue(DynamicPruning.HONORS_RUNTIME_FILTER_HINT).isDefined)
+ // Why the hinted side cannot prune the other side on each key pair. A
key whose DPP
+ // filter honors the hint was accepted by [[PartitionPruning]], before
a filter pushed into
+ // the hinted side could change its analysis. A Bloom filter's
subquery is checked for the
+ // functions it calls once it is built.
+ val keyRejections = hintedSource.map { side =>
+ keyFilters.map { case (l, r, leftFilters, rightFilters) =>
+ if (honorHint(if (side == BuildRight) leftFilters else
rightFilters)) None
+ else hintRejection(l, r, checkFunctions = false)
+ }
+ }
+ val declinedReason =
+ keyRejections.flatMap(reasons => if (reasons.forall(_.isDefined))
reasons.head else None)
+ // A subquery cannot check a hinted side that reads a CTE of the outer
query, whose
+ // definition it does not have. An uncorrelated IN subquery is joined
with the rest of the
+ // query later, where the definition is visible, so the hint is
neither reported nor marked
+ // as decided here, and that pass decides it. A subquery that is
planned on its own, such
+ // as a scalar subquery, is not visited again, and its join stays as
without the hint.
+ val leftToOuterQuery = inSubquery &&
+
keyRejections.exists(_.contains(Some(RuntimeFilterSourceAnalysis.OuterCte)))
+ if (!leftToOuterQuery)
declinedReason.foreach(reportHintNotApplied(join, _))
Review Comment:
**Finding 28.** `leftToOuterQuery` holds in every subquery pass, but only an
IN subquery that `RewritePredicateSubquery` turns into a join reaches the outer
pass. In a scalar subquery, the join stays inside an expression, which the
outer pass does not visit, and an uncorrelated EXISTS behaves the same way. The
new test pins the scalar case (`InjectRuntimeFilterSuite.scala:3487`). At
`c22ae77`, the hint in those subqueries was reported. It is now dropped with no
warning.
With `d` a `MATERIALIZED` CTE of the outer query, I ran the hinted join `bf3
JOIN d ON bf3.c3 = d.c2` in three kinds of subquery:
| subquery | at `c22ae77` | at `55be0d6` |
|---|---|---|
| `bf4.c4 IN (SELECT ...)` | warning, no filter | Bloom filter (24) |
| `bf4.c4 > (SELECT max(...) ...)` | warning, no filter | no filter, no
warning |
| `EXISTS (SELECT ...)` | warning, no filter | no filter, no warning |
The description lists this case, but the hints page
(`docs/sql-ref-syntax-qry-select-hints.md:179-180`) still says that Spark
"issues a warning when it cannot".
The outer pass has the definitions, since `cteDefinitions` collects them
from subqueries too. So it could find the hinted joins left undecided in
subqueries that are still expressions, and at least report them. I have not
tried this. Otherwise the hints page should name the exception.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]