@@ -77,9 +77,9 @@ case class NonDeterministicRuntimeReplaceable(child: Expression)
7777 * A test-only [[RuntimeReplaceable ]] that opts out of eager replacement and whose `replacement`
7878 * contains a `CURRENT_LIKE` expression ([[CurrentTimestamp ]]) but is deterministic, evaluable, and
7979 * non-foldable (it also reads an input column). Used to check that `ReplaceExpressions` still
80- * rewrites it eagerly: the replacement depends on the later `ComputeCurrentTime` rule, which matches
81- * the `CURRENT_LIKE` tree pattern that a survivor would hide, so the `eagerReplace = false` opt-out
82- * must be overridden.
80+ * rewrites it eagerly: the replacement depends on the later `ComputeCurrentTime` rule, which
81+ * matches the `CURRENT_LIKE` tree pattern that a survivor would hide, so the `eagerReplace = false`
82+ * opt-out must be overridden.
8383 */
8484case class CurrentTimeRuntimeReplaceable (child : Expression )
8585 extends RuntimeReplaceable with UnaryLike [Expression ] {
@@ -467,13 +467,13 @@ class OptimizerSuite extends PlanTest {
467467
468468 // The replacement contains `CurrentTimestamp` (a CURRENT_LIKE node) but is deterministic,
469469 // evaluable, and non-foldable (it reads an input column), so it would otherwise survive
470- // `ReplaceExpressions`. A survivor exposes only the RUNTIME_REPLACEABLE pattern of its children,
471- // not the CURRENT_LIKE pattern of its hidden replacement, so `ComputeCurrentTime` (which runs
472- // right after and prunes on CURRENT_LIKE) could not reach the `CurrentTimestamp` to fold it into
473- // a single query-start literal -- leaving it to be evaluated per row at execution and yielding
474- // different values within one query. The gate forces eager replacement, exposing CURRENT_LIKE so
475- // it is folded here. The child is an attribute (not a literal) so constant folding cannot mask
476- // the problem.
470+ // `ReplaceExpressions`. A survivor exposes only the RUNTIME_REPLACEABLE pattern of its
471+ // children, not the CURRENT_LIKE pattern of its hidden replacement, so `ComputeCurrentTime`
472+ // (which runs right after and prunes on CURRENT_LIKE) could not reach the `CurrentTimestamp`
473+ // to fold it into a single query-start literal -- leaving it to be evaluated per row at
474+ // execution and yielding different values within one query. The gate forces eager
475+ // replacement, exposing CURRENT_LIKE so it is folded here. The child is an attribute (not a
476+ // literal) so constant folding cannot mask the problem.
477477 assert(! optimized.expressions.exists(_.exists(_.isInstanceOf [RuntimeReplaceable ])),
478478 s " Expected the CURRENT_LIKE RuntimeReplaceable to be rewritten eagerly: \n $optimized" )
479479 assert(! optimized.expressions.exists(_.exists(_.isInstanceOf [CurrentTimestamp ])),
0 commit comments