olaky commented on code in PR #36654:
URL: https://github.com/apache/spark/pull/36654#discussion_r883695110
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/finishAnalysis.scala:
##########
@@ -72,30 +73,34 @@ object RewriteNonCorrelatedExists extends Rule[LogicalPlan]
{
* Computes the current date and time to make sure we return the same result
in a single query.
*/
object ComputeCurrentTime extends Rule[LogicalPlan] {
- def apply(plan: LogicalPlan): LogicalPlan = {
- val currentDates = mutable.Map.empty[String, Literal]
- val timeExpr = CurrentTimestamp()
- val timestamp = timeExpr.eval(EmptyRow).asInstanceOf[Long]
- val currentTime = Literal.create(timestamp, timeExpr.dataType)
+ def apply(plan: LogicalPlan): LogicalPlan = applyWithTimestamp(plan,
Instant.now())
+
+ /** Required to build custom rules for commands that do not keep sub-plans
as children in Delta */
Review Comment:
I refer to open source Delta. Command like
[MergeIntoCommand](https://github.com/delta-io/delta/blob/532da849290f9fa63ccacfc176f39f6d4775035d/core/src/main/scala/org/apache/spark/sql/delta/commands/MergeIntoCommand.scala#L206)
do not have source added a children, and this is also not possible to add
easily. This is why the solution I am going for is a special rule which applies
this code with a shared timestamp. For this rule, I would like to re-use the
code from here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]