diff --git a/SKILLS.md b/SKILLS.md
index b0489fcf6499c..8d003979d854e 100644
--- a/SKILLS.md
+++ b/SKILLS.md
@@ -48,6 +48,7 @@ the pre-commit hook also checks. Groups below are in file order.
* [After a warm-up's `RELEASED` verdict, the "once compiled" rows measure the row engine](sql/varka/skills/benchmarking.md#after-a-warm-ups-released-verdict-the-once-compiled-rows-measure-the-row-engine)
* [Spark's codegen cache: what a compile count and a cache hit measure](sql/varka/skills/benchmarking.md#sparks-codegen-cache-what-a-compile-count-and-a-cache-hit-measure)
* [An Arm benchmark is a dispatch of `benchmark.yml` with `runner=ubuntu-24.04-arm`](sql/varka/skills/benchmarking.md#an-arm-benchmark-is-a-dispatch-of-benchmarkyml-with-runnerubuntu-2404-arm)
+* [A probe pass whose fused control loses is not read](sql/varka/skills/benchmarking.md#a-probe-pass-whose-fused-control-loses-is-not-read)
* [A dispatch of Varka classes only skips the TPC-DS data job](sql/varka/skills/benchmarking.md#a-dispatch-of-varka-classes-only-skips-the-tpc-ds-data-job)
#### [Build and environment](sql/varka/skills/build-and-environment.md)
diff --git a/docs/sql-varka.md b/docs/sql-varka.md
index 0a099017f43a9..9e9c8283e0fea 100644
--- a/docs/sql-varka.md
+++ b/docs/sql-varka.md
@@ -1439,7 +1439,7 @@ bitmask, never a machine word or a token of text.
| **shape cache** | A bounded LRU of emitted classes keyed by shape, shared *across tasks*. The cost it saves is not emission - that is about 80 microseconds - but JIT warm-up: a re-defined class is a new class to HotSpot and re-pays the whole tier ladder, 13 to 50 ms per task. Reusing the loaded class is the only thing that avoids it. |
| **literal slot** | An index into the kernel's runtime argument array where a folded constant lives. Why the IR carries no literal *values*: keeping them out is what makes the shape the identity. |
| **selection bitmap** | A filter's output: one bit per row, set meaning the predicate is known true. An unknown row - a null under the comparison - reads as false by construction, which is SQL's `WHERE` semantics for free. |
-| **partial eligibility** | A projection qualifies when *at least one* of its entries compiles. The rest are forwarded zero-copy or left to stock Spark, and the results merge. Eligibility is per entry, not all-or-nothing. |
+| **partial eligibility** | A projection qualifies when *at least one* of its entries compiles. The rest are forwarded zero-copy or left to stock Spark, and the results merge. Eligibility is per entry, not all-or-nothing, with one exception: under a consumer that wants rows, a projection whose residual entries outnumber its fused ones is left whole to stock Spark, whose one whole-stage loop is then faster than the kernel and the per-row merge (VARKA-613). |
| **decline** | A compile-time refusal: the compiler cannot translate an expression, or the emitter will not build a shape. Declining is a normal outcome, not an error - the query runs on stock Spark instead. |
| **ghost fallback** | The run-time counterpart: if an emitted kernel fails on a batch, that batch is recomputed by the ordinary row engine and the query still returns the right answer. The Janino projection behind it is compiled lazily, only if some batch actually needs it. |
| **civil-from-days** | The calendar algorithm turning a day count since the epoch into year, month and day (Neri and Schneider's, transcribed in `sql/varka/papers`). Branch-free and 31 vector operations, which is why several outputs over one date share it. |
diff --git a/sql/core/src/main/java/org/apache/spark/sql/execution/VarkaPartialDecline.java b/sql/core/src/main/java/org/apache/spark/sql/execution/VarkaPartialDecline.java
new file mode 100644
index 0000000000000..d023e0dbdacaf
--- /dev/null
+++ b/sql/core/src/main/java/org/apache/spark/sql/execution/VarkaPartialDecline.java
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.spark.sql.execution;
+
+import java.util.List;
+import java.util.Optional;
+
+import org.apache.spark.sql.catalyst.expressions.Alias;
+import org.apache.spark.sql.catalyst.expressions.Expression;
+import org.apache.spark.sql.catalyst.expressions.codegen.PartialVarkaProjection;
+import org.apache.spark.sql.catalyst.expressions.codegen.VarkaOutputSpec;
+import org.apache.spark.sql.catalyst.expressions.codegen.varka.VarkaEmitOptions;
+
+/**
+ * Whether a projection that fuses in part is left whole to Spark when its consumer wants rows
+ * (VARKA-613), and why: when its residual entries outnumber its fused ones and also outweigh
+ * them, an entry weighing the operators of its expression.
+ *
+ *
Under a row consumer such a projection runs its kernel over each batch, then builds every
+ * output row in a merge projection over the input row and the kernel's row, which evaluates the
+ * residual entries per row outside whole-stage code. Spark's own plan evaluates every entry in
+ * one whole-stage loop over the batch's vectors. So the kernel wins only where the work it takes
+ * off the row path outweighs the batch pass and the merge's indirection it adds, and with more
+ * residual entries than fused ones it does not: the day-time baseline's {@code extract} of four
+ * fields, of which only the day fuses, ran at 0.7x the row path at 256 bits and 0.5x at 128 on
+ * the runners, and the laptop probe ({@code VARKA-613.md} 9) found three fused arithmetic entries
+ * beside one residual entry over the same column a win, so whether the residual entries share
+ * the fused ones' columns does not decide it, the weight does. Both must hold, so the rule
+ * declines no shape the count alone kept, and one expensive fused entry beside two cheap residual
+ * ones, which the count would decline, keeps the kernel that carries most of the work.
+ *
+ *
The rule is asked only where the consumer is known to want rows, in
+ * {@link VarkaColumnarRule}'s post stage; a columnar consumer keeps every partial projection. A
+ * test's forced decline ({@link VarkaEmitOptions#forceResidualAt()}) is never declined here,
+ * since the force exists to run the merge path.
+ */
+public final class VarkaPartialDecline {
+
+ private VarkaPartialDecline() {
+ }
+
+ /**
+ * Why {@code partial} is left to Spark under a row consumer, or empty when it keeps its
+ * kernel: empty for a projection whose residual entries are no more in number or in weight than
+ * its fused ones, those of every kernel together, and under a forced decline.
+ * {@code projectList} is the projection's expressions, one per entry of
+ * {@code partial.specs()}. A forwarded column weighs nothing.
+ */
+ public static Optional reason(
+ PartialVarkaProjection partial, List extends Expression> projectList,
+ VarkaEmitOptions options) {
+ if (options.forceResidualAt() != 0) {
+ return Optional.empty();
+ }
+ int fused = 0;
+ int residual = 0;
+ int fusedWeight = 0;
+ int residualWeight = 0;
+ List specs = partial.specs();
+ for (int i = 0; i < specs.size(); i++) {
+ switch (specs.get(i)) {
+ case VarkaOutputSpec.FusedOutput f -> {
+ fused++;
+ fusedWeight += weight(projectList.get(i));
+ }
+ case VarkaOutputSpec.KernelOutput k -> {
+ fused++;
+ fusedWeight += weight(projectList.get(i));
+ }
+ case VarkaOutputSpec.ForwardedOutput f -> { }
+ case VarkaOutputSpec.ResidualOutput r -> {
+ residual++;
+ residualWeight += weight(projectList.get(i));
+ }
+ }
+ }
+ if (residual <= fused || residualWeight <= fusedWeight) {
+ return Optional.empty();
+ }
+ return Optional.of("fuses in part under a row consumer, and its residual entries outnumber "
+ + "and outweigh its fused ones, " + residual + " entries of " + residualWeight
+ + " operators to " + fused + " of " + fusedWeight + ", so the per-row merge would cost "
+ + "more than the kernel saves (VARKA-613)");
+ }
+
+ /** The operators in {@code e}: its inner nodes, not counting an alias or a leaf. */
+ private static int weight(Expression e) {
+ int n = e instanceof Alias || e.children().isEmpty() ? 0 : 1;
+ var children = e.children();
+ for (int i = 0; i < children.size(); i++) {
+ n += weight(children.apply(i));
+ }
+ return n;
+ }
+}
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/VarkaColumnarRule.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/VarkaColumnarRule.scala
index 6fdd0f1a93d14..f27f29802452f 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/execution/VarkaColumnarRule.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/VarkaColumnarRule.scala
@@ -22,7 +22,7 @@ import scala.jdk.OptionConverters._
import org.apache.spark.internal.Logging
import org.apache.spark.sql.catalyst.expressions.{Alias, And, Attribute, AttributeSeq, BindReferences, Expression, NamedExpression}
-import org.apache.spark.sql.catalyst.expressions.codegen.VarkaExpressionCompiler
+import org.apache.spark.sql.catalyst.expressions.codegen.{PartialVarkaProjection, VarkaExpressionCompiler}
import org.apache.spark.sql.catalyst.rules.Rule
import org.apache.spark.sql.execution.adaptive.{QueryStageExec, TableCacheQueryStageExec}
import org.apache.spark.sql.execution.columnar.{ArrowCachedBatchSerializer, InMemoryTableScanExec}
@@ -57,7 +57,9 @@ import org.apache.spark.sql.vectorized.ArrowColumnVector
* - after transitions, a to-row transition that did get inserted above such a node is fused with
* it into a [[VarkaColumnarToRowExec]], which runs the same kernels and converts their output
* to rows in one node. That is the plan a row consumer got before this two-stage split existed,
- * unchanged.
+ * unchanged, except that a projection whose residual entries outnumber its fused ones is left
+ * to Spark there ([[VarkaPartialDecline]]), since only there is the consumer known to want
+ * rows.
*
* The post stage also still matches a plain projection over a to-row transition, for a projection
* the pre stage did not see - another columnar rule may have introduced it, and post rules run in
@@ -106,18 +108,24 @@ object VarkaColumnarRule extends ColumnarRule with Logging {
if isForwardedNarrowing(projectList, filter.output) =>
VarkaFilterColumnarToRowExec(filter.condition, filter.child, Some(projectList),
filter.wholeCondition, filter.sessionEmit)
- case ColumnarToRowExec(varka: VarkaProjectExec) =>
- VarkaColumnarToRowExec(varka.projectList, varka.child, varka.sessionEmit)
+ // A projection that fuses in part is left whole to Spark under a row consumer when its
+ // residual entries outnumber its fused ones (`VarkaPartialDecline`): Spark's projection
+ // over its child's rows (`declinedChild`).
+ case ColumnarToRowExec(varka: VarkaProjectExec) => projectionToRows(varka)
case ColumnarToRowExec(varka: VarkaFilterExec) =>
VarkaFilterColumnarToRowExec(varka.condition, varka.child,
wholeCondition = varka.wholeCondition, sessionEmit = varka.sessionEmit)
+ // The same decline guards this arm, which a declined projection reaches as
+ // `ProjectExec(ColumnarToRowExec(child))` on any later pass: it stays the projection.
case project @ ProjectExec(projectList, child)
if isVarkaEligible(projectList, child.output) =>
val columnarChild = child match {
case ColumnarToRowExec(inner) => inner
case other => other
}
- if (columnarChild.supportsColumnar) {
+ val session = VarkaSessionEmit.of(SQLConf.get)
+ if (columnarChild.supportsColumnar && partialDecline(
+ compilePartial(projectList, child.output, session), projectList, session).isEmpty) {
VarkaColumnarToRowExec(projectList, columnarChild)
} else {
project
@@ -224,10 +232,62 @@ object VarkaColumnarRule extends ColumnarRule with Logging {
// at least one entry compiles to the vector IR - nested chains, shared subtrees and
// predication included - with bare columns forwarded and the rest evaluated per row.
private def isVarkaEligible(
- projectList: Seq[NamedExpression], childOutput: Seq[Attribute]): Boolean = {
- val session = VarkaSessionEmit.of(SQLConf.get)
+ projectList: Seq[NamedExpression], childOutput: Seq[Attribute]): Boolean =
+ compilePartial(projectList, childOutput, VarkaSessionEmit.of(SQLConf.get)).isDefined
+
+ private def compilePartial(
+ projectList: Seq[NamedExpression],
+ childOutput: Seq[Attribute],
+ session: VarkaSessionEmit): Option[PartialVarkaProjection] =
VarkaExpressionCompiler.compilePartial(projectList, childOutput,
- VarkaColumnarToRowExec.emitOptions(session), session.admission).isPresent
+ VarkaColumnarToRowExec.emitOptions(session), session.admission).toScala
+
+ /**
+ * A Varka projection under a row consumer: Spark's projection when the rule declines it, else
+ * its row node. A declined projection's own child may be a Varka projection, which the
+ * transition rule never wrapped, so [[declinedChild]] asks again there.
+ */
+ private def projectionToRows(varka: VarkaProjectExec): SparkPlan =
+ partialDecline(varka.classification.toScala, varka.projectList, varka.sessionEmit) match {
+ case Some(_) => ProjectExec(varka.projectList, declinedChild(varka.child))
+ case None => VarkaColumnarToRowExec(varka.projectList, varka.child, varka.sessionEmit)
+ }
+
+ /**
+ * The rows a declined projection reads from `child`, its Varka node's columnar child, as the
+ * transition rule would have given them to a row projection: a source that also produces rows
+ * gives them itself, as it does for the session without Varka (an Arrow-cached scan, read as
+ * rows); a Varka filter becomes its to-row node, which reads the selection bitmap without
+ * compacting, as the arm for a filter under a transition builds it; any other columnar child
+ * gets a to-row transition. `transformUp` does not revisit what an arm returns, so the filter's
+ * node is built here rather than left to that arm.
+ */
+ private def declinedChild(child: SparkPlan): SparkPlan = child match {
+ // A nested Varka projection is under a row consumer too, so it is asked the same question.
+ case inner: VarkaProjectExec => projectionToRows(inner)
+ case filter: VarkaFilterExec =>
+ VarkaFilterColumnarToRowExec(filter.condition, filter.child,
+ wholeCondition = filter.wholeCondition, sessionEmit = filter.sessionEmit)
+ case rows if rows.supportsRowBased => rows
+ case batches => ColumnarToRowExec(batches)
+ }
+
+ /**
+ * Why a projection, classified as `partial`, is left whole to Spark under a row consumer, or
+ * None when it keeps its kernel ([[VarkaPartialDecline]]). The reason is logged at DEBUG, as a
+ * filter left to Spark is: the plan holds no Varka node to show it in `EXPLAIN`.
+ */
+ private def partialDecline(
+ partial: Option[PartialVarkaProjection],
+ projectList: Seq[NamedExpression],
+ session: VarkaSessionEmit): Option[String] = {
+ val reason = partial.flatMap { p =>
+ VarkaPartialDecline.reason(p, projectList.asJava,
+ VarkaColumnarToRowExec.emitOptions(session)).toScala
+ }
+ reason.foreach(why => logDebug(s"Varka leaves the projection " +
+ s"${projectList.map(_.sql).mkString(", ")} to Spark: it $why"))
+ reason
}
/**
diff --git a/sql/core/src/test/java/org/apache/spark/sql/execution/VarkaTwoLaneDefault128Suite.java b/sql/core/src/test/java/org/apache/spark/sql/execution/VarkaTwoLaneDefault128Suite.java
index 4ae8ab9afb7bf..96e935b9b5cb1 100644
--- a/sql/core/src/test/java/org/apache/spark/sql/execution/VarkaTwoLaneDefault128Suite.java
+++ b/sql/core/src/test/java/org/apache/spark/sql/execution/VarkaTwoLaneDefault128Suite.java
@@ -181,7 +181,7 @@ void decimalValuesDecline() {
assumeTrue(varka != null, "not x86: the refusal does not apply");
for (String n : List.of("", "n")) {
String query = "SELECT p" + n + " < p2" + n + " AS a, w" + n + " < w2" + n + " AS b, l" + n
- + " < l2" + n + " AS c FROM two_lane_default";
+ + " < l2" + n + " AS c, l" + n + " <= l2" + n + " AS d FROM two_lane_default";
Dataset actual = varka.sql(query);
List got = sorted(actual.collectAsList());
SparkPlan plan = actual.queryExecution().executedPlan();
@@ -194,7 +194,8 @@ void decimalValuesDecline() {
PartialVarkaProjection partial = (node instanceof VarkaProjectExec p
? p.classification() : ((VarkaColumnarToRowExec) node).classification())
.orElseThrow(() -> new AssertionError("no classification: " + clue));
- // The two decimal entries are the row path's, with the reason; the long one is fused.
+ // The two decimal entries are the row path's, with the reason; the two long ones are
+ // fused, so the rule that leaves a residual-heavy projection to Spark keeps this one.
assertEquals(Set.of(0, 1), partial.declines().keySet(), clue);
for (VarkaDecline d : partial.declines().values()) {
assertEquals(VarkaKernelPlan.TWO_LANE_DECIMAL_VALUE_REASON, d.reason(), clue);
diff --git a/sql/core/src/test/java/org/apache/spark/sql/execution/benchmark/VarkaDayTimeIntervalBaselineBenchmark.java b/sql/core/src/test/java/org/apache/spark/sql/execution/benchmark/VarkaDayTimeIntervalBaselineBenchmark.java
index fd2c9cd88d2cd..f4e64a6142d1e 100644
--- a/sql/core/src/test/java/org/apache/spark/sql/execution/benchmark/VarkaDayTimeIntervalBaselineBenchmark.java
+++ b/sql/core/src/test/java/org/apache/spark/sql/execution/benchmark/VarkaDayTimeIntervalBaselineBenchmark.java
@@ -58,9 +58,11 @@
* results file notes each section that fuses. A row that fuses more of a section sets its new
* class, so that its fusion cannot turn a baseline section into a fused one unnoticed. A section
* is {@code NONE} when no Varka node plans it and {@code WHOLE} when no row operator evaluates
- * any of it. The projections row 103 fuses are {@code WHOLE} at both widths, the four extracts
- * together {@code PARTIAL} (the DAY field fuses, the other three are row 103's later step), and
- * the other projections but the blend control are {@code NONE}. So is the filter
+ * any of it. The projections row 103 fuses are {@code WHOLE} at both widths, and the other
+ * projections but the blend control are {@code NONE}. So are the four extracts together: only the
+ * DAY field would fuse (the other three are row 103's later step), and a projection that fuses
+ * in part under a row consumer with more residual entries than fused ones stays whole on the
+ * row path (VARKA-613), so both arms time the row path. So is the filter
* {@code extract(HOUR FROM dt) >= 12} at both densities: of it only the {@code IS NOT NULL}
* Spark infers of the column would fuse, and a filter fusing nothing else stays whole on the row
* path (VARKA-598), so both arms time the row path. Each
@@ -194,7 +196,7 @@ static List sections(boolean declinesLongConditions) {
out.add(new Section("extract DAY, HOUR, MINUTE and SECOND together" + density,
"SELECT extract(DAY FROM " + dt + ") AS a, extract(HOUR FROM " + dt + ") AS b, "
+ "extract(MINUTE FROM " + dt + ") AS c, extract(SECOND FROM " + dt + ") AS d"
- + from, Map.of(), Fusion.PARTIAL));
+ + from, Map.of(), Fusion.NONE));
out.add(new Section("make_dt_interval(i, i2, i3)" + density,
"SELECT make_dt_interval(" + i + ", i2, i3) AS a" + from, Map.of(), Fusion.NONE));
out.add(new Section("make_dt_interval(i, i2, i3, s), DECIMAL(18, 6) seconds" + density,
diff --git a/sql/core/src/test/java/org/apache/spark/sql/execution/benchmark/VarkaPartialProjectionProbe.java b/sql/core/src/test/java/org/apache/spark/sql/execution/benchmark/VarkaPartialProjectionProbe.java
new file mode 100644
index 0000000000000..70398c3ae4224
--- /dev/null
+++ b/sql/core/src/test/java/org/apache/spark/sql/execution/benchmark/VarkaPartialProjectionProbe.java
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.execution.benchmark;
+
+import java.util.List;
+
+import org.apache.spark.sql.SparkSession;
+import org.apache.spark.sql.VarkaBenchmark;
+import org.apache.spark.sql.execution.SparkPlan;
+import org.apache.spark.sql.execution.VarkaColumnarToRowExec;
+import org.apache.spark.sql.execution.VarkaFusionReport;
+
+/**
+ * The cost of a projection that fuses in part under a row consumer (VARKA-613), over the
+ * day-time baseline's table at each null density, each query timed on both sessions. Four shapes
+ * tell the candidate decline rules apart: (a) the baseline's blend, {@code extract(DAY)} fused
+ * beside {@code HOUR}, {@code MINUTE} and {@code SECOND} of the same column on the row path;
+ * (b) the same with the three residual extracts over the other column {@code dt2}; (c) three
+ * fused arithmetic entries, {@code -dt}, {@code abs(dt)} and {@code dt * 3}, beside the residual
+ * {@code extract(HOUR FROM dt)} of their column; and (d) the same three beside
+ * {@code make_dt_interval(i, i2, i3)}, which reads none of their columns. The control is
+ * {@code extract(DAY FROM dt)} alone, which fuses whole. Each query's plan on the Varka session
+ * is printed with the Varka node's line per entry, so the output shows each shape is the split
+ * it is named for. A diagnosis probe, not a baseline: its output is committed under
+ * {@code sql/varka/plans/m8/results/}, and nothing checks its plans' classes.
+ */
+public class VarkaPartialProjectionProbe extends VarkaSqlBenchmarkBase {
+
+ static final int NUM_ROWS = VarkaDayTimeIntervalBaselineBenchmark.NUM_ROWS;
+
+ /** The shapes over one density's columns, each a title and a query. */
+ static List shapes(String nulls) {
+ String dt = "dt" + nulls;
+ String i = "i" + nulls;
+ String from = " FROM " + VarkaDayTimeIntervalBaselineBenchmark.VIEW;
+ String arithmetic = "-" + dt + " AS a, abs(" + dt + ") AS b, " + dt + " * 3 AS c, ";
+ return List.of(
+ new String[] {"control, extract(DAY FROM dt) alone" + nulls,
+ "SELECT extract(DAY FROM " + dt + ") AS a" + from},
+ new String[] {"a. the blend" + nulls,
+ "SELECT extract(DAY FROM " + dt + ") AS a, extract(HOUR FROM " + dt + ") AS b, "
+ + "extract(MINUTE FROM " + dt + ") AS c, extract(SECOND FROM " + dt + ") AS d"
+ + from},
+ new String[] {"b. other inputs" + nulls,
+ "SELECT extract(DAY FROM " + dt + ") AS a, extract(HOUR FROM dt2) AS b, "
+ + "extract(MINUTE FROM dt2) AS c, extract(SECOND FROM dt2) AS d" + from},
+ new String[] {"c. heavy, shared" + nulls,
+ "SELECT " + arithmetic + "extract(HOUR FROM " + dt + ") AS d" + from},
+ new String[] {"d. heavy, other" + nulls,
+ "SELECT " + arithmetic + "make_dt_interval(" + i + ", i2, i3) AS d" + from});
+ }
+
+ /** The plan's tree, then each Varka projection node's line per entry. */
+ static String describe(SparkPlan plan) {
+ var out = new StringBuilder(plan.treeString());
+ for (SparkPlan p : operators(plan)) {
+ if (p instanceof VarkaColumnarToRowExec node) {
+ out.append(" entries: ").append(VarkaFusionReport.lines(node.classification(),
+ node.projectList(), node.child().output()).mkString("; ")).append('\n');
+ }
+ }
+ return out.toString();
+ }
+
+ @Override
+ public void runBenchmarkSuite(String[] mainArgs) {
+ stopLeftoverSessions();
+ SparkSession baseline = VarkaArrowSessions.createSession(
+ "varka-613-off", false, false, "local[1]");
+ clearSessions();
+ SparkSession varka = VarkaArrowSessions.createSession(
+ "varka-613-on", true, false, "local[1]");
+ clearSessions();
+ try {
+ for (SparkSession session : List.of(baseline, varka)) {
+ session.sql(VarkaDayTimeIntervalBaselineBenchmark.tableSql(NUM_ROWS))
+ .createOrReplaceTempView(VarkaDayTimeIntervalBaselineBenchmark.VIEW);
+ VarkaArrowSessions.cache(session, VarkaDayTimeIntervalBaselineBenchmark.VIEW);
+ }
+ for (String nulls : List.of("", "_n")) {
+ for (String[] q : shapes(nulls)) {
+ System.out.println("PLAN " + q[0] + ":\n"
+ + describe(varka.sql(q[1]).queryExecution().executedPlan()));
+ section(q[0], () -> {
+ VarkaBenchmark benchmark =
+ benchmark(q[0] + " over " + NUM_ROWS + " rows", NUM_ROWS).timed().build();
+ benchmark.addCase("spark row path (varka off)", i -> noop(baseline.sql(q[1])));
+ benchmark.addCase("varka on", i -> noop(varka.sql(q[1])));
+ runCases(benchmark);
+ });
+ }
+ }
+ } finally {
+ baseline.stop();
+ varka.stop();
+ }
+ }
+}
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/VarkaCodegenGiveUpSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/VarkaCodegenGiveUpSuite.scala
index 37c02a355be09..094cd3a1f2767 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/VarkaCodegenGiveUpSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/VarkaCodegenGiveUpSuite.scala
@@ -576,21 +576,24 @@ class VarkaCodegenGiveUpSuite extends QueryTest with VarkaSharedSessions with Va
val staged = logged(stageLogger, Level.INFO)(run(disabledSpark))
assert(staged.exists(_._2.contains("Found too long generated codes")), staged.map(_._2))
}
- // Varka's answer: the sixty entries decline and the date entry fuses, and the node evaluates
- // the declined entries through a projection of Spark's, in the same class as vanilla's: under
- // the splitter its methods stay small, and with the splitter off it is the same one method
- // past 8000 bytes, used as vanilla's is.
+ // Varka's answer: the sixty entries decline and the date entry fuses. Under a row consumer
+ // the sixty residual entries outweigh the one fused entry, so the projection is left to Spark
+ // (VARKA-613) and its plan is vanilla's. Under a columnar consumer, a noop write, the node
+ // keeps its kernel and evaluates the declined entries through a projection of Spark's, in the
+ // same class as vanilla's: under the splitter its methods stay small, and with the splitter
+ // off it is the same one method past 8000 bytes, used as vanilla's is.
cacheDatedStrings(varkaSpark)
val df = varkaSpark.sql(query)
- assert(varkaProjections(df).nonEmpty, df.queryExecution.executedPlan)
+ assert(varkaProjections(df).isEmpty, df.queryExecution.executedPlan)
val (fused, declined) = classified(df)
assert(fused == Set(0) && declined.size == 60, (fused, declined.keySet))
// The expected rows are computed first, so that only the Varka query compiles in the window.
val expected = disabledSpark.sql(query).collect().toSeq
- val split = logged(compilerLoggers, Level.INFO)(checkAnswer(df, expected))
+ checkAnswer(df, expected)
+ val split = logged(compilerLoggers, Level.INFO)(run(varkaSpark))
assert(jitRefused(split).isEmpty, split.map(_._2))
withSessionConf(varkaSpark, unsplit) {
- val whole = logged(compilerLoggers, Level.INFO)(checkAnswer(df, expected))
+ val whole = logged(compilerLoggers, Level.INFO)(run(varkaSpark))
val refused = jitRefused(whole)
assert(refused.exists { case (method, bytes) =>
method.contains("SpecificUnsafeProjection") && bytes > 8000
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/VarkaDecimalReadPathSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/VarkaDecimalReadPathSuite.scala
index 625055ec149fc..a8b3865826224 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/VarkaDecimalReadPathSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/VarkaDecimalReadPathSuite.scala
@@ -425,7 +425,8 @@ class VarkaDecimalReadPathSuite extends QueryTest with VarkaSharedSessions
s"SELECT $cast AS r, a AS a2, b AS b2, date_add(d, i) AS f FROM ${t.name}", false)
/** The same beside an array, which the scan then selects. */
private val besideFusedAndArray = QueryShape((cast, t) =>
- s"SELECT $cast AS r, date_add(d, i) AS f, size(arr) AS n FROM ${t.name}", false)
+ s"SELECT $cast AS r, date_add(d, i) AS f, date_add(d, 1) AS g, size(arr) AS n " +
+ s"FROM ${t.name}", false)
/**
* The cast in a conjunct the filter kernel declines, beside one it fuses: the rule splits the
* condition into a `FilterExec` over a Varka filter, whose fallback evaluates the whole
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/VarkaDayTimeIntervalBaselineQueriesSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/VarkaDayTimeIntervalBaselineQueriesSuite.scala
index 9e7be3b24f3ac..000a34d02f4cc 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/VarkaDayTimeIntervalBaselineQueriesSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/VarkaDayTimeIntervalBaselineQueriesSuite.scala
@@ -143,11 +143,12 @@ class VarkaDayTimeIntervalBaselineQueriesSuite extends QueryTest with VarkaShare
def fused(list: Seq[VarkaDayTimeIntervalBaselineBenchmark.Section]): Seq[(String, String)] =
list.filter(_.fusion != VarkaSqlBenchmarkBase.Fusion.NONE)
.map(s => (s.title, s.fusion.toString))
- // The projections row 103 fuses, at both widths: the refusal below is a filter's. Of the
- // four extracts together only the DAY field fuses.
+ // The projections row 103 fuses, at both widths: the refusal below is a filter's. The
+ // four extracts together are not among them: only the DAY field would fuse, and a
+ // projection under a row consumer whose residual entries outnumber its fused ones is left
+ // to Spark (VARKA-613).
val projections = Seq("dt + dt2 - dt", "abs(dt)", "dt * 3", "extract(DAY FROM dt)")
- def density(d: String): Seq[(String, String)] = projections.map(p => (s"$p, $d", "WHOLE")) :+
- (s"extract DAY, HOUR, MINUTE and SECOND together, $d", "PARTIAL")
+ def density(d: String): Seq[(String, String)] = projections.map(p => (s"$p, $d", "WHOLE"))
val blend = "CASE WHEN dt > dt2 THEN dt ELSE dt2 END, control, fuses at both widths"
assert(fused(sections) === density("no nulls") ++ Seq(
("filter dt > dt2, control, fuses today, no nulls", "WHOLE"),
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/VarkaPartialDeclineSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/VarkaPartialDeclineSuite.scala
new file mode 100644
index 0000000000000..79554d2a170d8
--- /dev/null
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/VarkaPartialDeclineSuite.scala
@@ -0,0 +1,277 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.execution.benchmark
+
+import scala.jdk.CollectionConverters._
+
+import org.apache.spark.sql.{QueryTest, SparkSession}
+import org.apache.spark.sql.catalyst.expressions.{AttributeReference, NamedExpression}
+import org.apache.spark.sql.catalyst.expressions.codegen.varka.VarkaMatrix.PinsDefaults
+import org.apache.spark.sql.execution.{ColumnarToRowExec, ProjectExec, QueryExecution, SparkPlan, VarkaColumnarRule, VarkaColumnarToRowExec, VarkaFilterColumnarToRowExec, VarkaFilterExec, VarkaPartialDecline, VarkaProjectExec, VarkaSharedSessions}
+import org.apache.spark.sql.internal.SQLConf
+import org.apache.spark.sql.util.QueryExecutionListener
+
+/**
+ * The decline of a projection that fuses in part under a row consumer (VARKA-613), over the
+ * day-time baseline's table and the probe's four shapes: (a) `extract(DAY)` fused beside three
+ * extracts of the same column on the row path, (b) the same with the three over another column,
+ * (c) three fused arithmetic entries beside a residual extract of their column, and (d) the same
+ * three beside a residual over other columns. Under a row consumer the shapes whose residual
+ * entries outnumber their fused ones, a and b, plan Spark's own projection, the plan of the
+ * session without Varka, and c and d keep their `VarkaColumnarToRowExec`; under a
+ * columnar consumer, a `noop` write, every shape keeps its `VarkaProjectExec`. A projection that
+ * fuses whole is unchanged. So the suite fails a rule that fires on an all-fused projection,
+ * reaches a columnar consumer, or keeps a shape it should decline, at the unnamed emit level and
+ * the named ones the runners and the laptop resolve; and both sessions answer every shape alike.
+ */
+class VarkaPartialDeclineSuite extends QueryTest with VarkaSharedSessions {
+
+ private val rows = 200
+
+ /** The probe's shapes over the column with no null, by letter, and whether each declines. */
+ private val shapes: Seq[(String, String, Boolean)] =
+ VarkaPartialProjectionProbe.shapes("").asScala.toSeq
+ .filter(_(0).matches("[a-d]\\..*")).map { s =>
+ (s(0), s(1), s(0).startsWith("a.") || s(0).startsWith("b."))
+ }
+
+ /**
+ * Beside two cheap residual extracts, one fused entry of three operators: the entries
+ * outnumber, two to one, but weigh less, 2 to 3, so the rule keeps it.
+ */
+ private val heavyFusedOneEntry = "SELECT abs(-dt * 3) AS a, extract(HOUR FROM dt) AS b, " +
+ "extract(MINUTE FROM dt) AS c FROM " + VarkaDayTimeIntervalBaselineBenchmark.VIEW
+
+ private val allFused = "SELECT extract(DAY FROM dt) AS a, -dt AS b FROM " +
+ VarkaDayTimeIntervalBaselineBenchmark.VIEW
+
+ private def withTable(body: => Unit): Unit = {
+ val view = VarkaDayTimeIntervalBaselineBenchmark.VIEW
+ val sessions = Seq(spark, varkaSpark, disabledSpark)
+ try {
+ for (session <- sessions) {
+ session.sql(VarkaDayTimeIntervalBaselineBenchmark.tableSql(rows))
+ .createOrReplaceTempView(view)
+ session.catalog.cacheTable(view)
+ }
+ body
+ } finally {
+ for (session <- sessions if session.catalog.tableExists(view)) {
+ session.catalog.uncacheTable(view)
+ session.catalog.dropTempView(view)
+ }
+ }
+ }
+
+ private def forEachLevel(body: Int => Unit): Unit =
+ for (level <- Seq(-1, 2, 3)) {
+ withClue(s"useAVX $level") {
+ withBothConf(SQLConf.VARKA_EMIT_USE_AVX.key, level.toString)(body(level))
+ }
+ }
+
+ private def varkaNodes(plan: SparkPlan): Seq[SparkPlan] = plan.collect {
+ case p: VarkaColumnarToRowExec => p
+ case p: VarkaProjectExec => p
+ }
+
+ /** The operators' names, from the top, which the sessions number alike. */
+ private def shape(plan: SparkPlan): Seq[String] = plan.collect { case p => p.nodeName }
+
+ /** Writes to `noop` and returns the executed plan, which a write does not hand back itself. */
+ private def writeToNoop(session: SparkSession, sql: String): SparkPlan = {
+ @volatile var executedPlan: SparkPlan = null
+ val listener = new QueryExecutionListener {
+ override def onSuccess(funcName: String, qe: QueryExecution, durationNs: Long): Unit = {
+ executedPlan = qe.executedPlan
+ }
+ override def onFailure(funcName: String, qe: QueryExecution, e: Exception): Unit = {}
+ }
+ session.listenerManager.register(listener)
+ try {
+ session.sql(sql).write.format("noop").mode("append").save()
+ session.sparkContext.listenerBus.waitUntilEmpty()
+ } finally {
+ session.listenerManager.unregister(listener)
+ }
+ assert(executedPlan != null, "the write did not report a query execution")
+ executedPlan
+ }
+
+ test("a projection that fuses in part under a row consumer is left to Spark when its " +
+ "residual entries outnumber its fused ones", PinsDefaults) {
+ withTable {
+ forEachLevel { _ =>
+ for ((title, query, declines) <- shapes) {
+ withClue(title) {
+ val df = varkaSpark.sql(query)
+ val plan = df.queryExecution.executedPlan
+ if (declines) {
+ // The plan of the session without Varka, operator for operator: Spark's
+ // projection over the scan, which gives it rows itself.
+ assert(varkaNodes(plan).isEmpty, plan.treeString)
+ assert(shape(plan) === shape(disabledSpark.sql(query).queryExecution.executedPlan),
+ plan.treeString)
+ } else {
+ val nodes = varkaNodes(plan)
+ assert(nodes.size === 1 && nodes.head.isInstanceOf[VarkaColumnarToRowExec],
+ plan.treeString)
+ }
+ checkAnswer(df, spark.sql(query).collect().toSeq)
+ }
+ }
+ }
+ }
+ }
+
+ test("a declined projection over a fused filter reads the filter's rows without compacting",
+ PinsDefaults) {
+ withTable {
+ // The blend over the filter `dt > dt2`, which fuses: the declined projection is Spark's,
+ // over the filter's to-row node, the node a row consumer of the filter alone gets, and the
+ // compacting columnar filter is left in no plan.
+ val (_, blend, _) = shapes.head
+ val query = s"$blend WHERE dt > dt2"
+ forEachLevel { _ =>
+ val df = varkaSpark.sql(query)
+ val plan = df.queryExecution.executedPlan
+ assert(varkaNodes(plan).isEmpty, plan.treeString)
+ assert(plan.exists(_.isInstanceOf[VarkaFilterColumnarToRowExec]), plan.treeString)
+ assert(!plan.exists(_.isInstanceOf[VarkaFilterExec]), plan.treeString)
+ checkAnswer(df, spark.sql(query).collect().toSeq)
+ }
+ }
+ }
+
+ test("one expensive fused entry beside two cheap residual ones keeps its kernel",
+ PinsDefaults) {
+ withTable {
+ forEachLevel { _ =>
+ val df = varkaSpark.sql(heavyFusedOneEntry)
+ val nodes = varkaNodes(df.queryExecution.executedPlan)
+ assert(nodes.size === 1 && nodes.head.isInstanceOf[VarkaColumnarToRowExec],
+ df.queryExecution.executedPlan.treeString)
+ checkAnswer(df, spark.sql(heavyFusedOneEntry).collect().toSeq)
+ }
+ }
+ }
+
+ test("a declined projection over a declined projection leaves both to Spark", PinsDefaults) {
+ withTable {
+ // The blend over the output of shape b's projection, built by hand since the optimizer
+ // collapses two projections: both are residual-heavy, and both are under a row consumer.
+ def projection(query: String): ProjectExec = varkaSpark.sql(query).queryExecution
+ .sparkPlan.collectFirst { case p: ProjectExec => p }.get
+ val inner0 = projection(shapes(1)._2)
+ val scan = inner0.child
+ val outer0 = projection(shapes.head._2)
+ val dt = scan.output.find(_.name == "dt").get
+ val inner = ProjectExec(dt +: inner0.projectList, scan)
+ // Each query resolves its own copy of the view, so its columns are re-pointed by name.
+ val byName = inner.output.map(a => a.name -> a).toMap
+ val outer = ProjectExec(outer0.projectList.map(_.transform {
+ case a: AttributeReference if byName.contains(a.name) => byName(a.name)
+ }.asInstanceOf[NamedExpression]), inner)
+ val pre = varkaSpark.withActive(VarkaColumnarRule.preColumnarTransitions(outer))
+ assert(pre.collect { case p: VarkaProjectExec => p }.size === 2, pre.treeString)
+ val post = varkaSpark.withActive(
+ VarkaColumnarRule.postColumnarTransitions(ColumnarToRowExec(pre)))
+ assert(varkaNodes(post).isEmpty, post.treeString)
+ assert(post.isInstanceOf[ProjectExec] && post.children.head.isInstanceOf[ProjectExec],
+ post.treeString)
+ ()
+ }
+ }
+
+ test("the decline's reason weighs the entries, and only a residual-heavy projection has one",
+ PinsDefaults) {
+ withTable {
+ for ((title, query, declines) <- shapes ++
+ Seq(("all fused", allFused, false),
+ ("one heavy fused entry", heavyFusedOneEntry, false))) {
+ withClue(title) {
+ // The classification the rule reads, made on the plan the pre stage builds.
+ val planned = varkaSpark.sql(query).queryExecution.sparkPlan
+ val pre = varkaSpark.withActive(VarkaColumnarRule.preColumnarTransitions(planned))
+ val node = pre.collectFirst { case p: VarkaProjectExec => p }
+ .getOrElse(fail(s"the pre stage planned no Varka projection:\n${pre.treeString}"))
+ val options = VarkaColumnarToRowExec.emitOptions(node.sessionEmit)
+ val reason = VarkaPartialDecline.reason(node.classification.get,
+ node.projectList.asJava, options)
+ assert(reason.isPresent === declines, reason)
+ if (declines) {
+ assert(reason.get.contains("outnumber and outweigh its fused ones, " +
+ "3 entries of 3 operators to 1 of 1"), reason.get)
+ // A test's forced decline runs the merge path, so the rule never declines under it.
+ assert(!VarkaPartialDecline.reason(node.classification.get,
+ node.projectList.asJava, options.withForceResidualAt(1)).isPresent)
+ }
+ }
+ }
+ }
+ }
+
+ test("a declined projection handed to the post stage again stays Spark's projection",
+ PinsDefaults) {
+ withTable {
+ for ((title, query, declines) <- shapes if declines) {
+ withClue(title) {
+ // The shape the decline emits, built from the planner's projection over its scan: the
+ // post stage's projection arm sees it on any later pass, and must not fuse it there.
+ val planned = varkaSpark.sql(query).queryExecution.sparkPlan
+ val project = planned.collectFirst { case p: ProjectExec => p }
+ .getOrElse(fail(s"no projection planned:\n${planned.treeString}"))
+ // Over the scan, as the decline plans it, and over a to-row transition of it, which
+ // the arm unwraps.
+ for (declined <- Seq(project, project.copy(child = ColumnarToRowExec(project.child)))) {
+ val once = varkaSpark.withActive(VarkaColumnarRule.postColumnarTransitions(declined))
+ val twice = varkaSpark.withActive(VarkaColumnarRule.postColumnarTransitions(once))
+ assert(varkaNodes(once).isEmpty && varkaNodes(twice).isEmpty, twice.treeString)
+ assert(twice.isInstanceOf[ProjectExec], twice.treeString)
+ }
+ }
+ }
+ }
+ }
+
+ test("a columnar consumer keeps every partial projection's kernel") {
+ withTable {
+ forEachLevel { _ =>
+ for ((title, query, _) <- shapes) {
+ withClue(title) {
+ val plan = writeToNoop(varkaSpark, query)
+ assert(plan.exists(_.isInstanceOf[VarkaProjectExec]), plan.treeString)
+ assert(!plan.exists(_.isInstanceOf[VarkaColumnarToRowExec]), plan.treeString)
+ }
+ }
+ }
+ }
+ }
+
+ test("a projection that fuses whole keeps its kernel under a row consumer", PinsDefaults) {
+ withTable {
+ forEachLevel { _ =>
+ val df = varkaSpark.sql(allFused)
+ val nodes = varkaNodes(df.queryExecution.executedPlan)
+ assert(nodes.size === 1 && nodes.head.isInstanceOf[VarkaColumnarToRowExec],
+ df.queryExecution.executedPlan.treeString)
+ checkAnswer(df, spark.sql(allFused).collect().toSeq)
+ }
+ }
+ }
+}
diff --git a/sql/varka/matrix/skips.tsv b/sql/varka/matrix/skips.tsv
index d0c2c6835ffb8..541cc231a2bb5 100644
--- a/sql/varka/matrix/skips.tsv
+++ b/sql/varka/matrix/skips.tsv
@@ -404,6 +404,7 @@ lanesOverride=16 VarkaMathBaselineQueriesSuite every section of the math baselin
maxChainDepth=32 VarkaEmitterBudgetSuite fitsBudgets mirrors the analysis caps, distinct ops across outputs fails the test asserts the default caps' verdicts (the int lane's 64, the others' 16); maxChainDepth=32 is the cap on every lane, so a shape the test expects refused is admitted, or one it expects admitted is refused
maxChainDepth=32 VarkaEmitterBudgetSuite fitsBudgets counts a decimal leaf as Analysis does: height 0, no op fails the test asserts the default caps' verdicts (the int lane's 64, the others' 16); maxChainDepth=32 is the cap on every lane, so a shape the test expects refused is admitted, or one it expects admitted is refused
maxChainDepth=32 VarkaEmitterContractSuite IR outside the emitter's shape is rejected with a reason, not emitted wrong fails the test asserts the default caps' verdicts (the int lane's 64, the others' 16); maxChainDepth=32 is the cap on every lane, so a shape the test expects refused is admitted, or one it expects admitted is refused
+severalKernels=false VarkaFloatingLaneSuite a DOUBLE and a FLOAT root beside a date root each take a kernel of their own fails with one kernel only the first root of the projection fuses, and the partial-decline rule (VARKA-613) leaves a projection with more residual entries than fused ones to Spark, so the plan has no Varka node
validityByWidth=false VarkaCoverageDifferentialSuite INVALID_PARAMETER_VALUE.BIT_POSITION_RANGE reaches the user as the row engine raises it, from bit_get(i, i) fails validityByWidth=false leaves no baked int lane count, so the TINYINT result of bit_get is stored through a narrow species with no name and the compiler declines the row (VARKA-335, as VARKA-329); the row engine answers it
validityByWidth=false VarkaCoverageHarnessSuite Bitwise and shifts: bit_get(i, 3) matches the row engine under both consumers fails validityByWidth=false leaves no baked int lane count, so the TINYINT result of bit_get is stored through a narrow species with no name and the compiler declines the row (VARKA-335, as VARKA-329); the row engine answers it
validityByWidth=false VarkaCoverageHarnessSuite Bitwise and shifts: bit_get(i, i) matches the row engine under both consumers fails validityByWidth=false leaves no baked int lane count, so the TINYINT result of bit_get is stored through a narrow species with no name and the compiler declines the row (VARKA-335, as VARKA-329); the row engine answers it
diff --git a/sql/varka/plans/m8/PLAN.md b/sql/varka/plans/m8/PLAN.md
index 1730c737b866b..46b2b2f26e4e6 100644
--- a/sql/varka/plans/m8/PLAN.md
+++ b/sql/varka/plans/m8/PLAN.md
@@ -1350,7 +1350,7 @@ catalogue keep theirs. Sizes are the house's small, medium and large.
| 610 | **Done** (merged as #1537 on 14 November 2026, merge commit `b1328bfe681`: the two BIGINT sums' domains are their guards' conditions through the shared `tryDomain`, the four `arrowBatchSize` skips are gone, `CAST(dt AS BIGINT)`'s domain is the exact `EXACT_DIVIDEND_BOUND` bound, and the fixture carries both operands). **Started** (Planned in `VARKA-610.md`, 14 November 2026; added 13 November 2026, from #1484's option matrix run 43504150236 on MaxGekk/spark (head 031e96ac7ce), which failed two BIGINT domain tests under each of `arrowBatchSize=1` and `arrowBatchSize=3`). **The domain check holds a row's domain equal to its guards' condition, which the BIGINT sums' domain is not.** `VarkaDomains.check` requires every batch outside a row's recorded domain to be one the guards condemn, which holds only where the domain is the guard's own condition. `l + l2`'s domain is the operands' input range, narrower than the guard's sum-overflow test, so a batch of outside rows that holds no overflowing row is answered, and answered correctly; a smaller Arrow batch splits the rows so that such a batch exists, which is why the two tests were red under `arrowBatchSize=1` and `arrowBatchSize=3` and are in `skips.tsv` under both until this row lands. **Done when** either the guarded rows' domains become their guards' own conditions where SQL can state them, or `VarkaDomains.check` states which direction it holds and why, and the four `skips.tsv` lines under the two `arrowBatchSize` configurations are gone; built 14 November 2026 on branch `varka-610`: the two sums' domains are their guards' conditions in SQL through `try_add` and `try_subtract` (`VarkaCoverageSuite`'s `tryDomain`), the four `skips.tsv` lines are gone, and the option matrix passes the coverage harness suite 2569 tests in each of `arrowBatchSize=1` and `=3` beside the defaults, done when it merges | #1484's matrix, run 43504150236 on MaxGekk/spark, head 031e96ac7ce | small |
| 611 | **Planned** (`VARKA-611.md`, 20 November 2026; the admission check: the checked `BIGINT` multiply over a column still declines (option A only), and since #1424 the exact AVX2 long-to-double forms make option B buildable on the EPYC runners at level 2 too, not only on an AVX512DQ host) **Planned** (added 14 November 2026, from the retro review of the skip commit `cd12e2ba197` merged under #1484). **The checked `BIGINT` multiply's option B has no owner.** `VARKA-104.md` 9.1 records the checked multiply shipping as option A, and options B and C as step 4's remaining work; option C is row 361's 64 by 64 to 128-bit product from 32-bit limbs, but no row owns option B, the double-lane magnitude pre-check, which 10.1 item 4 makes an AVX512DQ-only form and 6.1 prediction 3 would measure against A. Row 104 keeps its status open without it, its note naming this row. **Done when** option B is built over the two double lanes and measured against A on an AVX512DQ host (the laptop at 256 bits; the EPYC 7763 runners are AVX2 and cannot run it), its decline rate against the row path is recorded as `VARKA-104.md` 7 risk 3 requires, and `VARKA-104.md` 9 records the choice per host, or the option is dated as dropped | #1484; `VARKA-104.md` 6.1 prediction 3, 7 risk 3, 9.1 and 10.1 item 4; row 361 | small |
| 612 | **Planned** (`VARKA-612.md`, 20 November 2026; added 14 November 2026, from the day-time baseline runs of 14 November 2026: run 43582841112 at 256 bits and run 43582853857 at `-XX:MaxVectorSize=16` on an EPYC 7763, whose results files and `VARKA-103.md` baseline section commit with #1534; the admission check: the day-time arms' `FAIL` checks never reach row 104's `twoLaneChecked`, which keys on `LongType`, so they still fuse at two 64-bit lanes and the committed 128-bit file still reads 0.5X to 1.0X). **The day-time interval arms are at parity or slower at 128 bits.** At 128 bits the same kernels read 1.0x for `dt + dt2 - dt`, 0.8x for `abs(dt)` and 0.9x for `dt * 3`, and 0.5x to 0.7x at one row in ten null, against 3.9x to 4.4x at 256 bits, so the record argues for declining these arms at two 64-bit lanes as the two-lane condition already declines filters. **Done when** the day-time arms, and whichever other masked long-lane projections the same reasoning covers, either decline at two 64-bit lanes as the two-lane condition (row 503) already declines filters, or a width-conditional lowering is built and measured; the matrix and the 128-bit baseline then show no row slower than the row path | `VARKA-103.md`'s baseline runs (14 November 2026), runs 43582841112 and 43582853857; row 503's two-lane condition | small to medium |
-| 613 | **Planned** (`VARKA-613.md`, 20 November 2026; added 14 November 2026, from the same two runs of 14 November 2026, 43582841112 at 256 bits and 43582853857 at 128, whose results files commit with #1534; the admission check: the blend still fuses only `extract(DAY)` and merges the other three per row, and the committed EPYC 7763 files read it at 0.7X at 256 bits and 0.5X at 128, while `extract(DAY FROM dt)` alone wins 3.9X and 4.9X at 256 bits). **The four-extract blend fuses in part and is slower than the row path.** `extract DAY, HOUR, MINUTE and SECOND together` reads 66.1 against 47.2 ns a row at 256 bits and 94.4 against 47.2 at 128, so the fused part costs more than the row path beside it. **Done when** the blend either declines whole (the row engine answers) or is restructured so the fused part carries the work; the baseline section then shows it no slower than the row path at 256 and 128 bits | `VARKA-103.md`'s baseline runs (14 November 2026), runs 43582841112 and 43582853857 | small |
+| 613 | **Started** (20 November 2026, `VARKA-613.md` 9: the laptop probe chose rule (R2), a projection under a row consumer whose residual entries outnumber its fused ones is left to Spark, and the decline is built in `VarkaColumnarRule`'s post stage with `VarkaPartialDeclineSuite`, the blend's class `NONE`; left: the suites run, the golden corpus and generated files regenerated, and the owner's runner dispatch of the day-time baseline and the probe at both widths. Planned in `VARKA-613.md`, 20 November 2026; added 14 November 2026, from the same two runs of 14 November 2026, 43582841112 at 256 bits and 43582853857 at 128, whose results files commit with #1534; the admission check: the blend still fuses only `extract(DAY)` and merges the other three per row, and the committed EPYC 7763 files read it at 0.7X at 256 bits and 0.5X at 128, while `extract(DAY FROM dt)` alone wins 3.9X and 4.9X at 256 bits). **The four-extract blend fuses in part and is slower than the row path.** `extract DAY, HOUR, MINUTE and SECOND together` reads 66.1 against 47.2 ns a row at 256 bits and 94.4 against 47.2 at 128, so the fused part costs more than the row path beside it. **Done when** the blend either declines whole (the row engine answers) or is restructured so the fused part carries the work; the baseline section then shows it no slower than the row path at 256 and 128 bits | `VARKA-103.md`'s baseline runs (14 November 2026), runs 43582841112 and 43582853857 | small |
| 614 | **Planned** (`VARKA-614.md`, 20 November 2026; the admission check: all three spike benchmarks still settle on their own code-list `levelInUse`, and the shared helper takes each as it is, its kernel class the benchmark class and its loop set the arm's one static loop) **Planned** (added 14 November 2026, from #1531's review of row 442, which corrected `VARKA-442.md` 6 and `sql/varka/skills/the-jit.md`). **Three spike benchmarks keep their own settle loops.** `VarkaNarrowLaneBenchmark`, `VarkaDecimalPairSpikeBenchmark` and `VarkaDecimalRemainderSpikeBenchmark` each drive until their own code-list `levelInUse` reads level 4, which cannot tell an on-stack-replacement version from a method's own and never sees a loop C2 inlined into its caller - the condition row 442 replaced for the emitted-kernel benchmarks; `VARKA-442.md` 6 was corrected on 14 November 2026 to say so, and the skill's settling bullet names them as exceptions. **Done when** each settles through `VarkaEmitterTestSupport.Settle.drive`, its own parser and in-use fold are gone, and the skill's settling bullet names no exception | `VARKA-442.md` 6; `sql/varka/skills/the-jit.md`; `VarkaNarrowLaneBenchmark`, `VarkaDecimalPairSpikeBenchmark` and `VarkaDecimalRemainderSpikeBenchmark`; row 442 (#1531) | small |
| 615 | **Started** (20 November 2026, local branch `varka-615-width-audit-admission`, not pushed: `coverageRows(coverageJson, admission, keep)` and `predicateRow` take the admission, the one-argument form keeps the host's, the d18 `IN` test requires a `Shape` under `NO_HOST_REFUSAL` and keeps the host's answer, passed on the laptop at the defaults and under `-XX:UseAVX=2 -XX:MaxVectorSize=16`, no committed file moved; left: the pull request and its CI; `VARKA-615.md` 11). **Planned** (`VARKA-615.md`, 20 November 2026; the admission check: `coverageRows` and `predicateRow` still compile under the private `hostAdmission` and the d18 `IN` test still accepts the two-lane decline, so a test-only admission parameter, with the one-argument form kept for the probe and the census, closes it; added 14 November 2026, from `VARKA-607.md`'s correction of that day, after the weekly sweeps run 43577422049 failed the AVX2-at-128 job). **The width audit cannot be asked to compile a row on a host that refuses it.** `VarkaWidthAuditShapes.coverageRows` hardcodes the host admission, so on a two-lane 64-bit host row 607's audit-row test can only assert the refusal, not that the audit compiles the row. **Done when** `coverageRows` takes a `VarkaAdmission` the way `VarkaWarmupReach` does with `NO_HOST_REFUSAL`, row 607's test asserts a `Shape` on every host, and the audit's committed files are unchanged | `VARKA-607.md`'s correction (14 November 2026); row 607 (#1529); `VarkaWarmupReach`'s `NO_HOST_REFUSAL` | small |
| 616 | **Done** (fixed on branch `varka-fuzz-1533`, 14 November 2026, and merged as #1544 on 15 November 2026, merge commit `ea82c60635f`). **A body's arm-chain reach is its planned emitted set, not its outputs' full subtrees.** The nightly fuzz's run 43575499009 failed in the duplicated variant at seed 202611140, iteration 22330: the variant puts each root in two loop groups, so a later group loads the civil-from-days prefix an earlier one materialized (VARKA-198), and `Slots.plan` leaves the loaded date's subtree out of the body and its value columns. The reach was still taken over the roots' full subtrees, so a day producer under the loaded date counted as reached, `emitChainConditions` emitted its enclosing `IfElse`'s arm condition over `col:0`, and `Slots.srcSeg` refused a column with no data segment under `elideUnreadLocals` (VARKA-239). `VarkaBodyEmitter.emitLaneGroup` now installs `Slots.emittedBody`, the set `Slots.plan` decides before numbering slots, and `Analysis.reachOf` is gone; the regression test "the duplicated variant of a draw whose root fills a materialized prefix compares" pins draw 22330 and asserts its emission compares and reaches `PREFIX_LOADED`. Recorded: **(a)** a guard shared between a loaded date's subtree and an emitted use in the loading body can stay unqualified there, because the chains whose `IfElse` steps lie under the materialized date are dropped and `underMaterializedDate` then returns none, so the body declines batches the row engine answers, which is never wrong but is a fallback on the shapes the duplicated variant creates and is untested by `VarkaGuardEdgeSuite` (a test would build one root whose date one group materializes and whose guard another group also emits, over a batch where that guard's arm fails and the other does not); **(b)** `Slots.emittedNodes` and `Slots.bodyUses` are two models of which edges the emission skips - they already differ on chrono fragment sharing and the word-only `IsNotNull` skip - each now says what it owns, and unifying them is owed. **Done when** the pinned draw compares and reaches the mechanism, the fuzzer runs green at the pinned seed, and the default path's emitted bytes are unchanged | the nightly's run 43575499009, seed 202611140 iteration 22330; `VARKA-198.md` (materialized prefixes), `VARKA-239` (elideUnreadLocals); `VarkaIrFuzzSuite.scala`, `Slots.java`, `VarkaBodyEmitter.java` | small |
diff --git a/sql/varka/plans/m8/VARKA-613.md b/sql/varka/plans/m8/VARKA-613.md
index 50f91170a16c7..e87d1c4ad2f11 100644
--- a/sql/varka/plans/m8/VARKA-613.md
+++ b/sql/varka/plans/m8/VARKA-613.md
@@ -192,7 +192,177 @@ than the row path at 256 and 128 bits.
## 9. Outcome
-Not built.
+Started 20 November 2026, while the owner was away; steps 1 and 2 are built, steps 3 and 4 are
+owed (below).
+
+### 9.1 Step 1, the probe
+
+`VarkaPartialProjectionProbe` ran on the laptop before the change, three passes of each null
+density: run 1 at 256 and at 128 bits, then run 2 at 256 bits. Its output is
+`results/VARKA-613-probe.txt`. The laptop was shared at a one-minute load of 30 to 60 (about 40 at
+the start of run 1, about 60 at the end of run 2, the file gives each), far busier than 598's
+probe.
+
+**The control decides which passes count.** `extract(DAY FROM dt)` alone is committed at 3.9X on
+the runners, but it lost in the no-null pass of every run (0.8X, 0.9X, 0.8X), and won in every
+nulls pass (2.6X, 1.4X, 2.1X). A pass whose control loses is not measuring the kernel, so only
+the nulls passes are read. This drops c's 2.2X in run 1's no-null pass, which favours (R2), as
+well as both readings that contradict it: a at 1.3X in run 1 and b at 1.6X in run 2, each in a
+pass whose row arm read far slower than the same query at the other density (301 against 103 ms,
+506 against 289).
+
+Best times, ms, row path then varka on, the counted passes:
+
+| shape | run 1, 256 bits | run 2, 256 bits | run 1, 128 bits |
+|---|---|---|---|
+| a. the blend | 103 / 153, loss | 395 / 426, band | 305 / 394, band |
+| b. other inputs | 128 / 136, band | 289 / 351, band | 281 / 402, loss |
+| c. heavy, shared | 118 / 81, win | 328 / 296, band | (row 612's loss) |
+| d. heavy, other | 285 / 183, win | 464 / 515, band | (row 612's loss) |
+
+The 128-bit no-null pass is not read either (its control read 0.9X); there a and b read 0.8X and
+0.5X, losses for both.
+
+**The rule is (R2), residual-heavy.** (R1) declines c, which wins, and keeps b, which loses at
+128 bits, so it fails twice. (R2) declines a and b and keeps c and d, which fits every counted
+reading and the runners' committed loss of the blend at both widths. The rule is
+`VarkaPartialDecline.reason`: decline when the residual entries outnumber the fused ones, the
+entries of every kernel together, with forwarded columns counted as neither. The review round
+(9.2) weighs the entries by their operators instead of counting them.
+
+Predictions of 6.1, scored on the counted passes:
+
+1. Shape a loses at both widths: **half right**. It read 0.7X at 256 bits in run 1 and stayed in
+ the band in run 2 and at 128 bits. Shape c wins at 256 bits by 1.3x: **right** in run 1
+ (1.5X), in the band in run 2.
+2. Shape b within 10% of the row path at 256 bits: **right** in run 1 (6%), **wrong** in run 2
+ (21% slower, still inside the 1.3x band).
+3. Shape d wins at 256 bits by 1.3x: **right** in run 1 (1.6X), in the band in run 2.
+4. (R2) matches, c separates the rules: **right**.
+5. The blend at 1.0X on the runners: owed (step 4).
+
+### 9.2 Step 2, the decline
+
+Built as 3.1 says, with the reason in `VarkaPartialDecline` rather than a fusion report
+(decisions, item 1). `VarkaColumnarRule`'s post stage asks it in the
+`ColumnarToRowExec(VarkaProjectExec)` arm, which then plans Spark's `ProjectExec` over the
+child's rows (correction below), and in the `ProjectExec ... if isVarkaEligible` arm, which then leaves the projection as it is.
+The blend's class in `VarkaDayTimeIntervalBaselineBenchmark` is `NONE` at both densities.
+`VarkaDecimalBaselineQueriesSuite`'s `x9 < y9, -x38 < y38` ties one to one and stays `PARTIAL`, so
+that suite is unchanged. Only `build/sbt sql/Test/compile` was run in this window; the suites of
+step 2's done-when are owed.
+
+One quick run of `VarkaPartialDeclineSuite` passed four of its five tests. The fifth compared
+the declined plan with the plan of the shared Varka-off session, `disabledSpark`, and failed
+there: that session reads the Arrow cache as rows (`Project` over `InputAdapter`, no
+`ColumnarToRow`), while the declined plan reads it as batches. The test now asserts the declined
+plan's operators instead and has not been run since. Prediction 5 rests on the benchmark's
+varka off arm reading batches too, as its `VarkaArrowSessions` session sets the vectorized cache
+reader; the owed plan-only dry run of the baseline is where to check it.
+
+*Correction, the same day, before any further run.* That guess was wrong, and the failure was a
+finding about the code, not the test. `ApplyColumnarRulesAndInsertTransitions` inserts no to-row
+transition under a row parent when the child produces rows as well as batches
+(`ensureOutputsRowBased`), and the Arrow-cached `InMemoryTableScanExec` does both. So Spark's
+row-path plan is `Project` over the scan read as rows, in every session without Varka, the
+benchmark's varka off arm included, and the declined `ProjectExec(ColumnarToRowExec(scan))` was a
+third plan that nobody had measured. The decline now gives the projection its child's rows as the
+transition rule would (`declinedChild`): a child that produces rows itself as it is, a Varka filter
+as its to-row node (the second bug the reading found: `transformUp` does not revisit what an arm
+returns, so a compacting `VarkaFilterExec` would have stayed under the declined projection), and
+any other columnar child under a `ColumnarToRowExec`. The suite's comparison with `disabledSpark`
+is back, and a filtered shape is added. Both ran in the review round (9.5).
+
+*Review round, 22 November 2026 (`/code-review high`, three important findings).*
+
+1. **Cost beside count.** The rule counted entries, so one expensive fused entry beside two cheap
+ residual ones was declined, losing a kernel that carries most of the work. It now also weighs
+ each entry by the operators of its expression (inner nodes, not aliases or leaves), and
+ declines only when the residual entries outnumber the fused ones (every kernel) and also
+ outweigh them. Weighing alone was tried first and moved `x9 < y9, -x38 < y38` (1 to 3) to a
+ decline, which 3.1 and `VarkaDecimalBaselineQueriesSuite` say stays `PARTIAL`; requiring both
+ declines no shape the count kept. Reason for this design over IR op counts or a cost model:
+ the probe's shapes keep their verdicts (a and b decline at 3 entries of 3 operators to 1 of 1;
+ c and d keep), it needs no new API on the classification, and it is the smaller change. It is
+ still a proxy that no measurement calibrates beyond those shapes; the runner probe of step 4
+ is where to widen it. A new test keeps `abs(-dt * 3)` beside two residual extracts (2
+ entries of 2 operators to 1 of 3, which the count alone declines).
+2. **Nested projections.** `declinedChild` left an inner `VarkaProjectExec` under a plain
+ `ColumnarToRowExec`, so the inner kernel with its merge ran under a row consumer. The arm and
+ `declinedChild` now share `projectionToRows`, which asks the rule of the inner projection too.
+ A test hand-builds the blend over shape b's projection (the optimizer collapses two) and
+ asserts no Varka node is left.
+3. **The final shape was never run.** The owed suites ran; see 9.5.
+
+### 9.3 Where the plan was wrong
+
+1. 3.1's procedure has no rule for a failed control or for a shape that reads both ways in two
+ passes. The control rule above is the one this probe needed; a later probe should state it
+ before it runs.
+2. Step 3's done-when, `dev/varka_regen_generated.sh --all` leaving no diff, does not cover the
+ golden corpus, which has its own switch (`skills/working-in-this-repo.md`, the `--all`
+ section): `VARKA_GOLDEN_REGEN=true build/sbt -batch "sql/testOnly *VarkaGoldenCorpusSuite"`.
+3. 3.1's "the node's fusion report records the reason" cannot hold for a declined plan, which
+ has no Varka node (decisions, item 1).
+4. 3.1 plans "Spark's `ProjectExec` over a plain `ColumnarToRowExec` of the child", and 6.1 item 5
+ expects "its plan is Spark's". The two disagree over an Arrow-cached scan, which Spark reads as
+ rows; 9.2's correction takes item 5's side.
+
+### 9.5 Suites run
+
+On 22 November 2026 on the laptop, defaults, under the heavy lock, one JVM, after merging master
+and with the review round's changes: `dev/varka_matrix.sh --defaults --suites` over 34 suites,
+456 tests, 0 failed. They are `VarkaPartialDeclineSuite` (with the filtered shape, the
+`disabledSpark` shape comparison, the heavy-fused counter-shape and the nested declined
+projections), `VarkaDayTimeIntervalBaselineQueriesSuite`, `VarkaDecimalBaselineQueriesSuite`, every
+other `*BaselineQueriesSuite`, `VarkaEndToEndSuite`, `VarkaSparkFuzzSuite`,
+`VarkaFloatingLaneSuite`, `VarkaGoldenCorpusSuite` and the suites that name `VarkaProjectExec`,
+`VarkaColumnarToRowExec` or `PARTIAL`. The first run failed four tests, two findings:
+
+* `VarkaDecimalBaselineQueriesSuite` (three tests): the weighing-only rule declined the decimal
+ `PARTIAL` shape; fixed by requiring the count too (item 1 above).
+* `VarkaCodegenGiveUpSuite` G34: its projection (one fused date entry beside sixty `CASE WHEN`
+ entries) is declined under a row consumer by this change, whichever of count or weight is used,
+ so it has no Varka node there. The test now asserts that and runs its two measured windows
+ through a `noop` write, where the node and its merge path remain; answers are checked beside.
+
+### 9.4 Owed
+
+* Step 2's suites: done, see 9.5.
+* Step 3: the golden corpus regenerated with its own switch, then `dev/varka_regen_generated.sh
+ --all`, and both diffs read entry by entry.
+* Step 4: the owner's runner dispatch of the day-time baseline at both widths, and beside it
+ `VarkaPartialProjectionProbe` on the EPYC 7763 at both widths, which confirms (R2) on a quiet
+ machine or widens it. The blend declines under all three rules, so the row's done-when does not
+ depend on that second run.
+
+## Decisions taken while the owner was away (20 November 2026)
+
+1. **Where the reason lives.** A declined projection has no Varka node, so no fusion report can
+ carry the reason as 3.1 says. The rule is one Java method, `VarkaPartialDecline.reason`,
+ which returns the reason or nothing; both post-stage arms call it, the rule logs the reason at
+ DEBUG with the projection (as it logs a filter it leaves to Spark), and
+ `VarkaPartialDeclineSuite` reads the same method. Reason: it is the smallest place that both
+ the rule and a test can read, and it adds no plan node or tag that Spark's `EXPLAIN` would not
+ show anyway.
+2. **A forced residual is never declined.** `forceResidualAt` (VARKA-296) makes an entry
+ residual so that the Spark differential and the composition fuzzer run the merge path. A
+ forced residual can tip a projection's count, so under the decline a forced shape could lose
+ its Varka node, and the differential would count the force as not applied instead of checking
+ the merge. So the rule returns nothing while the option is set. Reason: the option is a fault
+ injector that no user configuration reaches, and the merge path still runs for every partial
+ projection under a columnar consumer and every one the rule keeps.
+3. **The rule is Java, the arms Scala.** The classification is a sealed `VarkaOutputSpec`
+ matched exhaustively, which is the house style for the IR (AGENTS.md, "Java code"); the rule
+ object stays Scala because it is a Catalyst rule.
+4. **The probe's passes are read by their control, and the rule is (R2).** The laptop could not
+ be made quiet in this window, and a third run under the same load would not have been
+ cleaner. 9.1 gives the control rule and the reading. (R3) was not taken: it would decline c
+ and d, which never lose past 1.3x at 256 bits in any reading. Question 10.1 is therefore moot.
+5. **The declined projection reads its child's rows as Spark would give them** (9.2's
+ correction), not through the `ColumnarToRowExec` 3.1 names. Reason: the done-when compares the
+ declined plan with the row path, and over an Arrow-cached scan the row path reads rows; a
+ to-row transition there would be a plan no session without Varka builds.
## 10. Questions for the owner
diff --git a/sql/varka/plans/m8/results/VARKA-613-probe.txt b/sql/varka/plans/m8/results/VARKA-613-probe.txt
new file mode 100644
index 0000000000000..7558950cc0abe
--- /dev/null
+++ b/sql/varka/plans/m8/results/VARKA-613-probe.txt
@@ -0,0 +1,492 @@
+VarkaPartialProjectionProbe (VARKA-613), laptop (Ryzen AI 9 HX PRO 370), JDK 25, -XX:UseAVX=2
+(the EPYC runners' level), -XX:MaxVectorSize=32 (256-bit lanes) and 16 (128-bit), 2,000,000
+Arrow-cached rows of the day-time baseline's table, local[1], before the change. The laptop was
+shared with other agents' JVMs at a one-minute load average of 30 to 60, given per run, so the
+arms are read against each other within a pass, by best time. Each PLAN line is the Varka
+session's plan; "entries" is the Varka node's line per projection entry.
+
+=== run 1, 256 bits (load at start 39.60 42.64 48.81, at end 31.65 39.03 46.33)
+PLAN control, extract(DAY FROM dt) alone:
+VarkaColumnarToRow [extractansiintervaldays(dt#422) AS a#844]
++- Scan In-memory table varka_day_time_interval [dt#422]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused
+ Running case: spark row path (varka off)
+ Stopped after 12 iterations, 2090 ms
+ Running case: varka on
+ Stopped after 10 iterations, 2199 ms
+control, extract(DAY FROM dt) alone over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+-------------------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 146 174 17 13.7 72.9 1.0X
+varka on 186 220 37 10.8 92.8 0.8X
+PLAN a. the blend:
+VarkaColumnarToRow [extractansiintervaldays(dt#422) AS a#6772, extractansiintervalhours(dt#422) AS b#6773, extractansiintervalminutes(dt#422) AS c#6774, extractansiintervalseconds(dt#422) AS d#6775]
++- Scan In-memory table varka_day_time_interval [dt#422]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: residual (unsupported expression: extractansiintervalhours(varka_day_time_interval.dt)); c: residual (unsupported expression: extractansiintervalminutes(varka_day_time_interval.dt)); d: residual (a decimal(8,6) value as a projection's output: the decimal store writes it, and the values it admits are the TIME functions time_to_seconds and extract(SECOND ...); the others are row 348's: extractansiintervalseconds(varka_day_time_interval.dt))
+ Running case: spark row path (varka off)
+ Stopped after 5 iterations, 2246 ms
+ Running case: varka on
+ Stopped after 7 iterations, 2194 ms
+a. the blend over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 301 449 175 6.6 150.5 1.0X
+varka on 228 313 93 8.8 114.1 1.3X
+PLAN b. other inputs:
+VarkaColumnarToRow [extractansiintervaldays(dt#422) AS a#11327, extractansiintervalhours(dt2#423) AS b#11328, extractansiintervalminutes(dt2#423) AS c#11329, extractansiintervalseconds(dt2#423) AS d#11330]
++- Scan In-memory table varka_day_time_interval [dt#422, dt2#423]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: residual (unsupported expression: extractansiintervalhours(varka_day_time_interval.dt2)); c: residual (unsupported expression: extractansiintervalminutes(varka_day_time_interval.dt2)); d: residual (a decimal(8,6) value as a projection's output: the decimal store writes it, and the values it admits are the TIME functions time_to_seconds and extract(SECOND ...); the others are row 348's: extractansiintervalseconds(varka_day_time_interval.dt2))
+ Running case: spark row path (varka off)
+ Stopped after 8 iterations, 2025 ms
+ Running case: varka on
+ Stopped after 7 iterations, 2167 ms
+b. other inputs over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 170 253 52 11.7 85.1 1.0X
+varka on 200 310 79 10.0 100.0 0.9X
+PLAN c. heavy, shared:
+VarkaColumnarToRow [-dt#422 AS a#16434, abs(dt#422) AS b#16435, (dt#422 * 3) AS c#16436, extractansiintervalhours(dt#422) AS d#16437]
++- Scan In-memory table varka_day_time_interval [dt#422]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: fused; c: fused; d: residual (unsupported expression: extractansiintervalhours(varka_day_time_interval.dt))
+ Running case: spark row path (varka off)
+ Stopped after 11 iterations, 2006 ms
+ Running case: varka on
+ Stopped after 23 iterations, 2069 ms
+c. heavy, shared over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 130 182 28 15.4 64.8 1.0X
+varka on 58 90 26 34.2 29.2 2.2X
+PLAN d. heavy, other:
+VarkaColumnarToRow [-dt#422 AS a#26325, abs(dt#422) AS b#26326, (dt#422 * 3) AS c#26327, make_dt_interval(i#424, i2#425, i3#426, 0.000000) AS d#26328]
++- Scan In-memory table varka_day_time_interval [dt#422, i#424, i2#425, i3#426]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: fused; c: fused; d: residual (unsupported expression: make_dt_interval(varka_day_time_interval.i, varka_day_time_interval.i2, varka...)
+ Running case: spark row path (varka off)
+ Stopped after 11 iterations, 2130 ms
+ Running case: varka on
+ Stopped after 16 iterations, 2016 ms
+d. heavy, other over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 163 194 22 12.2 81.7 1.0X
+varka on 108 126 12 18.5 54.1 1.5X
+PLAN control, extract(DAY FROM dt) alone_n:
+VarkaColumnarToRow [extractansiintervaldays(dt_n#428) AS a#36400]
++- Scan In-memory table varka_day_time_interval [dt_n#428]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused
+ Running case: spark row path (varka off)
+ Stopped after 18 iterations, 2025 ms
+ Running case: varka on
+ Stopped after 43 iterations, 2036 ms
+control, extract(DAY FROM dt) alone_n over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+---------------------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 76 113 41 26.4 37.8 1.0X
+varka on 29 47 12 69.6 14.4 2.6X
+PLAN a. the blend_n:
+VarkaColumnarToRow [extractansiintervaldays(dt_n#428) AS a#57351, extractansiintervalhours(dt_n#428) AS b#57352, extractansiintervalminutes(dt_n#428) AS c#57353, extractansiintervalseconds(dt_n#428) AS d#57354]
++- Scan In-memory table varka_day_time_interval [dt_n#428]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: residual (unsupported expression: extractansiintervalhours(varka_day_time_interval.dt_n)); c: residual (unsupported expression: extractansiintervalminutes(varka_day_time_interval.dt_n)); d: residual (a decimal(8,6) value as a projection's output: the decimal store writes it, and the values it admits are the TIME functions time_to_seconds and extract(SECOND ...); the others are row 348's: extractansiintervalseconds(varka_day_time_interval.dt_n))
+ Running case: spark row path (varka off)
+ Stopped after 16 iterations, 2086 ms
+ Running case: varka on
+ Stopped after 11 iterations, 2042 ms
+a. the blend_n over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 103 130 16 19.4 51.5 1.0X
+varka on 153 186 22 13.1 76.5 0.7X
+PLAN b. other inputs_n:
+VarkaColumnarToRow [extractansiintervaldays(dt_n#428) AS a#66506, extractansiintervalhours(dt2#423) AS b#66507, extractansiintervalminutes(dt2#423) AS c#66508, extractansiintervalseconds(dt2#423) AS d#66509]
++- Scan In-memory table varka_day_time_interval [dt2#423, dt_n#428]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: residual (unsupported expression: extractansiintervalhours(varka_day_time_interval.dt2)); c: residual (unsupported expression: extractansiintervalminutes(varka_day_time_interval.dt2)); d: residual (a decimal(8,6) value as a projection's output: the decimal store writes it, and the values it admits are the TIME functions time_to_seconds and extract(SECOND ...); the others are row 348's: extractansiintervalseconds(varka_day_time_interval.dt2))
+ Running case: spark row path (varka off)
+ Stopped after 13 iterations, 2040 ms
+ Running case: varka on
+ Stopped after 12 iterations, 2140 ms
+b. other inputs_n over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 128 157 20 15.7 63.8 1.0X
+varka on 136 178 23 14.7 68.2 0.9X
+PLAN c. heavy, shared_n:
+VarkaColumnarToRow [-dt_n#428 AS a#75109, abs(dt_n#428) AS b#75110, (dt_n#428 * 3) AS c#75111, extractansiintervalhours(dt_n#428) AS d#75112]
++- Scan In-memory table varka_day_time_interval [dt_n#428]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: fused; c: fused; d: residual (unsupported expression: extractansiintervalhours(varka_day_time_interval.dt_n))
+ Running case: spark row path (varka off)
+ Stopped after 13 iterations, 2085 ms
+ Running case: varka on
+ Stopped after 17 iterations, 2150 ms
+c. heavy, shared_n over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 118 160 32 16.9 59.1 1.0X
+varka on 81 126 35 24.7 40.5 1.5X
+PLAN d. heavy, other_n:
+VarkaColumnarToRow [-dt_n#428 AS a#83896, abs(dt_n#428) AS b#83897, (dt_n#428 * 3) AS c#83898, make_dt_interval(i_n#429, i2#425, i3#426, 0.000000) AS d#83899]
++- Scan In-memory table varka_day_time_interval [dt_n#428, i2#425, i3#426, i_n#429]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: fused; c: fused; d: residual (unsupported expression: make_dt_interval(varka_day_time_interval.i_n, varka_day_time_interval.i2, var...)
+ Running case: spark row path (varka off)
+ Stopped after 6 iterations, 2108 ms
+ Running case: varka on
+ Stopped after 9 iterations, 2195 ms
+d. heavy, other_n over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 285 351 81 7.0 142.6 1.0X
+varka on 183 244 41 10.9 91.4 1.6X
+
+=== run 1, 128 bits (load at start 31.65 39.03 46.33, at end 44.70 41.69 45.79)
+PLAN control, extract(DAY FROM dt) alone:
+VarkaColumnarToRow [extractansiintervaldays(dt#422) AS a#844]
++- Scan In-memory table varka_day_time_interval [dt#422]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused
+ Running case: spark row path (varka off)
+ Stopped after 5 iterations, 2003 ms
+ Running case: varka on
+ Stopped after 5 iterations, 2254 ms
+control, extract(DAY FROM dt) alone over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+-------------------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 320 401 55 6.3 160.0 1.0X
+varka on 376 451 91 5.3 188.0 0.9X
+PLAN a. the blend:
+VarkaColumnarToRow [extractansiintervaldays(dt#422) AS a#3695, extractansiintervalhours(dt#422) AS b#3696, extractansiintervalminutes(dt#422) AS c#3697, extractansiintervalseconds(dt#422) AS d#3698]
++- Scan In-memory table varka_day_time_interval [dt#422]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: residual (unsupported expression: extractansiintervalhours(varka_day_time_interval.dt)); c: residual (unsupported expression: extractansiintervalminutes(varka_day_time_interval.dt)); d: residual (a decimal(8,6) value as a projection's output: the decimal store writes it, and the values it admits are the TIME functions time_to_seconds and extract(SECOND ...); the others are row 348's: extractansiintervalseconds(varka_day_time_interval.dt))
+ Running case: spark row path (varka off)
+ Stopped after 5 iterations, 2463 ms
+ Running case: varka on
+ Stopped after 5 iterations, 3265 ms
+a. the blend over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 351 493 190 5.7 175.5 1.0X
+varka on 467 653 144 4.3 233.3 0.8X
+PLAN b. other inputs:
+VarkaColumnarToRow [extractansiintervaldays(dt#422) AS a#6778, extractansiintervalhours(dt2#423) AS b#6779, extractansiintervalminutes(dt2#423) AS c#6780, extractansiintervalseconds(dt2#423) AS d#6781]
++- Scan In-memory table varka_day_time_interval [dt#422, dt2#423]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: residual (unsupported expression: extractansiintervalhours(varka_day_time_interval.dt2)); c: residual (unsupported expression: extractansiintervalminutes(varka_day_time_interval.dt2)); d: residual (a decimal(8,6) value as a projection's output: the decimal store writes it, and the values it admits are the TIME functions time_to_seconds and extract(SECOND ...); the others are row 348's: extractansiintervalseconds(varka_day_time_interval.dt2))
+ Running case: spark row path (varka off)
+ Stopped after 7 iterations, 2198 ms
+ Running case: varka on
+ Stopped after 5 iterations, 3693 ms
+b. other inputs over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 274 314 32 7.3 136.8 1.0X
+varka on 547 739 145 3.7 273.4 0.5X
+PLAN c. heavy, shared:
+VarkaColumnarToRow [-dt#422 AS a#10781, abs(dt#422) AS b#10782, (dt#422 * 3) AS c#10783, extractansiintervalhours(dt#422) AS d#10784]
++- Scan In-memory table varka_day_time_interval [dt#422]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: fused; c: fused; d: residual (unsupported expression: extractansiintervalhours(varka_day_time_interval.dt))
+ Running case: spark row path (varka off)
+ Stopped after 5 iterations, 2112 ms
+ Running case: varka on
+ Stopped after 5 iterations, 2494 ms
+c. heavy, shared over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 320 422 89 6.2 160.0 1.0X
+varka on 400 499 89 5.0 200.2 0.8X
+PLAN d. heavy, other:
+VarkaColumnarToRow [-dt#422 AS a#14048, abs(dt#422) AS b#14049, (dt#422 * 3) AS c#14050, make_dt_interval(i#424, i2#425, i3#426, 0.000000) AS d#14051]
++- Scan In-memory table varka_day_time_interval [dt#422, i#424, i2#425, i3#426]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: fused; c: fused; d: residual (unsupported expression: make_dt_interval(varka_day_time_interval.i, varka_day_time_interval.i2, varka...)
+ Running case: spark row path (varka off)
+ Stopped after 5 iterations, 2989 ms
+ Running case: varka on
+ Stopped after 5 iterations, 3981 ms
+d. heavy, other over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 475 598 148 4.2 237.3 1.0X
+varka on 528 796 177 3.8 264.0 0.9X
+PLAN control, extract(DAY FROM dt) alone_n:
+VarkaColumnarToRow [extractansiintervaldays(dt_n#428) AS a#17315]
++- Scan In-memory table varka_day_time_interval [dt_n#428]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused
+ Running case: spark row path (varka off)
+ Stopped after 8 iterations, 2081 ms
+ Running case: varka on
+ Stopped after 8 iterations, 2015 ms
+control, extract(DAY FROM dt) alone_n over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+---------------------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 236 260 17 8.5 117.8 1.0X
+varka on 169 252 51 11.8 84.7 1.4X
+PLAN a. the blend_n:
+VarkaColumnarToRow [extractansiintervaldays(dt_n#428) AS a#22700, extractansiintervalhours(dt_n#428) AS b#22701, extractansiintervalminutes(dt_n#428) AS c#22702, extractansiintervalseconds(dt_n#428) AS d#22703]
++- Scan In-memory table varka_day_time_interval [dt_n#428]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: residual (unsupported expression: extractansiintervalhours(varka_day_time_interval.dt_n)); c: residual (unsupported expression: extractansiintervalminutes(varka_day_time_interval.dt_n)); d: residual (a decimal(8,6) value as a projection's output: the decimal store writes it, and the values it admits are the TIME functions time_to_seconds and extract(SECOND ...); the others are row 348's: extractansiintervalseconds(varka_day_time_interval.dt_n))
+ Running case: spark row path (varka off)
+ Stopped after 6 iterations, 2100 ms
+ Running case: varka on
+ Stopped after 5 iterations, 2566 ms
+a. the blend_n over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 305 350 52 6.6 152.7 1.0X
+varka on 394 513 121 5.1 197.2 0.8X
+PLAN b. other inputs_n:
+VarkaColumnarToRow [extractansiintervaldays(dt_n#428) AS a#26703, extractansiintervalhours(dt2#423) AS b#26704, extractansiintervalminutes(dt2#423) AS c#26705, extractansiintervalseconds(dt2#423) AS d#26706]
++- Scan In-memory table varka_day_time_interval [dt2#423, dt_n#428]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: residual (unsupported expression: extractansiintervalhours(varka_day_time_interval.dt2)); c: residual (unsupported expression: extractansiintervalminutes(varka_day_time_interval.dt2)); d: residual (a decimal(8,6) value as a projection's output: the decimal store writes it, and the values it admits are the TIME functions time_to_seconds and extract(SECOND ...); the others are row 348's: extractansiintervalseconds(varka_day_time_interval.dt2))
+ Running case: spark row path (varka off)
+ Stopped after 6 iterations, 2106 ms
+ Running case: varka on
+ Stopped after 5 iterations, 2488 ms
+b. other inputs_n over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 281 351 36 7.1 140.6 1.0X
+varka on 402 498 107 5.0 201.1 0.7X
+PLAN c. heavy, shared_n:
+VarkaColumnarToRow [-dt_n#428 AS a#30522, abs(dt_n#428) AS b#30523, (dt_n#428 * 3) AS c#30524, extractansiintervalhours(dt_n#428) AS d#30525]
++- Scan In-memory table varka_day_time_interval [dt_n#428]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: fused; c: fused; d: residual (unsupported expression: extractansiintervalhours(varka_day_time_interval.dt_n))
+ Running case: spark row path (varka off)
+ Stopped after 9 iterations, 2224 ms
+ Running case: varka on
+ Stopped after 5 iterations, 3398 ms
+c. heavy, shared_n over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 179 247 62 11.2 89.6 1.0X
+varka on 403 680 159 5.0 201.3 0.4X
+PLAN d. heavy, other_n:
+VarkaColumnarToRow [-dt_n#428 AS a#35261, abs(dt_n#428) AS b#35262, (dt_n#428 * 3) AS c#35263, make_dt_interval(i_n#429, i2#425, i3#426, 0.000000) AS d#35264]
++- Scan In-memory table varka_day_time_interval [dt_n#428, i2#425, i3#426, i_n#429]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: fused; c: fused; d: residual (unsupported expression: make_dt_interval(varka_day_time_interval.i_n, varka_day_time_interval.i2, var...)
+ Running case: spark row path (varka off)
+ Stopped after 7 iterations, 2069 ms
+ Running case: varka on
+ Stopped after 5 iterations, 2870 ms
+d. heavy, other_n over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 185 296 79 10.8 92.7 1.0X
+varka on 511 574 53 3.9 255.7 0.4X
+
+=== run 2, 256 bits (load at start 49.37 42.96 46.10, at end 59.11 50.14 48.25)
+PLAN control, extract(DAY FROM dt) alone:
+VarkaColumnarToRow [extractansiintervaldays(dt#422) AS a#844]
++- Scan In-memory table varka_day_time_interval [dt#422]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused
+ Running case: spark row path (varka off)
+ Stopped after 6 iterations, 2234 ms
+ Running case: varka on
+ Stopped after 5 iterations, 2198 ms
+control, extract(DAY FROM dt) alone over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+-------------------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 272 372 119 7.4 135.8 1.0X
+varka on 335 440 77 6.0 167.3 0.8X
+PLAN a. the blend:
+VarkaColumnarToRow [extractansiintervaldays(dt#422) AS a#4057, extractansiintervalhours(dt#422) AS b#4058, extractansiintervalminutes(dt#422) AS c#4059, extractansiintervalseconds(dt#422) AS d#4060]
++- Scan In-memory table varka_day_time_interval [dt#422]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: residual (unsupported expression: extractansiintervalhours(varka_day_time_interval.dt)); c: residual (unsupported expression: extractansiintervalminutes(varka_day_time_interval.dt)); d: residual (a decimal(8,6) value as a projection's output: the decimal store writes it, and the values it admits are the TIME functions time_to_seconds and extract(SECOND ...); the others are row 348's: extractansiintervalseconds(varka_day_time_interval.dt))
+ Running case: spark row path (varka off)
+ Stopped after 5 iterations, 2340 ms
+ Running case: varka on
+ Stopped after 5 iterations, 3140 ms
+a. the blend over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 327 468 169 6.1 163.7 1.0X
+varka on 486 628 180 4.1 243.1 0.7X
+PLAN b. other inputs:
+VarkaColumnarToRow [extractansiintervaldays(dt#422) AS a#6956, extractansiintervalhours(dt2#423) AS b#6957, extractansiintervalminutes(dt2#423) AS c#6958, extractansiintervalseconds(dt2#423) AS d#6959]
++- Scan In-memory table varka_day_time_interval [dt#422, dt2#423]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: residual (unsupported expression: extractansiintervalhours(varka_day_time_interval.dt2)); c: residual (unsupported expression: extractansiintervalminutes(varka_day_time_interval.dt2)); d: residual (a decimal(8,6) value as a projection's output: the decimal store writes it, and the values it admits are the TIME functions time_to_seconds and extract(SECOND ...); the others are row 348's: extractansiintervalseconds(varka_day_time_interval.dt2))
+ Running case: spark row path (varka off)
+ Stopped after 5 iterations, 2991 ms
+ Running case: varka on
+ Stopped after 6 iterations, 2439 ms
+b. other inputs over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 506 598 97 4.0 253.2 1.0X
+varka on 324 407 67 6.2 161.8 1.6X
+PLAN c. heavy, shared:
+VarkaColumnarToRow [-dt#422 AS a#10591, abs(dt#422) AS b#10592, (dt#422 * 3) AS c#10593, extractansiintervalhours(dt#422) AS d#10594]
++- Scan In-memory table varka_day_time_interval [dt#422]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: fused; c: fused; d: residual (unsupported expression: extractansiintervalhours(varka_day_time_interval.dt))
+ Running case: spark row path (varka off)
+ Stopped after 5 iterations, 3520 ms
+ Running case: varka on
+ Stopped after 6 iterations, 2443 ms
+c. heavy, shared over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 554 704 116 3.6 276.9 1.0X
+varka on 377 407 25 5.3 188.5 1.5X
+PLAN d. heavy, other:
+VarkaColumnarToRow [-dt#422 AS a#13674, abs(dt#422) AS b#13675, (dt#422 * 3) AS c#13676, make_dt_interval(i#424, i2#425, i3#426, 0.000000) AS d#13677]
++- Scan In-memory table varka_day_time_interval [dt#422, i#424, i2#425, i3#426]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: fused; c: fused; d: residual (unsupported expression: make_dt_interval(varka_day_time_interval.i, varka_day_time_interval.i2, varka...)
+ Running case: spark row path (varka off)
+ Stopped after 5 iterations, 2384 ms
+ Running case: varka on
+ Stopped after 5 iterations, 2640 ms
+d. heavy, other over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 328 477 210 6.1 163.9 1.0X
+varka on 395 528 119 5.1 197.4 0.8X
+PLAN control, extract(DAY FROM dt) alone_n:
+VarkaColumnarToRow [extractansiintervaldays(dt_n#428) AS a#16941]
++- Scan In-memory table varka_day_time_interval [dt_n#428]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused
+ Running case: spark row path (varka off)
+ Stopped after 5 iterations, 2065 ms
+ Running case: varka on
+ Stopped after 9 iterations, 2110 ms
+control, extract(DAY FROM dt) alone_n over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+---------------------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 356 413 55 5.6 178.0 1.0X
+varka on 170 235 63 11.7 85.1 2.1X
+PLAN a. the blend_n:
+VarkaColumnarToRow [extractansiintervaldays(dt_n#428) AS a#21421, extractansiintervalhours(dt_n#428) AS b#21422, extractansiintervalminutes(dt_n#428) AS c#21423, extractansiintervalseconds(dt_n#428) AS d#21424]
++- Scan In-memory table varka_day_time_interval [dt_n#428]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: residual (unsupported expression: extractansiintervalhours(varka_day_time_interval.dt_n)); c: residual (unsupported expression: extractansiintervalminutes(varka_day_time_interval.dt_n)); d: residual (a decimal(8,6) value as a projection's output: the decimal store writes it, and the values it admits are the TIME functions time_to_seconds and extract(SECOND ...); the others are row 348's: extractansiintervalseconds(varka_day_time_interval.dt_n))
+ Running case: spark row path (varka off)
+ Stopped after 5 iterations, 2485 ms
+ Running case: varka on
+ Stopped after 5 iterations, 2975 ms
+a. the blend_n over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 395 497 89 5.1 197.6 1.0X
+varka on 426 595 150 4.7 213.0 0.9X
+PLAN b. other inputs_n:
+VarkaColumnarToRow [extractansiintervaldays(dt_n#428) AS a#24688, extractansiintervalhours(dt2#423) AS b#24689, extractansiintervalminutes(dt2#423) AS c#24690, extractansiintervalseconds(dt2#423) AS d#24691]
++- Scan In-memory table varka_day_time_interval [dt2#423, dt_n#428]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: residual (unsupported expression: extractansiintervalhours(varka_day_time_interval.dt2)); c: residual (unsupported expression: extractansiintervalminutes(varka_day_time_interval.dt2)); d: residual (a decimal(8,6) value as a projection's output: the decimal store writes it, and the values it admits are the TIME functions time_to_seconds and extract(SECOND ...); the others are row 348's: extractansiintervalseconds(varka_day_time_interval.dt2))
+ Running case: spark row path (varka off)
+ Stopped after 6 iterations, 2211 ms
+ Running case: varka on
+ Stopped after 5 iterations, 2968 ms
+b. other inputs_n over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 289 369 49 6.9 144.5 1.0X
+varka on 351 594 226 5.7 175.3 0.8X
+PLAN c. heavy, shared_n:
+VarkaColumnarToRow [-dt_n#428 AS a#28507, abs(dt_n#428) AS b#28508, (dt_n#428 * 3) AS c#28509, extractansiintervalhours(dt_n#428) AS d#28510]
++- Scan In-memory table varka_day_time_interval [dt_n#428]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: fused; c: fused; d: residual (unsupported expression: extractansiintervalhours(varka_day_time_interval.dt_n))
+ Running case: spark row path (varka off)
+ Stopped after 5 iterations, 2675 ms
+ Running case: varka on
+ Stopped after 5 iterations, 2079 ms
+c. heavy, shared_n over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 328 535 232 6.1 163.9 1.0X
+varka on 296 416 112 6.7 148.2 1.1X
+PLAN d. heavy, other_n:
+VarkaColumnarToRow [-dt_n#428 AS a#31406, abs(dt_n#428) AS b#31407, (dt_n#428 * 3) AS c#31408, make_dt_interval(i_n#429, i2#425, i3#426, 0.000000) AS d#31409]
++- Scan In-memory table varka_day_time_interval [dt_n#428, i2#425, i3#426, i_n#429]
+ +- InMemoryRelation [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, dt_n#428, i_n#429, s_n#430], StorageLevel(disk, memory, deserialized, 1 replicas)
+ +- *(1) Project [dt#422, dt2#423, i#424, i2#425, i3#426, s#427, CASE WHEN ((id#431L % 10) = 1) THEN null ELSE dt#422 END AS dt_n#428, CASE WHEN ((id#431L % 10) = 3) THEN null ELSE i#424 END AS i_n#429, CASE WHEN ((id#431L % 10) = 5) THEN null ELSE s#427 END AS s_n#430]
+ +- *(1) Project [id#431L, CASE WHEN ((id#431L % 1000) = 7) THEN INTERVAL '-0 00:00:00.000001' DAY TO SECOND WHEN ((id#431L % 1000) = 8) THEN INTERVAL '-1 00:00:00' DAY TO SECOND ELSE make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 1, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 2, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) END AS dt#422, make_dt_interval(0, 0, 0, cast((cast(hash(id#431L, 3, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 4, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6))) AS dt2#423, (pmod(hash(id#431L, 5, 42), 200001) - 100000) AS i#424, (pmod(hash(id#431L, 6, 42), 2001) - 1000) AS i2#425, (pmod(hash(id#431L, 9, 42), 200001) - 100000) AS i3#426, cast((cast(hash(id#431L, 7, 42) as decimal(18,6)) + (cast(pmod(hash(id#431L, 8, 42), 1000000) as decimal(10,0)) * 0.000001)) as decimal(18,6)) AS s#427]
+ +- *(1) Range (0, 2000000, step=1, splits=1)
+ entries: a: fused; b: fused; c: fused; d: residual (unsupported expression: make_dt_interval(varka_day_time_interval.i_n, varka_day_time_interval.i2, var...)
+ Running case: spark row path (varka off)
+ Stopped after 5 iterations, 3454 ms
+ Running case: varka on
+ Stopped after 5 iterations, 3785 ms
+d. heavy, other_n over 2000000 rows: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
+------------------------------------------------------------------------------------------------------------------------
+spark row path (varka off) 464 691 237 4.3 231.9 1.0X
+varka on 515 757 172 3.9 257.5 0.9X
diff --git a/sql/varka/skills/benchmarking.md b/sql/varka/skills/benchmarking.md
index 6b1d4e28e7be9..8247f5f80f9ee 100644
--- a/sql/varka/skills/benchmarking.md
+++ b/sql/varka/skills/benchmarking.md
@@ -872,6 +872,19 @@ has nothing to measure on a 128-bit core; the summary then reads `n/a` for the l
and the ratio. A result from the Arm runner is comparable only with another from it, and an x86
result only with one from its own pinned CPU (the EPYC 7763 rule is unchanged).
+## A probe pass whose fused control loses is not read
+
+VARKA-613. On a laptop shared at a load of 30 to 60, `VarkaPartialProjectionProbe`'s no-null pass
+read its control, `extract(DAY FROM dt)` alone, at 0.8X to 0.9X in all three runs, against 3.9X on
+the runners, while every nulls pass read it a win. The two readings that contradicted the rule
+finally chosen both sat in those passes, each with a row arm far slower than the same query at the
+other density. So a probe carries a control that fuses whole, the rule for which passes count is
+written before the run (a pass counts only where its control reads as the runners read it), and a
+shape is read only across the passes that count. The same task found that an Arrow-cached
+`InMemoryTableScanExec` under a row parent gets no `ColumnarToRow`: it produces rows as well as
+batches, so `ensureOutputsRowBased` leaves it alone, and Spark's row path reads that cache as rows.
+A plan meant to be "Spark's" over such a scan is the projection directly over it.
+
## A dispatch of Varka classes only skips the TPC-DS data job
`benchmark.yml`'s benchmark jobs wait for the TPC-DS data job, which took 8.6 to 13.1 minutes and